FixedScaleMode not working on HTML5
-
I'm exporting same app to flash and html5 targets.
The flash one keep 1:1 ratio when window size changed.
HTML5 one filling all the browser, but behaves like FillScaleMode.How can I keep 1:1 ratio with fullscreen resize on HTML5 target?
-
Try FixedScaleAdjustSizeScaleMode
-
@DleanJeans Worked, but some objects not working properly. I have a FlxInputText in my game and when I set the coordinate of it = 0, it is not setting it's x coordinate to 0. It gets the stage sizes from new FlxGame(width,height....).
-
I haven't tried this but you can add
FlxG.stage.addEventListener(Event.RESIZE, updateComponentsPosition);
And inside updateComponentsPosition(e: Event), update the position of your stuff
-
There's a better way for this using signals:
FlxG.signals.gameResized.add(updateComponentsPosition); function updateComponentsPosition(width:Int, height:Int):Void { // update position }