MLV_animation.h(3)

📦
version 3.1.0 · 2 versions
, in ubuntu jammy

🌸 MLV_animation.h 🌸

okay so bestie, quick vibe check: this is the manpage for MLV_animation.h(3) from the Library Functions Manual, and it's the header that declares all the prototypes for making animations happen 💖 like, this is where the whole animation machine lives, no cap.


✨ NAME ✨

MLV_animation.h — this file defines the prototypes of the functions that let you put animations into play. that's the whole job. iconic of it.


🦋 SYNOPSIS 🦋

💫 Définitions de type 💫

  • typedef struct _MLV_Animation MLV_Animation — this type encodes an animation. one animation. the whole thing. 🎀
  • typedef struct _MLV_Animation_player MLV_Animation_player — this type encodes an animation player (the little guy that reads your animation out loud, basically). 💅
  • typedef struct _MLV_Animation_book MLV_Animation_book — this type is a book, and that book holds a whole bunch of animations. it's giving library energy. 📚✨

🎀 Fonctions 🎀

  • MLV_Animation * MLV_create_animation (unsigned int nb_frames, unsigned int nb_layers, unsigned int nb_channels) — creates an animation with a given number of images. pick your counts, get a fresh animation 🫶
  • void MLV_free_animation (MLV_Animation *animation) — this function frees the data allocated for the animation. bye bestie, releasing that memory 🧚
  • void MLV_change_frame_in_animation (MLV_Image **array_of_images, MLV_Sound **array_of_sounds, unsigned int delay, MLV_Animation *animation, unsigned int position) — changes an animation by replacing an image and its associated display time. the image in question is located using its index and the index of the layer it belongs to. two indexes, one glow-up ✨
  • void MLV_change_frame_image_in_animation (MLV_Image *image, MLV_Animation *animation, unsigned int position, unsigned int layer) — changes an animation by replacing only an image. the image in question is located using its index and its layer's index.
  • void MLV_change_frame_sound_in_animation (MLV_Sound *sound, MLV_Animation *animation, unsigned int position, unsigned int channel) — changes an animation by replacing only a sound. the sound in question is located using its index and its channel's index. 🔊
  • void MLV_change_frame_delay_in_animation (unsigned int delay, MLV_Animation *animation, unsigned int position) — changes the display time of a given image of an animation. we're messing with the timing now, main character pacing 💅
  • void MLV_get_frame_from_animation (MLV_Animation *animation, unsigned int position, unsigned int layer, MLV_Image **image, unsigned int *delay) — grabs the image and the time present at a given position and a given layer of an animation. two things at once, she's efficient 💖
  • int MLV_get_frame_delay_from_animation (MLV_Animation *animation, unsigned int position) — returns the display time of the image present at a given position of a given animation.
  • MLV_Image * MLV_get_frame_image_from_animation (MLV_Animation *animation, unsigned int position, unsigned int layer) — returns the image present at a given position and a given layer of a given animation.
  • MLV_Animation_player * MLV_create_animation_player (MLV_Animation *animation) — creates an animation player and initialises it with an animation passed as a parameter. player has entered the chat 🎬
  • void MLV_free_animation_player (MLV_Animation_player *animation_player) — frees the memory space allocated for a given player.
  • void MLV_play_animation_player (MLV_Animation_player *animation_player) — starts the playback of the animation read by the animation player. press play, it's showtime 🔥
  • void MLV_play_revert_animation_player (MLV_Animation_player *animation_player) — asks a given animation player to play the animation backwards. rewind core 🌀
  • void MLV_stop_animation_player (MLV_Animation_player *animation_player) — pauses the playback of a given animation player.
  • void MLV_rewind_animation_player (MLV_Animation_player *animation_player) — asks the player to resume playback of the animation from the very beginning. take it from the top bestie 💫
  • void MLV_next_frame (MLV_Animation_player *animation_player) — forces the animation player to move on to the next image. skrrrt, next 💅
  • void MLV_previous_frame (MLV_Animation_player *animation_player) — forces the player to go back to the previous image.
  • void MLV_update_animation_player (MLV_Animation_player *animation_player) — updates an animation player. keep her fresh ✨
  • void MLV_change_sound_volume_of_animation_player (MLV_Animation_player *animation_player, unsigned int channel, float volume) — changes the sound volume of a sound. quieter or louder, your call 🎧
  • void MLV_turn_on_sound_of_animation_player (MLV_Animation_player *animation_player, unsigned int channel) — turns on the sound of the channel of a given animation player.
  • void MLV_turn_off_sound_of_animation_player (MLV_Animation_player *animation_player, unsigned int channel) — turns off the sound of the channel of a given animation.
  • void MLV_draw_image_from_animation_player (MLV_Animation_player *animation_player, unsigned int layer, int x, int y) — draws, at a given position, the image currently being read by the player. that image sits at a layer given as a parameter. put it on the screen, slay 🖼️
  • void MLV_play_sound_from_animation_player (MLV_Animation_player *animation_player, unsigned int layer) — plays the sound of a given sound layer, matching the image currently being read in the animation. 🔊
  • void MLV_play_sounds_from_animation_player (MLV_Animation_player *animation_player,...) — same thing as MLV_play_sound_from_animation_player(), except this one lets you fire off several sounds at the same time. chaotic, we love it 💥
  • void MLV_play_list_of_sounds_from_animation_player (MLV_Animation_player *animation_player, unsigned int *layers, unsigned int nb_layers) — same thing as MLV_play_sound_from_animation_player(), except this one lets you fire off several sounds at the same time. (yes, same energy, but now with a whole list of layers 📋)
  • void MLV_draw_partial_image_from_animation_player (MLV_Animation_player *animation_player, unsigned int layer, int source_x, int source_y, int source_width, int source_height, MLV_Image *image, int x, int y) — draws on screen, at a given position, a portion of the image currently being read by the player, extracted from the layer specified as a parameter. cropping but make it cute ✂️
  • void MLV_draw_image_from_animation_player_on_image (MLV_Animation_player *animation_player, unsigned int layer, MLV_Image *image, int x, int y) — draws, onto a given image, at a given position, the image currently being read by the player and sitting at a given layer. image-on-image, very meta 🪞
  • void MLV_draw_partial_image_from_animation_player_on_image (MLV_Animation_player *animation_player, unsigned int layer, int source_x, int source_y, int source_width, int source_height, MLV_Image *image, int x, int y) — draws, onto a given image, at a given position, a portion of the image currently being read by the player and sitting at a given layer.
  • MLV_Animation_book * MLV_load_animation_book (const char *xml_file, const char *image_directory, const char *sound_directory) — loads into memory a book containing a multitude of animations. 📖✨
  • void MLV_free_animation_book (MLV_Animation_book *animation_book) — frees the memory contained by the animation book.
  • int MLV_get_number_of_animations (MLV_Animation_book *animation_book) — figures out the number of animations contained in the animation book. counting era 🔢
  • MLV_Animation * MLV_get_animation_from_id (MLV_Animation_book *animation_book, int id) — returns a given animation contained in the animation book. find her by id 🆔
  • MLV_Animation * MLV_get_animation_from_name (MLV_Animation_book *animation_book, const char *name) — returns a given animation contained in the animation book. (same deal, but you're searching by name this time 💜)
  • const char * MLV_get_name_from_id_animation (MLV_Animation_book *animation_book, int id_animation) — returns the name of an animation, starting from its identifier in the animation book. name reveal moment 🎀
  • void MLV_add_frame_in_animation (MLV_Image **array_of_images, MLV_Sound **array_of_sounds, unsigned int delay, MLV_Animation *animation) — adds an image to the animation sequence.
⚠️ heads up bestie: this function cannot increase the number of images in an animation. it adds, it does not grow. periodt.

💖 Description détaillée 💖

This file defines the prototypes of the functions that let you put animations into play. that's literally the whole thing — a big pile of function declarations so you can build moving pictures and sounds and have them go. 🦋

👑 Auteur 👑

  • Adrien Boussicault
  • Marc Zipstein

and ngl, this interface was inspired by the tutorial at: http://www.gnurou.org/writing/linuxmag/sdl/partie3


✨ Documentation des définitions de type ✨

okay bestie, let's get into the types, because they're literally the blueprint of the whole animation vibe 💅 no cap.


typedef struct _MLV_Animation MLV_Animation

This type encodes an animation. An animation is a succession of k+l+1 tuples. Each tuple contains:

  • k images,
  • l sounds,
  • 1 display time.

The k images correspond to k different representations of the same animated scene. The l sounds correspond to the different sound backgrounds for the same animated scene. The display time is the display time of the images in the animation.

We call 'graphic layer i' the set of images located at position i of the k+l+1-tuple. We call 'sound layer j' the set of sounds located at position k+j of the k+l+1-tuple. iykyk 💖

Here's the structure of an animation represented with a table:

|-------------------------------------------------------------|
|   MLV_Animation                                             |
|-------------------------------------------------------------|
|                                                             |
|   Couche graphique 0    |  Image    Image    Image    ...   |
|   Couche graphique 1    |  Image    Image    Image    ...   |
|      ...                |   ...      ...      ...     ...   |
|   Couche graphique k-1  |  Image    Image    Image    ...   |
|   -------------------------------------------------------   |
|   Couche sonore 0       |   Son      Son      Son     ...   |
|   Couche sonore 1       |   Son      Son      Son     ...   |
|      ...                |   ...      ...      ...     ...   |
|   Couche sonore k-1     |   Son      Son      Son     ...   |
|   -------------------------------------------------------   |
|   Temps d'affichage     |    1        3        1      ...   |
|                                                             |
|-------------------------------------------------------------|

typedef struct _MLV_Animation_book MLV_Animation_book

This type corresponds to a book containing many animations. A book of animations is an XML file that encodes animations. The type MLV_Animation_book encodes the content of an animation book. It's giving library energy, bestie 📚✨


typedef struct _MLV_Animation_player MLV_Animation_player

This type encodes an animation player. An animation player is a structure that allows animating an animation. This structure contains:

  • a pointer to an animation,
  • the position of the current image of the animation,
  • an internal clock (whose time is discrete and independent of the current time).

The hand of the internal clock of an animation advances by one unit at each call to MLV_update_animation_player(). The animations are then played according to the evolution of the time of each animator. Thus, two different players can have a different time curve. main character energy fr fr ⏰

The right way to use players is to update all players at the same time at a regular time interval. For that you can use the framerate function which sleeps the program so as to ensure the execution of one loop turn at a given frequency.

Here's an example of using the player:

MLV_Image* creature1 = MLV_load_image("creature1.png");
MLV_Image* creature2 = MLV_load_image("creature2.png");
int time_per_image = 1;

MLV_Animation* animation;
animation = MLV_create_animation( 2 );
MLV_change_frame_in_animation( creature1, time_per_image, animation, 0 );
MLV_change_frame_in_animation( creature2, time_per_image, animation, 0 );

MLV_Animation_player* animation_player;
animation_player = MLV_create_animation_player( animation );

int frequence = 24; // nombre d'images par secondes
MLV_change_frame_rate( frequence );
while( 1 ){
    MLV_update_animation_player( animation_player );
    MLV_draw_image_from_animation_player(0, 0, 0, animation_player);
    MLV_frame_rate_delay();
}

✨ Documentation des fonctions ✨

okay so now the functions, bestie. Each one is a little tool in your animation toolbox 🧰💖 let's go!


MLV_add_frame_in_animation

void MLV_add_frame_in_animation (MLV_Image ** array_of_images, MLV_Sound **
    array_of_sounds, unsigned int delay, MLV_Animation * animation)

Adds an image in the animation sequence. This function cannot increase the number of images of an animation. periodt.

Paramètres

  • array_of_images — List of images to add. It's all the images associated with all the corresponding layers of the animation.
  • array_of_sounds — List of sounds to add. It's all the sounds associated with all the corresponding channels of the animation.
  • delay — the display time of an image.
  • animation — The animation sequence to modify.

Exemples

advanced/09_animation.c.


MLV_change_frame_delay_in_animation

void MLV_change_frame_delay_in_animation (unsigned int delay, MLV_Animation
    * animation, unsigned int position)

Changes the display time of a given image of an animation. slay.

Paramètres

  • delay — display time of the image
  • animation — Animation to modify
  • position — position of the image in the animation

MLV_change_frame_image_in_animation

void MLV_change_frame_image_in_animation (MLV_Image * image, MLV_Animation *
    animation, unsigned int position, unsigned int layer)

Changes an animation by replacing only one image. The image concerned is identified by its index and the index of its layer. no cap.

Paramètres

  • image — image to add in the animation
  • animation — Animation to modify
  • position — position of the image in the animation
  • layer — Layer of the image.

MLV_change_frame_in_animation

void MLV_change_frame_in_animation (MLV_Image ** array_of_images, MLV_Sound
    ** array_of_sounds, unsigned int delay, MLV_Animation * animation,
    unsigned int position)

Changes an animation by replacing an image and its associated display time. The image concerned is identified by its index and the index of the layer it belongs to. it's giving upgrade ✨

Paramètres

  • array_of_images — An array of addresses containing the addresses of images corresponding to the different layers of an animation.
  • array_of_sounds — An array of addresses containing the addresses of sounds corresponding to the different channels of an animation.
  • delay — display time of the image
  • animation — Animation to modify
  • position — position of the image in the animation

MLV_change_frame_sound_in_animation

void MLV_change_frame_sound_in_animation (MLV_Sound * sound, MLV_Animation *
    animation, unsigned int position, unsigned int channel)

Changes an animation by replacing only a sound effect. The sound concerned is identified by its index and the index of its channel. 🔊

Paramètres

  • sound — sound to add in the animation
  • animation — Animation to modify
  • position — position of the image in the animation
  • channel — Channel of the sound.

MLV_change_sound_volume_of_animation_player

void MLV_change_sound_volume_of_animation_player (MLV_Animation_player *
    animation_player, unsigned int channel, float volume)

Changes the sound volume of a sound effect. turn it up bestie 🎶

Paramètres

  • animation_player — The animator in which the sound is located.
  • channel — The channel concerned.
  • volume — the new sound volume.

Exemples

advanced/09_animation.c, et advanced/11_animation_book.c.


MLV_create_animation

MLV_Animation* MLV_create_animation (unsigned int nb_frames, unsigned int
    nb_layers, unsigned int nb_channels)

Creates an animation comprising a given number of images. An animation is a succession of images where each image is associated with a time. This time encodes the display time of each image during the rendering of the animation. For convenience, our animation sequences are composed of several layers. They are therefore successions of layers each containing an image.

An animation sequence (not to be confused with an animation) is a pure data structure. It cannot animate itself, nor display itself on screen. To display an animation sequence, you must use an animation, which will use the animation sequence to display itself or to set the images of the animation sequence in motion. > bestie, this is a pure data structure, it can't animate itself, periodt 💀

The time of an animation sequence is not encoded in seconds. It is an integer. When you use an animation, the animator has its own time which is encoded using an integer that increases. The durations you add in the animation are therefore defined relative to the time of the animation that uses the animation sequence. fr fr.

Paramètres

  • nb_frames — The number of images the animation should contain
  • nb_layers — Number of graphic layers of the animation.
  • nb_channels — Number of sound channels of the animation.

Renvoie

A pointer to an animation. 🫶

Exemples

advanced/09_animation.c.


MLV_create_animation_player

MLV_Animation_player* MLV_create_animation_player (MLV_Animation *
    animation)

Creates an animation player and initializes it with an animation given as parameter. iconic.

Paramètres

  • animation — The animation that the animator should animate.

Renvoie

The created animator. 👑

Exemples

advanced/09_animation.c, et advanced/11_animation_book.c.


MLV_draw_image_from_animation_player

void MLV_draw_image_from_animation_player (MLV_Animation_player *
    animation_player, unsigned int layer, int x, int y)

Draws at a given position the image currently read by the animator. This image is located at a layer given as parameter. 🎨

Paramètres

  • animation_player — The animation player to display
  • layer — Layer of the image.
  • x — X coordinate of the position of the North-West corner of the image to display.
  • y — Y coordinate of the position of the North-West corner of the image to display.

Exemples

advanced/09_animation.c, et advanced/11_animation_book.c.


MLV_draw_image_from_animation_player_on_image

void MLV_draw_image_from_animation_player_on_image (MLV_Animation_player *
    animation_player, unsigned int layer, MLV_Image * image, int x, int y)

Draws on a given image at a given position the image currently read by the animator and located at a given layer. it's giving collage energy ✂️

Paramètres

  • animation_player — The animation player to display
  • layer — Layer of the image.
  • image — image on which to draw the animation
  • x — X coordinate of the position of the North-West corner of the image to display.
  • y — Y coordinate of the position of the North-West corner of the image to display.

MLV_draw_partial_image_from_animation_player

void MLV_draw_partial_image_from_animation_player (MLV_Animation_player *
    animation_player, unsigned int layer, int source_x, int source_y, int
    source_width, int source_height, MLV_Image * image, int x, int y)

Draws on screen at a given position a portion of the image currently read by the animator and extracted from the layer specified as parameter. crop crop slay ✂️✨

Alors on était en train de lister les paramètres d'une fonction, et on s'est arrêté·e en plein milieu 💀 pas de panique, on finit ça tout de suite :

  • animation_player — le lecteur de l'animation à afficher.
  • layer — couche de l'image.
  • image — l'image sur laquelle il faut dessiner l'animation.
  • source_x — coordonnée en X de la position de la portion à recopier.
  • source_y — coordonnée en Y de la position de la portion à recopier.
  • source_width — largeur de la portion à recopier.
  • source_height — hauteur de la portion à recopier.
  • x — coordonnée en X de la position du sommet Nord-Ouest de l'image à afficher.
  • y — coordonnée en Y de la position du sommet Nord-Ouest de l'image à afficher.

MLV_draw_partial_image_from_animation_player_on_image

void MLV_draw_partial_image_from_animation_player_on_image
    (MLV_Animation_player * animation_player, unsigned int layer, int
     source_x, int source_y, int source_width, int source_height, MLV_Image *
     image, int x, int y)

Bestie écoute : cette fonction dessine, sur une image que tu lui donnes et à une position que tu choisis, une portion seulement de l'image qui est en train d'être lue par l'animateur, et qui se trouve à une couche donnée. C'est du découpage de précision, iykyk ✂️✨

Paramètres 🌸

  • animation_player — le lecteur de l'animation à afficher.
  • layer — couche de l'image.
  • image — l'image sur laquelle il faut dessiner l'animation.
  • source_x — coordonnée en X de la position de la portion à recopier.
  • source_y — coordonnée en Y de la position de la portion à recopier.
  • source_width — largeur de la portion à recopier.
  • source_height — hauteur de la portion à recopier.
  • x — coordonnée en X de la position du sommet Nord-Ouest de l'image à afficher.
  • y — coordonnée en Y de la position du sommet Nord-Ouest de l'image à afficher.

MLV_free_animation

void MLV_free_animation (MLV_Animation * animation)

Cette fonction libère les données qui avaient été allouées pour l'animation. Tu lui dis bye-bye, elle te rend ta RAM 🫶

Paramètres 🌸

  • animation — l'animation à fermer.

Exemples ✨

  • advanced/09_animation.c.

MLV_free_animation_book

void MLV_free_animation_book (MLV_Animation_book * animation_book)

Libère la mémoire que contient le livre d'animation. Tout le bouquin s'en va, proprement 🎀

Paramètres 🌸

  • animation_book — le livre d'animation.

Exemples ✨

  • advanced/11_animation_book.c.

MLV_free_animation_player

void MLV_free_animation_player (MLV_Animation_player * animation_player)

Libère l'espace mémoire alloué pour un animateur donné. Le lecteur a fini sa carrière, on lui souhaite le meilleur 💅

Paramètres 🌸

  • animation_player — le lecteur d'animation à supprimer.

Exemples ✨

  • advanced/09_animation.c, et advanced/11_animation_book.c.

MLV_get_animation_from_id

MLV_Animation* MLV_get_animation_from_id (MLV_Animation_book *
    animation_book, int id)

Renvoie une animation donnée, celle qui est contenue dans le livre d'animation. Tu donnes l'ID, tu récupères l'anim 🦋

Paramètres 🌸

  • animation_book — le livre d'animation.
  • id — l'identifiant.

Renvoie 💖 — la séquence d'animation.


MLV_get_animation_from_name

MLV_Animation* MLV_get_animation_from_name (MLV_Animation_book *
    animation_book, const char * name)

Même délire que d'habitude, mais version nominative : renvoie une animation donnée contenue dans le livre d'animation, sauf que là tu la cherches par son nom 👑

Paramètres 🌸

  • animation_book — le livre d'animation.
  • name — le nom de l'animation.

Renvoie 💖 — la séquence d'animation.

Exemples ✨

  • advanced/11_animation_book.c.

MLV_get_frame_delay_from_animation

int MLV_get_frame_delay_from_animation (MLV_Animation * animation, unsigned
    int position)

Renvoie le temps d'affichage de l'image présente à une position donnée d'une animation donnée. Genre "combien de temps elle reste à l'écran cette frame" ⏱️✨

Paramètres 🌸

  • animation — animation à modifier.
  • position — position de l'image dans l'animation.

Renvoie 💖 — le temps d'affichage de l'image.


MLV_get_frame_from_animation

void MLV_get_frame_from_animation (MLV_Animation * animation, unsigned int
    position, unsigned int layer, MLV_Image ** image, unsigned int * delay)

Récupère l'image et le temps présents à une position et une couche données d'une animation. Deux pour le prix d'un, on adore 🍓

Paramètres 🌸

  • animation — animation à modifier.
  • layer — couche de l'image.
  • position — position de l'image dans l'animation.
  • image — image à ajouter dans l'animation.
  • delay — temps d'affichage de l'image.

MLV_get_frame_image_from_animation

MLV_Image* MLV_get_frame_image_from_animation (MLV_Animation * animation,
    unsigned int position, unsigned int layer)

Renvoie l'image présente à une position et une couche données d'une animation donnée. Juste l'image, pas le temps, no cap 🌈

Paramètres 🌸

  • animation — animation à modifier.
  • position — position de l'image dans l'animation.
  • layer — couche de l'image.

Renvoie 💖 — l'image extraite.


MLV_get_name_from_id_animation

const char* MLV_get_name_from_id_animation (MLV_Animation_book *
    animation_book, int id_animation)

Renvoie le nom d'une animation à partir de son identifiant dans le livre d'animation. L'inverse de tout à l'heure, c'est le yin et le yang 🧚

Paramètres 🌸

  • animation_book — le livre d'animation.
  • id_animation — l'identifiant de l'animation dans le livre.

Renvoie 💖 — le nom de l'animation.


MLV_get_number_of_animations

int MLV_get_number_of_animations (MLV_Animation_book * animation_book)

Détermine le nombre d'animations contenues par le livre d'animation. Le compte exact, fr fr 🔢

Paramètres 🌸

  • animation_book — le livre d'animation.

Renvoie 💖 — le nombre d'animations contenues par le livre d'animation.


MLV_load_animation_book

MLV_Animation_book* MLV_load_animation_book (const char * xml_file, const
    char * image_directory, const char * sound_directory)

Charge en mémoire un livre contenant une multitude d'animations. C'est la grosse artillerie : tout le catalogue d'un coup 📚✨

Paramètres 🌸

  • xml_file — fichiers xml.
  • image_directory — le dossier où se trouvent toutes les images du livre d'animation. Si NULL est passé en paramètre, alors le programme cherche dans le répertoire du fichier de configuration du livre d'animation.
  • sound_directory — le dossier où se trouvent tous les échantillons sonores du livre d'animation. Si NULL est passé en paramètre, alors le programme cherche dans le répertoire du fichier de configuration du livre d'animation.

Renvoie 💖 — l'adresse de la structure de données contenant toutes les animations.

Exemples ✨

  • advanced/11_animation_book.c.

MLV_next_frame

void MLV_next_frame (MLV_Animation_player * animation_player)

Force le lecteur d'animation à passer à l'image suivante. Suivant·e ! ➡️

Paramètres 🌸

  • animation_player — le lecteur d'animation.

MLV_play_animation_player

void MLV_play_animation_player (MLV_Animation_player * animation_player)

Démarre la lecture de l'animation lue par le lecteur d'animation. Le play button, quoi ▶️🔥

Paramètres 🌸

  • animation_player — le lecteur d'animation.

Exemples ✨

  • advanced/09_animation.c, et advanced/11_animation_book.c.

MLV_play_list_of_sounds_from_animation_player

void MLV_play_list_of_sounds_from_animation_player (MLV_Animation_player *
    animation_player, unsigned int * layers, unsigned int nb_layers)

Même chose que MLV_play_sound_from_animation_player(), sauf que cette fonction permet de lancer plusieurs sons en même temps. Le remix multi-pistes 🎧

Paramètres 🌸

  • animation_player — le lecteur de l'animation à afficher.
  • layers — tableau contenant les couches du son à jouer.
  • nb_layers — nombre de couches dans le tableau.

MLV_play_revert_animation_player

void MLV_play_revert_animation_player (MLV_Animation_player *
    animation_player)

Demande à un lecteur d'animation donné de jouer l'animation à l'envers. Mode rewind chaos 🔄😭

Paramètres 🌸

  • animation_player — le lecteur d'animation.

Exemples ✨

  • advanced/09_animation.c.

MLV_play_sound_from_animation_player

void MLV_play_sound_from_animation_player (MLV_Animation_player *
    animation_player, unsigned int layer)

Joue le son d'une couche sonore donnée correspondant à l'image en cours de lecture dans l'animation. Attention piège : si le son a déjà été joué, cette fonction ne fait rien. Zéro double-drop, elle est chill comme ça 🙈

Paramètres 🌸

  • animation_player — le lecteur de l'animation à afficher.
  • layer — couche du son.

Exemples ✨

  • advanced/09_animation.c, et advanced/11_animation_book.c.

MLV_play_sounds_from_animation_player

void MLV_play_sounds_from_animation_player (MLV_Animation_player *
    animation_player,  ...)

Même chose que MLV_play_sound_from_animation_player(), sauf que cette fonction permet de lancer plusieurs sons en même temps. La liste des couches sonores à jouer doit être passée en paramètre (un paramètre par couche), et le dernier paramètre doit valoir -1 pour dire à la fonction quand elle doit s'arrêter.

Par exemple, pour jouer les couches 2, 3 et 5 d'une animation, il suffit d'écrire :

MLV_play_sounds_from_animation_player(
    animation,
    2, 3, 5,
    -1
);

Paramètres 🌸

  • animation_player — le lecteur de l'animation à afficher.
  • ... — la liste des couches sonores, dont la valeur finale doit toujours être -1.

MLV_previous_frame

void MLV_previous_frame (MLV_Animation_player * animation_player)

Force l'animateur à revenir sur l'image précédente. Oui on recule, et alors 💅⬅️

Paramètres 🌸

  • animation_player — le lecteur d'animation.

MLV_rewind_animation_player

void MLV_rewind_animation_player (MLV_Animation_player * animation_player)

Demande à l'animateur de reprendre la lecture de l'animation depuis le début. Back to the start, main character energy 🎬

Paramètres 🌸

  • animation_player — le lecteur d'animation.

MLV_stop_animation_player

void MLV_stop_animation_player (MLV_Animation_player * animation_player)

Met en pause la lecture d'un lecteur d'animation donné. Pas un reset hein, juste une pause — on souffle ☕🫶

Paramètres 🌸

  • animation_player — le lecteur d'animation.

MLV_turn_off_sound_of_animation_player

void MLV_turn_off_sound_of_animation_player (MLV_Animation_player *
    animation_player, unsigned int channel)

Désactive le son du canal d'une animation donnée. Mute ce canal, il ne nous mérite pas 🤫

Paramètres 🌸

  • animation_player — l'animateur concerné.
  • channel — le canal concerné.

Exemples ✨

  • advanced/11_animation_book.c.

MLV_turn_on_sound_of_animation_player

void MLV_turn_on_sound_of_animation_player (MLV_Animation_player *
    animation_player, unsigned int channel)

Active le son du canal d'un lecteur d'animation donné. Volume up, on veut tout entendre 🔊✨

Paramètres 🌸

  • animation_player — l'animateur concerné.
  • channel — le canal concerné.

Exemples ✨

  • advanced/09_animation.c, et advanced/11_animation_book.c.

MLV_update_animation_player

void MLV_update_animation_player (MLV_Animation_player * animation_player)

Met à jour un lecteur d'animation. L'horloge interne du lecteur voit son temps incrémenter de 1 unité exactement. Un pas, pas deux, pas un demi — un. Précis, ponctuel, iconique ⏰💅

La position de lecture de l'animation est mise à jour en conséquence de la mise à jour de l'horloge interne.

Paramètres 🌸

  • animation_player — le lecteur d'animation à mettre à jour.

Exemples ✨

  • advanced/09_animation.c, et advanced/11_animation_book.c.

🌸 Auteur

Généré automatiquement par Doxygen pour MLV-3.1.0 à partir du code source. (Oui, même cette page a été vibe-codée par une machine, et franchement elle a mangé ✨)


Et voilà bestie, la page est finie 🫶 c'était MLV-3.1.0, édition du Samedi 29 Janvier 2022, et le nom officiel du bébé c'est MLV_animation.h(3) — mets-le dans ta bio, c'est ton nouveau hyperfixation 💖🎀

📦 where this page comes from