In my Android app I resize the GUI depending on the screen size. I want to do this as soon as the app starts.
Calling camera.get_window_size() on startup always returns the default values. I have tried to trigger it after “init_camera” and waiting one frame with the same result. Setting a timer for a second returns the actual width and height.
Is there an event or message that can be used to get the actual size as soon as it becomes available, to avoid the timer?
Are you manually setting the size? You should in most cases be able to design your GUI so that it does this automatically with the correct adjust mode and anchor settings. See GUI scenes in Defold for an example.
I’m not manually setting the size. I get away with not setting the width for almost all nodes, but couldn’t figure out how to do it with a node that needs to stretch.
I need it to stretch to fit between two buttons anchored to left and right of the screen. With stretch it uses a percentage of the screen width, but I need the screen width minus the side button widths. Couldn’t figure out to do that without code.
Native Android build. I’m working on two projects at the moment, one for Facebook Instant and one on native mobile. I’m having this issue on native Android.
I guess it will be the same on iOS, but haven’t yet come to make a build on iOS.