Open ralyodio opened 2 months ago
@ralyodio the .width
and .height
methods are not CSS properties, they can only accept px units.
However, 100vw
is equivalent to .width(window.innerWidth)
, which is the default. Same for height.
I saw this:
world.width([event.target.innerWidth]);
world.height([event.target.innerHeight]);
but i'm unclear why I'm passing an array. Is that correct?
No it should not be an array. Those methods take a single numeric argument. If you're reading it from the docs, the square brackets are there to indicate that the argument is optional. You can invoke it as a "getter" of the current width, without any arguments.
Makes sense.
Is there a way to set .scene-container to width/height of 100vw/100vh?