Jump to content

Animating mask that's a Graphics Shape


Recommended Posts


I have a sprite object with an image that is using a graphics shape as a mask and I'm trying to animate the width of the mask but nothing is happening. When I check bounds of the mask everything results in (0,0,0,0) however I remove it from being as mask I get the correct bounds. I cannot seem to figure out what's going on. Any ideas?

var texture = PIXI.Texture.fromImage('_assets/s3/test1.jpg');
var sprite = new PIXI.Sprite(texture);
sprite.width = 500;
sprite.height = 500;
sprite.on('mousedown', on_down);

var masker = new PIXI.Graphics();
masker.beginFill(0xFF0000, 1);
masker.drawRect(0, 0, 200, 200);

function on_down(){
console.log( this.mask.getBounds() ); //returns all 0,0,0,0
TweenLite.to( this.mask, {width:500});//does nothing




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...