Jump to content

Sprite mask invert problem


Majek
 Share

Recommended Posts

Hi!

i have a problem with masking in pixi js. 

What i want to do is a hole in PIXI.Graphics rectangle with PIXI.Sprite .png mask. 

Here is codepen: 

I want to make my cloud transparent, so that i can see a red background (pls check commented line in codepen). Any help?

Thanks!

Link to comment
Share on other sites

That's not the mask, but performance is even better, and it uses same principle as internal mask. I use http://pixijs.github.io/examples/#/layers/lighting.js as a base, but i dont use pixi-lights plugin. Red background, grey foreground (with multiply), and on top of that foreground im adding shapes you are using for masking, with ADD blendmode. "VoidFilter" basically means that the container is rendered into separate layer, and then rendered yto main stage.

What am I doing: 

Link to comment
Share on other sites

On 28.04.2017 at 11:59 PM, ivan.popelyshev said:

That's not the mask, but performance is even better, and it uses same principle as internal mask. I use http://pixijs.github.io/examples/#/layers/lighting.js as a base, but i dont use pixi-lights plugin. Red background, grey foreground (with multiply), and on top of that foreground im adding shapes you are using for masking, with ADD blendmode. "VoidFilter" basically means that the container is rendered into separate layer, and then rendered yto main stage.

What am I doing: 

Hi! Thanks for your answer, its almost that! One important difference, i need my page to be visible through the holl. In your example i can see only background object in pixi.js,  not my page. Any ideas, is it posiible to do this?

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