Hello,
I am using openFL version 8.9 and HAXE to develop HTML5 games.
I have successfully loaded .swf file into my project.
In my Main.hx, I set width as stage.stageWidth and height as stage.stageHeight.
In project.xml instead of hard coding width and height as:
<window width="800" height="640"/>
, I want to set width and height as stage.stageWidth and stage.stageHeight respectively,something like:
Wait… That stageWidth and stageHeight are taken from the XML.
You can’t set the XML to point to those variables because those variables read the XML to know their values. (Not literally, but that’s where the value comes from).
If you want a “always fill the screen” you can set the width and height to zero (as ludo explained above)
How odd. Maybe you are lacking resize="true" ?
I use width and height in zero all the time to make responsive games. You then have to listen to the resize event to change everything accordingly
If you set 0 in the xml. Your html canvas in your html will be 100%.
But that doesn’t mean that all your openfl content will fit your canvas.
So you need to listen to the resize event.
I think somebody is currently working on SCALE_MODE so maybe you won’t have to do it by yourself soon.