Possible bug with Mask?

Hi Corona Community,

I believe (but am not 100% sure) I have stumbled upon a bug relating to graphics.newMask( )

In my app, I have a background, and a separate image of clouds and a mask (a black circle on a white background) to make part of the clouds transparent, simulating a fog of war effect.

The bug is that, even though the mask is a circle and nothing more, parts of the image that are not supposed to be transparent are in fact transparent.

Speaking in more detail, portions of the image being masked along a “+” shaped path, are transparent (when they shouldn’t be).

Does anybody know whey this is happening? And more importantly, how to I prevent this?

Please find the attached files to get a better idea of what I am experiencing.

Thanks in advance! :slight_smile:

KC

Your mask doesn’t follow the second rule of masks:

https://docs.coronalabs.com/daily/api/library/graphics/newMask.html#image-mask-requirements

The mask image must be bordered by at least 3 pixels of black space on all four sides. You may need to increase the overall size of your mask image to include this border.

You want to use the technique used in the X-ray example that comes with the simulator.

Your mask doesn’t follow the second rule of masks:

https://docs.coronalabs.com/daily/api/library/graphics/newMask.html#image-mask-requirements

The mask image must be bordered by at least 3 pixels of black space on all four sides. You may need to increase the overall size of your mask image to include this border.

You want to use the technique used in the X-ray example that comes with the simulator.