Hello, how are you guys doing?
I am fairly new to working with actionscript on mobile devices and this is the first time I post here.
It's nice to meet you all.
I am currently working on a game for both Android and iOS. So far everything works perfectly on iOS and most of the Android devices. The problem came when I tested it on a galaxy S2.
Somehow, I just could not get the game to run full screen on a galaxy S2 with Android 4.0.3. When I traced the stage width and height, it showed that the stage height was the stage height with the notification bar on even though the notification bar is gone. So when the game ran, the images seem to be in full screen correctly but there is an empty area at the bottom the size of the notification bar.
Like this: (the orientation is set to landscape)
The image were not supposed to be chopped off.
Here is the code in the main class where I did the tracing:
this.stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
this.stage.align = flash.display.StageAlign.TOP_LEFT;
this.stage.frameRate = 30;
this.stage.color = 0x000000;
stats = new Stats();
screenWidth = this.stage.fullScreenWidth;
screenHeight = this.stage.fullScreenHeight;
myScaleX = stage.fullScreenWidth/960;
myScaleY = stage.fullScreenHeight/640;
myStarling = new Starling(Game,stage);
myStarling.antiAliasing = 1;
The trace showed:
I had tested the same app on a Galaxy S with Android 2.3.6, an Asus Transformer, not sure what version of Android it was running on, and an iPod with Version: 5.1.1(9B206). They all worked correctly. This problem only occured on the Galaxy S2 with 4.0.3.
I really need some helps here. I hope I missed something obvious.
Thanks a lot for your time. I really appreciate any feedbacks.
The device I had problem with showed: Linus 3.1.10-ICS_kiss_v5
I do not have other Android phone with 4.0.3 with me now.
But I think this problem might have something to do with Android 4.0.3 since I have tested the same app on 3 different devices with Android 4.0.3 and they all showed the same problem.
The SDK I am using is: flex_sdk_126.96.36.19901 with AIR 3.3
That works but the the game will not be in full screen, it will have an empty strip at the bottom.
I actually found out what's the problem. I traced the stageWidth and stageHeight during resizing event. I found out that when it first resized, the stage width and height were the size with the notification bar. So when I pass the stage into startling, myStarling = new Starling(Game,stage), the stage is in the wrong size. For some reason, I can only get the correct stage width and height after the third resizing event.
So now I need to restart Starling everytime a resizing event happened. It gives me the right result but I am not sure it is a good idea to do that.
And thanks a lot for your time kglad~I really appriciate your help.
Europe, Middle East and Africa