BeanstalkBlue Posted March 1, 2017 Share Posted March 1, 2017 When I am fullscreen the canvas is not 100% height even though my CSS makes it that. When I resize the window the canvas height:width is always 2:1. Did I set code that makes this happen somewhere that I forgot? I searched everywhere but can't figure this one out. It seems like my code is the same as the babylon website Demo code, so I dont understand See attached images: Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 1, 2017 Share Posted March 1, 2017 You canvas and your body and your html have all to be at 100%/100% (something like that: https://github.com/BabylonJS/Babylon.js/blob/master/Playground/index.css#L1) Other question: which element do you use when calling setFullscreen? Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted March 1, 2017 Author Share Posted March 1, 2017 Hmm, I have that. When calling fullscreen I press F11 in my browser. But as you can see from screenshot #2 above, the canvas also resizes when I open the inspector, and it doesn't fill the screen, it stays at exactly 2.0 aspect ratio. (You can also see I have width:100% and height:100% in my #renderCanvas CSS. I copied the Babylon Demo CSS. No matter what size I make the window, the canvas is 2:1 aspect ratio (height = 2*width). Is there maybe code that I wrote that controls this? Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted March 1, 2017 Author Share Posted March 1, 2017 The CSS and the problem I describe can be seen in the app here: https://scarlet6.com/pre-alpha/ Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 1, 2017 Share Posted March 1, 2017 Just add a style to the div containing the canvas and set height:100% BeanstalkBlue 1 Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted March 1, 2017 Author Share Posted March 1, 2017 Oh, haha. Embarassing. I was setting height on the canvas but not on the parent div. Thanks as usual @Deltakosh GameMonetize 1 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.