As the title said, I want to fit the game canvas inside a div (on an HTML page) and have the game scale to the size of the div. Instead, it is naturally scaling the browser width, no matter the HTML/CSS voodoo I use on it.
Maybe I'm looking in the wrong place? I am unsure. Help?
Develop games in your browser. Powerful, performant & highly capable.
Still hoping for an answer on this one, if anyone has one.
Try Browser.WindowInnerHeight and Browser.WindowInnerWidth expressions.
If they give you the correct div dimensions, set canvas size to these numbers.
Also, have you tried iFrame instead of the div?
Try Browser.WindowInnerHeight and Browser.WindowInnerWidth expressions. If they give you the correct div dimensions, set canvas size to these numbers. Also, have you tried iFrame instead of the div?
I guess I'll have to mess with those numbers and see. I was hoping to avoid an iFrame, but it's not the end of the world if I end up having to go that route. Thanks for your input.