This is Probably Impossible, but ...

Description: Archive discussion
============================
Original description:
Official subforum for LunaLua - an extension framework for SMBX Engine Version 1.3 (which a core of SMBX 2.0). Share your creations that require the use of LunaLUA. You may also share info/tutorials on how to use LunaLUA.

Sambo M
Topic author, Count
Count
Avatar
Sambo M
Topic author, Count
Count
Age: 26
Reputation: 15
Posts: 264
Joined: 27 Jun 2014

Post #1by Sambo » 25 May 2016, 3:58

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 3365 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 3365 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.
Image
Current Project:
Image

Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 3 guests