Anyone having issues with detecting device screen size on the first load of the first scene?
HoneyTribeStudios
Member Posts: 1,792
So I'm detecting the device screen size to adjust the camera height and camera origin so I can have auto stretching with universal binaries.
For some reason on a 3rd gen ipod (480 x 320 resolution, same as iphone 3gs) the first time the first scene loads - it won't use the camera origin offset that I've set.
When go to the second scene that does use the offset. And when I go back to the 1st scene it now uses the offset.
But on that initial load of the menu - there is a gap at the top of the screen because the camera origin offset is not being used.
Just wondering if anyone else is having the same issue and what a workaround might be? Also, does this happen on an iphone 4 or 5?
Only thing I can think of is to have a 'blank' scene as the first scene which is mainly black with a studio logo or something. Then you won't notice that the cam offset is wrong. But it's a bit crap to have to insert additional loading time.
For some reason on a 3rd gen ipod (480 x 320 resolution, same as iphone 3gs) the first time the first scene loads - it won't use the camera origin offset that I've set.
When go to the second scene that does use the offset. And when I go back to the 1st scene it now uses the offset.
But on that initial load of the menu - there is a gap at the top of the screen because the camera origin offset is not being used.
Just wondering if anyone else is having the same issue and what a workaround might be? Also, does this happen on an iphone 4 or 5?
Only thing I can think of is to have a 'blank' scene as the first scene which is mainly black with a studio logo or something. Then you won't notice that the cam offset is wrong. But it's a bit crap to have to insert additional loading time.
Best Answer
-
tenrdrmer Posts: 9,934I have found at times you have to run a constrain on the cam origins to keep the overscan stuff from jacking everything up. Not constantly just during the events that are messing it up.
Answers
As far as I can tell it only happens on the initial load of the first scene, or when coming back to the first scene having closed the game. All other situations seem to maintain the camera offset as specified by the rules I set up.
Cheers
Gs reads backwards so make sure its right at the lowest point in the layers.
If your still having problems you could wrap it in a timer mb.
Darren.
I'll either try constraining for a certain time or just include a blank scene as the first scene.
Make sure you preview on 100% and not on 50%
If you preview the game in ipad mode for example, then the value of the attribute
"screen.size.width" will be 1024 right? , and when dealing with universal builds you mostly rely on this value cause you move stuff around and manipulating the camera and on and on.. based on this value.
BUT, if you preview this same ipad project on 50% preview mode, it will register the value of the "screen.size.width" to 512 instead of 1024, and this breaks your rules and can drive one crazy
Roy.
I've set it up to show you from Darrens original universal project file if you're keen to have a look?
https://dl.dropbox.com/u/5079681/Bug_Example.zip
You just change the scene to one of the iphone layouts and select crop. Then hit pause and see what happens. I'd love some help if anyones got some spare time?
Thanks!
WHEN device AUTO-ROTATION = FINISHED
Change attribute Camera Origin to -46 / -128 [iPhone 4 and 5]
In conjunction with the initial Change attribute rules [as per Darren's video] in case someone rotates the device whilst playing. This way you don't need to use a CONSTRAIN behaviour and waste precious FPS
:-)