2D Toolkit Forum

2D Toolkit => Support => Topic started by: jasperPT on January 11, 2015, 03:49:25 pm

Title: Sprite mask with custom shape
Post by: jasperPT on January 11, 2015, 03:49:25 pm
Hi,

It seems the only current way to use a mask is with a square shape, is there any way of changing the shape or even better using a sprite as the shape of the mask?

Cheers,
Jasper
Title: Re: Sprite mask with custom shape
Post by: unikronsoftware on January 11, 2015, 11:11:33 pm
No there isn't, the mask solution uses depth, and the mask geometry is limited to a rectangle.
Title: Re: Sprite mask with custom shape
Post by: mangoocean on June 23, 2015, 08:37:55 am
Hi,
I've been trying to mask a sprite with depth, but whilst it works, other objects that are ABOVE this masked area in my scene also get cut off and not sure how to fix it. Tried different cameras, different depths and layer sorting.

Any ideas?
Thanks
Title: Re: Sprite mask with custom shape
Post by: unikronsoftware on June 23, 2015, 10:54:52 am
Different depth sorting should work, but the thing to look at will be the shaders. Run through the frame using the frame debugger to find out what its doing - it could be drawing in the wrongorder.
Title: Re: Sprite mask with custom shape
Post by: DarkSlash on July 24, 2015, 08:51:55 pm
Wanted to know the same. Sad that can't be done, Unity mask supports custom shapes but only for images objects, not for sprites :(