HTML5 Boostrap Grid

Hej !

I tried to put the “openfl-content” div into a “col” of bootstrip grid system, but the canvas go in a loop resizing height, I don’t know if anybody tried already that ?

Thanks in advance for reading,

Michal

add height:100% in your main html (index.html)

like this

<style>
		html,body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
</style>

Hi r8code,
Thanks for your answer but there already is height: 100% in the default template :
html,body { margin: 0; padding: 0; height: 100%; overflow: hidden; }

private function handleApplicationEvent (?__):Void in HTML5Application.hx is called in loop

You can make your OpenFL project use an exact width and height, and that would eliminate this problem, but it would not allow for it to resize quite to the size you want.

There is a problem where the OpenFL project looks at the DIV to see how big it should be. It reads that value, then dispatches an Event.RESIZE and resizes the canvas. But (depending on your CSS) your parent DIV may be larger now, due to the resize. It resizes again, and so on, it continues.

If anyone has ideas about how to improve the resize behavior, let me know. Otherwise, a set width/height will prevent the canvas element from being resize, which prevents the loop

Thanks Joshua for the answer :wink: