These are chat archives for pixijs/pixi.js

Jan 2016
Bar Ziony
Jan 19 2016 12:11
@englercj I get what you're saying. I thought that adding a property like that could end up being not in sync with the actual dimensions Pixi is rendering
@englercj I don't have a very specific "use" for the size. It's just an explicit property of the way my data is represented, so I thought to "relay" that directly to/in Pixi.
I wonder if I should do a "is-a" relationship between my classes (Layers) and PIXI (i.e. my layers extend PIXI.Container), like I'm doing now
or perhaps a "has-a" relationship is more appropriate. So my layer "has-a" PIXI layer as an implemention detail... And then there'a renderer that takes all these layers and turns them into a PIXI scene graph
Chad Engler
Jan 19 2016 16:28

not in sync with the actual dimensions Pixi is rendering

That's the catch, Containers are not rendered. They have no dimensions because we don't draw them :) Sprites are drawn though.

As far as extension vs ownership, it is up to you. Both have advantages and disadvantages, just whatever works best for you.

Ivan Popelyshev
Jan 19 2016 16:29
pixijs/pixi.js#2299 - thats very good idea
Bar Ziony
Jan 19 2016 16:41
@englercj : Thanks. Can you perhaps elaborate on extension vs ownership, in this context (of PIXI.Container)?
Chad Engler
Jan 19 2016 16:50
it just depends on how your app is structured. If you want to say someContainer.addChild(myLayer) or someContainer.addChild(myLayer.sprite). Totally up to you and your app structure
the second might be more efficient since it reduces the amount of polymorphism for the render functions, but you probably wouldn't notice