Copy link to clipboard
Copied
I am developing an android game. How can I set the screen resolution to fit the phone's resolution?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Can you describe it more detail?I'm a little bit confused.
Copy link to clipboard
Copied
use this code to trace out the resolution of your display:
import flash.system.Capabilities;
getScreenNVersion();
function getScreenNVersion():void{
trace("flash.system.Capabilities.screenResolutionX is : " + String(flash.system.Capabilities.screenResolutionX) + "\n" +
"flash.system.Capabilities.screenResolutionY is : " + String(flash.system.Capabilities.screenResolutionY)
);
}
then use this information to scale your stage accordingly.
How can I set the screen resolution to fit the phone's resolution?
You can`t without using "hacks", the stage resoultion can not dynamically be changed,