Jump to content

Mask with shade


Recommended Posts

Good evening everyone!

I'm using Typescript and Phaser 2.6.2.

I've a box where sprites are rendered, outside this box they aren't.

To do this I've applied e mask (drawRect).

Now I've to give to the top and the bottom of this box a little shade, so the sprites that enter from the top of the box starts to be rendered in the box with alpha 0 to alpha 1 and the sprites that leaves the box from the bottom are going to alpha 1 to alpha 0 and then they will be no more rendered outside the box.

How can I reach this?

The only solution I've found is to put a sprite or a bitmap data on... but is not a mask and it doesn't work as I desire... :-(

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