paleRider Posted July 11, 2017 Share Posted July 11, 2017 Hi everybody! In order to have a consistent behaviour of resize of Canvas/Engine I'm needing to add some lines before the call to Engine.resize(): //resize window.addEventListener("resize",function(){ Canvas.style.height="100%"; Canvas.style.width="100%"; Canvas.height=Canvas.innerHeight; Canvas.width=Canvas.innerWidth; // Engine.resize(); }); Well I know that the Canvas is on the side of HTML5 specification and BabylonJS has nothing to do there but, honestly, I find it odd there is not mention of these added four lines (bold ones) in the documents. Maybe I'm misunderstanding something? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 11, 2017 Share Posted July 11, 2017 As you might also put this in a header / style section & this really only needs to be done once, I think most opted for there. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 11, 2017 Share Posted July 11, 2017 Actually most of the time, the canvas style is defined in css and then engine.resize() will do everything else Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.