Multiple Masks

I am using the following set up:

a background image

a black rectangle over that image

br1Group (mask applied on tao)

br2Group (mask applied on tap)

br3Group (mask applied on tap)

I am using an oversized mask (black circle in the middle, 4 pixel black border) so that no matter where is tapped the background image does not show through.  This set up works perfect in the Windows simulator and on my Android CM10 Nook HD+, but when I test on an Evo Android phone the background image completely show through on the second tap (next mask is applied on top).  My taps are still recognized on the black rectangle object, even though it is non existent on the screen.

Any advice on other ways to acheive multiple masks or any ideas on why this just seems to be happening on the Evo phone is much appreciated!

-Chris

Hi Chris,

The likely cause is that you’re exceeding the “texture unit” limit on the Evo. This limit varies by device, but essentially, masks take up an additional graphical texture unit in the hardware, and when you “nest” masks, each nested one takes up an additional unit. If you exceed the limit, the masks will not appear as expected.

You can determine the number of available texture units available on your device via the “system.getInfo(“maxTextureUnits”)” API. See here: http://docs.coronalabs.com/api/library/system/getInfo.html

Best regards,

Brent Sorrentino

Brent,

Thank you for the quick response!  I just checked and on the windows simulator I get a max of 4 (as well as on my Nook HD+), but on the phone it is only 2.  I will look for a different way to achieve the same effect, thanks again!

-Chris

Hi Chris,

The likely cause is that you’re exceeding the “texture unit” limit on the Evo. This limit varies by device, but essentially, masks take up an additional graphical texture unit in the hardware, and when you “nest” masks, each nested one takes up an additional unit. If you exceed the limit, the masks will not appear as expected.

You can determine the number of available texture units available on your device via the “system.getInfo(“maxTextureUnits”)” API. See here: http://docs.coronalabs.com/api/library/system/getInfo.html

Best regards,

Brent Sorrentino

Brent,

Thank you for the quick response!  I just checked and on the windows simulator I get a max of 4 (as well as on my Nook HD+), but on the phone it is only 2.  I will look for a different way to achieve the same effect, thanks again!

-Chris