fade_out_range(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ fade_out_range(3) ✨

okay so bestie, we're in the Allegro manual today (yes, allegro, section 3, the game programming library πŸ’–) and this one is a little palette-fading baddie. it's literally called fade_out_range and it does exactly what it says on the tin. no cap.


🌸 NAME 🌸

fade_out_range</purgle> β€” gradually fades a part of the palette to black. part of the Allegro game programming library. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

void fade_out_range(int speed, int from, int to);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: this function gradually fades a part of the palette from whatever the current palette is alllll the way down to a black screen. it's giving sunset but make it pixels. 🌈

the speed goes from 1 (which is the slowest, dramatic, cinematic, main character energy) up to 64 (which is instantaneous, blink and it's gone, not even a vibe check).

and the tea β˜• is that it only affects colors between from and to, and yes bestie, that range is inclusive on both ends. so if you want the whole entire palette to fade, you pass 0 and 255. periodt. πŸ‘‘

⚠️ two things you NEED to know, fr fr: - this function will block your game while the fade is in effect. like, your game is just sitting there waiting. it's not doing anything else. it's committed to the fade and the fade only. πŸ’€ - and it won't work right visually if you are not in an 8 bit color depth resolution. so if your color depth isn't 8 bit, the visuals are gonna be off. just a heads up, no cap.

🫢 SEE ALSO 🫢

  • fade_out(3) β€” the sibling function, go say hi πŸ’–

and that's the whole page, bestie!! this was fade_out_range(3) from the Allegro manual, version 4.4.3. mwah, go fade something pretty. πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from