05-06-2011 02:24 PM
I'm in the process of "future proofing" my app before I start adding more features to it. I remember at some point, I believe a Webcast, RIM saying to make the app UI work off of the screen width and height instead of hard-coding positions because there could/would be other sized PlayBooks in the future.
So in that effort I started playing around, but noticed that my UI elements were starting at a position that wasn't the upper-left of the screen. After doing some investigation I realized that the "stage" was only 500 by 375, a 4x3 resolution and the PlayBook was centering this in the middle of the screen (the odd UI element offset).
At the top of the initial app class your supposed to specify a "[SWF(...)]" attribute. The only part I don't specify is the screen size. When this is set then the stage takes the specified screen size.
Finally, the app still takes up the whole screen but the UI is specified that it only takes up the relatively small area. The stage has fields specifying the "fullscreen" width and height, and also specifies the display state as "normal" instead of "fullscreen".
Does anyone know how to get the app to take up the full screen real estate, without specifying the absolute screen size in the SWF attribute?
Solved! Go to Solution.
05-06-2011 06:42 PM
this should work:
//Class
[SWF (backgroundColor = "0x000000")]
public class FullScreenTest extends Sprite
{
//Constructor
public function FullScreenTest()
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 60;
init();
}
05-06-2011 08:40 PM
Perfect, thank you.