These are chat archives for pixijs/pixi.js
Hey, I am facing an unexpected issue in PIXI.Container
import PIXI from 'pixi.js'; let stage = new PIXI.Container(); stage.width = 100; stage.height = 200; console.log(stage.width, stage.height);
It outputs "0 0"
I am using pixi v3.0.11
@ivanpopelyshev, that makes sense. Thanks!
It is also not marked as readonly in docs
Here is an excerpt from a comment I made a while back:
In pixi, a Sprite's bounds are defined by the texture. That is, the size of the end-result of the rendered object. Similarly, since a Container is not drawn, and therefore the bounds of it are defined by the children it contains. Particularly, by the bounds of those children. For a Graphics object, the bounds are defined by the geometry that you draw in it. If you draw another rectangle in a Graphics object outside of the current bounds, the bounds expand to include the newly drawn geometry.
Hopefully that makes sense, and gives you a quick concept of how bounds are structured in Pixi.