andreas_d Posted July 28, 2015 Share Posted July 28, 2015 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 worksand 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; }) Quote Link to comment Share on other sites More sharing options...
xerver Posted July 28, 2015 Share Posted July 28, 2015 You can't add a sprite to the scene *and* as a mask. Adding it as a mask makes it not draw (sets renderable = false). Quote Link to comment Share on other sites More sharing options...
andreas_d Posted July 28, 2015 Author Share Posted July 28, 2015 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 Quote Link to comment Share on other sites More sharing options...
xerver Posted July 28, 2015 Share Posted July 28, 2015 Sounds like a bug, I would post an issue on GitHub so we can look at it. Thanks! Quote Link to comment Share on other sites More sharing options...
andreas_d Posted July 28, 2015 Author Share Posted July 28, 2015 posted thanks for the input Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.