I want to calculate and set some "optimal content width and height" global variables, lets say = x% of the window size, depending on the aspect ratio of the screen. I know how to do that, but I can't find a way to set these globals before my objects are created (since they use these vars with a "on created" event).
I can solve this with an intro layout where I set the vars and then "go to next layout". This way, however, the setup is broken everytime I press preview (as it runs only the current layout, by default).
The second option I thought of was to set them inside a js script in "runOnStartup" function. However I can't find how to get the screen width,height from there.
I guess there must be some event condition that becomes true before objects creation ("on layout start" happens after objects are created)...