'How to get Display Size [HAXE FLIXEL]
I was just wondering how I could get the size of the display in HaxeFlixel (usually 1920,1080/1280,720). This is not to be confused with the window size.
Solution 1:[1]
You could use https://api.openfl.org/openfl/system/Capabilities.html#screenResolutionX / https://api.openfl.org/openfl/system/Capabilities.html#screenResolutionY to obtain resolution.
Solution 2:[2]
You should be able to see this in your Main.hx file. It should look something like this:
class Main extends Sprite {
public function new() {
super();
addChild(new FlxGame(1920, 1080, GameState, true));
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Andrew |
| Solution 2 | Richard Oliver Bray |
