Wow, red works! But I don’t understand how you could know that. It’s not mentioned in the documentation or the configuration. And in an example from a while back, @MrMen used a white mask with, I assume, no problems.
I did a bit of searching to get more info on masks needing to be red and now I’m even more confused. A year after that post, there was this one that I think I understand from the author of the extension:
And later on in the same thread:
Has something changed? If it does need to be red, then can that instruction be put in the extension description?
I was wondering the exact same thing and did a little research. GDevelop uses the PIXI renderer. The documentation says the following about it: For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. (PixiJS API Documentation)
So the red channel can be used to make an image transparent or partially transparent.
Here is an example:
The following mask is used on the sprite. I used five rectangles with the following values in RGBA: (255,0,0,255), gradient (255,0,0,255) to (0,0,0,255), gradient with the color blue and gradient with the color red to alpha 0 and as comparison a rectangle with the color magenta.
And this is how the result looks like.
So you can use white or also magenta, because both have the red channel with the value 255! It is always about the red channel.
I hope this hint was helpful and also helps others who deal with this extension.