I’m making a game for mobiles. I listen to Event.RESIZE from the stage and resize my content to fit it into the screen. Everything works fine on Android, but not on iOS. On iOS stage.stageWidth and stage.stageHeight have “non-retina” values, e.g. 1024 and 768 on my iPad3 instead of 2048 and 1536. The content fills the whole screen and it’s visibly pixelated (it’s not that bad on ipad, but on iphone it looks ugly).
There is a number of topics about retina on the forums, but I couldn’t find a solution for my issue. It was mentioned somewhere that an app can start with wrong resolution values and later after Event.RESIZE they get updated with the right ones. As I said I do listen to this event. For me it gets fired 2 times in the beginning, both times stageWidth has the same wrong value.
Yes. I just tried to run it on my iPhone4 and trace(stage.stageWidth, stage.stageHeight) in stage_onResize produces 320,480 (not 640,960 as it should).
Yours works fine . If it didn’t work (correctly) it would mean that all my devices themselves are screwed and that’s unlikely.
This is what I have in my project.xml about the window:
We have a <window allow-high-dpi="true" /> flag in the current Lime, but I believe it is true by default. This should change whether or not a retina surface is allowed or not
It seems it isn’t set true by default. I have problem with very poor graphics quality on mobile browsers. After changing this flag to true, graphics looks really great on mobile browsers.