I want to manipulate masks in PIXIJS. I wrote the code based on the official example. (https://pixijs.io/examples/#/masks/sprite.js).
const app = new PIXI.Application({
width: $(window).innerWidth(),
height: $(window).innerHeight(),
backgroundColor: 0x000000,
antialias: true,
});
app.stage.hitArea = app.screen;
app.stage.interactive = true;
const rect = new PIXI.Graphics().beginFill(0xff0000,1).drawRect(0,0, 500, 500).endFill();
const sprite = PIXI.Sprite.from('Assets/UI/play.png');
sprite.x = 250;
sprite.y = 250;
rect.mask = sprite;
app.stage.addChild(rect);
I moved sprite, but it did not move from (0,0). this image shows the result of the execution. How do I move or resize the mask? thank you.
PIXIJS:6.2.0 Running with webpack and babel.