These are chat archives for pixijs/pixi.js

22nd
Oct 2017
Thomas Persson
@thomaspersson
Oct 22 2017 10:47
hi, I am trying to create a mask for a Text, because I dont want to show the third line (multiline text). I thought I could do a Graphics object, set x and y from text and draw a rect and do text.mask = myGraphics but then the text wont show at all. how should I mask text?
sort of like overflow: hidden in css.
Thomas Persson
@thomaspersson
Oct 22 2017 10:56
never mind, was a silly mistake :D
Ivan Popelyshev
@ivanpopelyshev
Oct 22 2017 11:58
the trick is to addChild the graphics too.
mask must be positioned in the stage the same way you psoition the element
otherwise how will pixi know where exactly do you want the mask?
mask is not a child of masked element, you have to add it to stage manuallyu