Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3980

Issue trying to create stage that fills browser window

$
0
0

I am trying to create a stage which fills the browser window; as well as a window.onresize handler which resizes the renderer (and underlying canvas) to the new window size. Unfortunately it seems like if I simply set the renderer size to being window.innerWidth, window.innerHeight, I get scroll bars showing. The only way I can get rid of the scroll bars is to resize to innerWidth, innerHeight - 4. This of course leaves a 4 pixel high gap at the bottom of the browser window. As you can see in my screenshot, the canvas goes right up to the edge for the left, top, and right sides, but the gap is visible on the bottom. If the height is any greater than window.innerHeight - 4 (-2 or -1 for example), I get scrollbars.

I do have this css in my html: 

<style>* {padding: 0; margin: 0}</style>

Any ideas what I'm doing wrong to get a full sized canvas? I did notice that 'run pixie run' does not exhibit this behaviour (it was able to fill up the entire window), and glancing through the code and its resize function I didn't see much difference.. Thanks in advance!

example.png


Viewing all articles
Browse latest Browse all 3980


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>