Jump to content

when Container is flipped Sprite Mask stops working


andreas_d
 Share

Recommended Posts

Hi guys,

 

Is this currently not possible using the framework?  Or am I going about it the wrong way?

I attempt to flip the a container containing 2 sprites, one acting as a mask for the other.  When they are flipped sprite mask no longer works

and both sprites disappear.

 

example : http://turnoffthe.tv/clients/pixi/error/

var stage = new PIXI.Container;var box = new PIXI.Container;var bg = new PIXI.Sprite.fromImage('portrait.jpg');var imageMask =  new PIXI.Sprite.fromImage('blurwhite.png');//flip the containerbox.scale.x=-1;box.position.x=1000;stage.addChild(box).addChild(bg);box.addChild(imageMask);// toggle the maskstage.interactive=true;stage.on('mousedown',function(e){(bg.mask == imageMask)? bg.mask = null : bg.mask = imageMask;			})
Link to comment
Share on other sites

Hi xerver,

 

I was only doing that for convenience so whoever looked at it could see the position of the mask when it was toggled off.  I get the same result when I comment out:

box.addChild(imageMask) 

The problem occurs when applying :

box.scale.x=-1;

Thanks for your reply

 

Andreas

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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