Hey Folks,
I have a ui that sits at the bottom of the scren. My initial screen is setup for 1920x1080. I have a safe view area that's setup for 80% of that resolution.
My safe area class that runs on stage resize, very simple:
// Set width and height.
this.width = Math.floor(stage.stageWidth * .8);
this.height = Math.floor(stage.stageHeight * .8);
// Center safe area.
this.x = Math.floor((stage.stageWidth / 2) - (this.width / 2));
this.y = Math.floor((stage.stageHeight / 2) - (this.height / 2));
So that gives me a box that shows my safe area at all times.
This is what I have for setting up my Liquidstage/Liquiarea:
// Setup liquid stage.
var ls:LiquidStage = new LiquidStage(stage, stage.stageWidth, stage.stageHeight, Math.floor(640 * .8), Math.floor(480 * .8));
// Setup HUD action bar.
var hudActionArea:LiquidArea = new LiquidArea(this,
safeArea.x,
((safeArea.y + safeArea.height) - hudActionBar.height),
safeArea.width,
hudActionBar.height,
0xff0000,
Math.floor(640 * .8),
Math.floor(480 * .8),
Math.floor(stage.stageWidth * .8),
Math.floor(hudActionBar.height),
false,
null,
false);
hudActionArea.attach(hudActionBar, { scaleMode:ScaleMode.PROPORTIONAL_INSIDE, vAlign: AlignMode.BOTTOM, crop: true } );
hudActionArea.pinCorners(ls.TOP_LEFT, ls.BOTTOM_RIGHT);
hudActionArea.preview = true;
ls.attach(hudActionArea, ls.BOTTOM_CENTER);
The liquidstage uses the entire canvas, but the liquidarea is offset to match up with the safearea. When I first preview the SWF it looks fine, the preview area, is within the safe view but as soon as I resize the SWF, the preview area's height is larger and the UI get's pushed down to the bottom of that preview area and it's no longer in the safe area, but at the bottom of the canvas.
It's scaling correctly, but I have no clue why it's resetting it's height and moving the UI down when I resize the SWF.
Any help would be appreciated.
Thanks,
Josh