Jump to content

Filters on Sprites used as masks


Sharpleaf
 Share

Recommended Posts

I'm adding a filter to sprite (generated by RenderTexture) to make the sprite solid black.

I've tried simply 

islandShape.tint = 0x000000

and I've tried

 

var makeBlack= new PIXI.filters.ColorMatrixFilter();makeBlack.brightness(0,false);islandShape.filters = [makeBlack];

I've tried applying both to the texture and to the sprite that uses the texture.

 

Now, if I add that sprite to a container just as a child (not a mask), then I see a nice, black shape (as I would expect and want).

However, if I add the sprite as a mask to a container and start adding other sprites to the container, it acts as if the tint or filter was never applied. The details of the original untinted (or unfiltered) sprite shine through. 

 

Is this expected behavior? Did I stumble upon a bug? Or, am I doing something wrong?

 

Thanks!

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