I developing an application in Flash Builder with AS3 only (no flex stuff). In flex it is possible to set the application’s dpi by the following code:
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="320">
But I using only AS3. I have read that it is not possible to change the application’s DPI in run-time (with AS3), but how can I set this in project settings, compiler settings or is there another way to do it?
Also, what is the default application’s DPI setting?
Ask it here because can’t find it on the net (only flex based solutions).
The DPI on mobile is set by the hardware, it is entirely dependent on the phone and screen. When you set the applicationDPI in a Flex mobile you’re telling Flex to automatically scale your assets.
In an AS3 mobile project you’re going to need to handle this yourself.
You can get the current DPI using
Capabilities.screenDPIbut I think what you may be after is a ratio to scale your assets by. One way to do this would be to start with the original game width.You can then get a ratio using
And apply this to your assets
Now this isn’t going to take the rotation of the device into account, so fullScreenWidth/Height may be flipped. To check for that you’re going to need to do something like this
Hopefully this helps