Proper way to scale assets for multiple devices
I am working on an ActionScript Mobile app which I intend to build for iphone 3gs, iPhone 4 and iPad 1&2.
What is the correct way to scale assets such as background images so that I may be able to use the same graphical assets for all of the mobile devices above?
Using AIR 2.7 and in my app descriptor file I have specified "cpu" for renderMode and "true" for fullScreen. From what I have read, the fullscreen bug in AIR 2.7 is only present when using gpu as the rendermode w/ fullscreen, so I don't think that is what is going on.
I have a background image which is supposed to fill up the entire screen for all devices. This image is in a swc file and has these dimensions: 960 x 640
In my main class I have included the following:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
When I test on iPhone 4, it looks fine and fills up the entire screen as expected. When I test on iPad 1, the image is not wide enough and is a bit too short. Shouldn't the following code force the background image to fill the entire screen regardless of device?
backgroundImage.width = stage.stageWidth;
backgroundImage.height = stage.stageHeight;
Instead, it makes the backgound really small in the upper left hand corner for all devices. Can someone shed some light here? I am stumped. ![]()
Hopefully I am doing someone stupid and it is an easy fix..Thanks!
