These are chat archives for pixijs/pixi.js

11th
Mar 2015
Ryan
@ryanmcnz
Mar 11 2015 00:23 UTC
@GoodBoyDigital Awesome cheers. If I have a bunch of black and white things moving around in a Container, will I be able to harness that as a mask somehow? I'm guessing this would have to be captured into a Sprite, although I haven't quite figured that out yet :)
Perhaps I'm mis-using the Container in this context, and those black and white things moving around should be rendered directly into a Sprite. I'm a bit unsure.
Chad Engler
@englercj
Mar 11 2015 01:34 UTC
You can use any shape drawn with a Graphics object as a mask, or a sprite
whichever is easiest for you
Ryan
@ryanmcnz
Mar 11 2015 01:43 UTC
Ah brilliant, thanks. I read 'SpriteMaskFilter' and figured it only applied to Sprites as the mask source. Woops!
Chad Engler
@englercj
Mar 11 2015 02:41 UTC
It is
if you use a graphics mask it is used like this:
```js
var mask = new PIXI.Graphics();

// draw...

var sprite = new PIXI.Sprite();
sprite.mask = mask;
Masking with graphics isn't via a filter, since it is a path we can do clipping in canvas and it works both places
Sprite masking is special, and uses a filter (so webgl only)
Ryan
@ryanmcnz
Mar 11 2015 02:50 UTC
Ah yes I understand now, thanks for clearing that up :)
benny00100
@benny00100
Mar 11 2015 13:04 UTC
I am confused. My local PIXI (V3) version has the method Container.getChildByName - however I cannot find it on the repository dev branch anymore? Where has it gone?
benny00100
@benny00100
Mar 11 2015 16:43 UTC
Ah ... there you go. Thanks man!
Chad Engler
@englercj
Mar 11 2015 16:52 UTC
No problem, in v3 we are trying to make as many things that don't need to be in core as plugins!
That way there are examples and eat-your-own-dogfood ways to make awesome v3 plugins!
In fact, almost any feature that the community wants can be made as a plugin by anyone. No longer does it have to go into core
benny00100
@benny00100
Mar 11 2015 17:35 UTC
Wow - that's a very clever strategy. Like those open plugin'able architectures. Great!