These are chat archives for pixijs/pixi.js

27th
Apr 2017
Daniel
@bitbay
Apr 27 2017 11:00

Hello team!
I was wondering...using pixijs 4.5.1, immediately after adding a child (width: 256px, height: 256px) to a PIXI.Container, shouldn't the container reflect in its dimensions the sum of its content?
I get width: 0, height: 0;

// sprite is a PIXI.Sprite with defined dimensions...
console.log(sprite.width); // output: 256
console.log(sprite.height); // output: 256
let container = PIXI.Container();
container.addChild(sprite);
console.log(container.width); // output: 0
console.log(container.height); // output: 0

I can imagine that for any reason the containers dimensions are not instantly updated after adding a child to it... any methods i can call to update its dimensions manually?

Daniel
@bitbay
Apr 27 2017 11:08
yep, it seems that invisible objects (read !sprite.visible) don't add to the calculation of a containers bounds. Thanks!
Christopher Pietsch
@cpietsch
Apr 27 2017 12:10
Hey there, I am trying to import the compressedTextures from the pixi.js package but it looks like it is undefined
import { Container, WebGLRenderer, Texture, Sprite, loaders, BaseTexture, CompressedTextures } from 'pixi.js'
basically I am trying to get the https://pixijs.github.io/examples/#/textures/dds.js example running in es6 / webpack
Christopher Pietsch
@cpietsch
Apr 27 2017 12:23
has anyone an idea how to get the dds example running in an es6 / webpack / babel env ?
Christopher Pietsch
@cpietsch
Apr 27 2017 12:39
looks a bit like you have to import it on your own: https://pixijs.github.io/examples/required/plugins/pixi-compressed-textures.js