Page 1 of 1

This is Probably Impossible, but ...

Posted: 25 May 2016, 3:58
by Sambo
Is there a way to change the mask of a loaded image? Yes, I know there are Draw functions with opacity control, but let's say I wanted a dither effect instead or I only wanted to change the mask of part of the image. The first thing I would do was create a 32 x 32 image with a 2 x 2 black and white check pattern:
ugly image.png
ugly image.png (183 Bytes) Viewed 1756 times

(this is actually a 16 x 16, but you get the idea)
Now, I want to apply this to another image's mask, where some collider object overlaps the image. What I would like to do is basically "subtract" the mask from the image's mask in the overlapping zone, so that the area appears dithered, and I get a result something like this:
ugly image2.png
ugly image2.png (425 Bytes) Viewed 1756 times

(white = full opacity, black = full transparency. This would use 2 overlap zones)

I'm sure this is probably too advanced for SMBX, but I'm sure it could be done with OpenGL.