![]() I've tried it and it works but like I said there may be an easier way. The 800 x 480 is just going to be whatever resolution you are targeting to being with, you can make constants for these values. Once it has been fired, you can calculate the your new scale factor based on the new size then apply that scaling to your display objects. There may be an easier way to do this but you can listen for the Resize event which will give you the correct stage size for the device you are on. Everything you do, no matter what device or platform or os or technology, should be screen-independent at this point. Long story short, if you are programming for a single screen size, you are doing it completely wrong. Android currently supports as high as 680 dpi, I believe. Nowadays, there isn't a high-end phone out there lower than 320 dpi (the iPhone) with many in the mid-400's. It's also worth noting that your assets are likely too small for higher-resolution screens. My guess is you will have to rewrite a significant portion of your game to do this. Now, you need to set it to (stage.stageWidth - object.width ) / 2. So you want to center something? On the 800px screen, you may have set the x value to 450px for a 100px wide object. Avoid setting stage size, and avoid setting stage.scaleMode too I cannot remember if that will even work in AIR, honestly. ![]() You should also avoid setting the stage size on mobile devices entirely. The idea is to completely eliminate any hard values. So instead of setting your game to run at 800px in width, you make it run at stage.stageWidth and you use resize functions (add an Event.RESIZE listener to stage) to make sure everything fits within that. You need to avoid using absolute numbers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |