Jump to content

Help with masking


Recommended Posts

Hey there all, I'm confused with masking

I have two layers (Phaser.Groups). The bottom layer contains some objects, the top layer contains a simple animated Phaser TileSprite. (Image attached, I've used a nautical analogy )

What I'm trying to do is punch a hole in the top layer, so you can see objects on the bottom layer. I have assumed a mask is the best way to do this. The mask also moves with the mouse pointer.

I am drawing the mask via graphics (basically just a white drawCircle of a fixed size), and applying it via the mask property on the top-most Tilesprite.

Unfortunately, when apply the mask to that top layer, it shows a circular portion of the top layer and I can see the entire bottom layer. Basically I need the inverse of that - is an inverted mask  possible?



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.

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.


  • Recently Browsing   0 members

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