In 2d you can simply use maskimage with any color.
In 3d the mask color is pure black (rgb = 0,0,0).
Use texture flag '4' when loading the texture and it will treat black regions as transparent.
If you wish to create a texture while the game is running then you will need to set the alpha channel of the transparent pixels as opposed to simply writing an rgb value of 0,0,0 to those pixels.
In 3d the mask color is pure black (rgb = 0,0,0).
Use texture flag '4' when loading the texture and it will treat black regions as transparent.
If you wish to create a texture while the game is running then you will need to set the alpha channel of the transparent pixels as opposed to simply writing an rgb value of 0,0,0 to those pixels.