Dithering fades

Started by brushfe, Thu 05/10/2023 12:20:46

Previous topic - Next topic

brushfe

Hello!



I was wondering if anyone has had experience using dithering to fade in/out an object.

My background is in pixel art, so my instinct is to draw this frame by frame, but maybe there's a simpler way? I poked around for a plug-in, but came up empty handed.

Thank you for your help!

eri0o

Uhm, there is a method in Drawing Surface called Set Pixel and you can do it using COLOR_TRANSPARENT. The problem is SetPixel is not super fast, but if the object isn't as big it can work since you aren't actually setting all pixels, just a few per frame to gradually dither the thing out of existence.

If it's an object you set it's graphic to a dynamic sprite and then operate on this. If it's a character you will need to lockview and modify the specific ViewFrame.

If it's a one off thing, I think bringing these sprites from somewhere and simple animating is easier.


newwaveburritos

Oh, I'm the guy that @Khris was responding to before because I had the exact same issue where I wanted more of a pixel fade than the Transparency++ in the manual.  That script he posted is for a character but I think you could either edit the script or more hilariously make a screenshot a character and then fade that out.  But I've used that script quite a bit and just made everything I've used it on a character rather than edit anything.  It's pretty great!

brushfe

Amazing! These are both fantastic solutions, thank you all for sharing. And congratulations on such an elegant module!

I think a combination of both methods will be perfect. And I'll definitely try the 'everything that fades is a character' trick!

Thanks again!

SMF spam blocked by CleanTalk