fli_frame(3alleg4)

✨ fli_frame ✨

okay bestie, welcome to the fli_frame page of the Allegro manual πŸ’– this is a 3alleg4 situation, iykyk.


πŸŽ€ NAME πŸŽ€

fli_frame β€” it stores the current frame number of the animation, no cap. Part of the Allegro game programming library. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <allegro.h>

extern int fli_frame;

πŸ’… DESCRIPTION πŸ’…

so this is a global variable, and it holds the current frame number inside your FLI file. that's it, that's the whole vibe. 🫢

why do you care tho? because it's lowkey perfect for syncing other stuff up with the animation β€” like, say you wanna trigger a sound effect at one specific moment. you can just peek at fli_frame inside a play_fli() callback function and fire off a sample right when the frame hits. iconic behaviour, honestly. ✨

here's the example, copied exactly because facts don't change even when the vibe does:

while (next_fli_frame(0) == FLI_OK) {
   if (fli_frame == 345)
      play_sample(trumpet_sound, 255, 128, 1000, 0);
   /* Rest some time until next frame... */
}

like, fli_frame == 345?? that's your cue, go play that trumpet 🎺 periodt.


πŸ‘‘ SEE ALSO πŸ‘‘


Allegro 🌈 version 4.4.3 🌈 fli_frame(3alleg4)

okay that's the whole page bestie, tysm for reading, go sync those frames πŸ’–βœ¨πŸŽ€πŸ¦‹ mwah πŸ’