LucaDB Posted May 13, 2017 Share Posted May 13, 2017 Hi, this is my first post I'm trying to use an image (png) as a container mask, it seems to work well on macOS but on Windows 8.1/10 ( ie11, edge, firefox 53) mask has no effect. Here is the simple code var app = new PIXI.Application(window.innerWidth,window.innerHeight); document.body.appendChild(app.view); var baseContainer = new PIXI.Container(); app.stage.addChild(baseContainer); var theMask = PIXI.Sprite.fromImage('mask.png'); var baseImg = new PIXI.Sprite.fromImage('base.jpg'); baseContainer.addChild(baseImg); baseContainer.addChild(theMask); baseContainer.mask = theMask; I'm using PIXI 4.4.1 Any idea why this is not working? Thank you Quote Link to comment Share on other sites More sharing options...
LucaDB Posted May 13, 2017 Author Share Posted May 13, 2017 Here is the pen Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 13, 2017 Share Posted May 13, 2017 It works if you remove "new" word. PIXI.Sprite.fromImage is a static function, not a constructor. Quote Link to comment Share on other sites More sharing options...
LucaDB Posted May 13, 2017 Author Share Posted May 13, 2017 Thank you for your reply Ivan. I edited the pen, unfortunately the result is still the same . First image is on Windows Internet Explorer, second one is the desired result in Chrome Thanks Quote Link to comment Share on other sites More sharing options...
LucaDB Posted May 13, 2017 Author Share Posted May 13, 2017 Why is my reply hidden? Quote Link to comment Share on other sites More sharing options...
LucaDB Posted May 13, 2017 Author Share Posted May 13, 2017 Thank you for your reply Ivan. I edited the pen, unfortunately the result is still the same . ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 14, 2017 Share Posted May 14, 2017 It works for me in ie11 and edge. Are you sure you have videodrivers installed on Win machine? no drivers => no webgl => canvas fallback doesnt have sprite masks. However it can be emulated with MULTIPLY blendmode instead. Quote Link to comment Share on other sites More sharing options...
LucaDB Posted May 15, 2017 Author Share Posted May 15, 2017 Yes, that was the problem. I was testing on a video driverless machine (browserstack). Thank you for your help. ivan.popelyshev 1 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.