Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: brushfe on Thu 05/10/2023 12:20:46

Title: Dithering fades
Post by: brushfe on Thu 05/10/2023 12:20:46
Hello!

(https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/5/0538b0677f749b37e52b9e3ab82e60c43f9aeae8.gif)

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!
Title: Re: Dithering fades
Post by: eri0o on Thu 05/10/2023 14:16:42
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.
Title: Re: Dithering fades
Post by: Khris on Thu 05/10/2023 14:59:05
Lookie here:

https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/pixel-based-transparency-effect/msg636646291/#msg636646291

(not exactly dithering but pixel-based fading nonetheless)
Title: Re: Dithering fades
Post by: newwaveburritos on Thu 05/10/2023 17:58:12
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!
Title: Re: Dithering fades
Post by: brushfe on Fri 06/10/2023 11:13:59
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!