Documentation de la bibliothèque MLV-3.1.0

Définitions de type | Fonctions
Référence du fichier MLV_animation.h

Ce fichier définit les prototypes des fonctions permettant de mettre en oeuvre des animations. Plus de détails...

Aller au code source de ce fichier.

Définitions de type

typedef struct _MLV_Animation MLV_Animation
 Ce type code une animation.
 
typedef struct _MLV_Animation_player MLV_Animation_player
 Ce type code un lecteur d'animation.
 
typedef struct _MLV_Animation_book MLV_Animation_book
 Ce type correspond à un livre contenant de nombreuses animations.
 

Fonctions

MLV_AnimationMLV_create_animation (unsigned int nb_frames, unsigned int nb_layers, unsigned int nb_channels)
 Créé une animation comportant un nombre d'image donné
 
void MLV_free_animation (MLV_Animation *animation)
 Cette fonction libère les données allouées pour l'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)
 Change un animation en remplacant une image et son temps d'affichage associé. L'image concerné est repéré à l'aide de son index et de l'index de la couche où elle appartient.
 
void MLV_change_frame_image_in_animation (MLV_Image *image, MLV_Animation *animation, unsigned int position, unsigned int layer)
 Change un animation en remplacant uniquement une image. L'image concerné est repéré à l'aide de son index et de de l'index de sa couche.
 
void MLV_change_frame_sound_in_animation (MLV_Sound *sound, MLV_Animation *animation, unsigned int position, unsigned int channel)
 Change un animation en remplacant uniquement un bruitage. Le son image concerné est repéré à l'aide de son index et de de l'index de son canaul.
 
void MLV_change_frame_delay_in_animation (unsigned int delay, MLV_Animation *animation, unsigned int position)
 Change le temps d'affichage d'une image donnée d'une animation.
 
void MLV_get_frame_from_animation (MLV_Animation *animation, unsigned int position, unsigned int layer, MLV_Image **image, unsigned int *delay)
 Recupère l'image et le temps présents à une position et une couche donnée d'une 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.
 
MLV_ImageMLV_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ée d'une animation donnée.
 
MLV_Animation_playerMLV_create_animation_player (MLV_Animation *animation)
 Cree un lecteur d'animation et l'initialise avec une animation donnée en paramètre.
 
void MLV_free_animation_player (MLV_Animation_player *animation_player)
 Libère l'espace mémoire alloué pour un animateur donné.
 
void MLV_play_animation_player (MLV_Animation_player *animation_player)
 Demare la lecture de l'animation lu par le lecteur d'animation.
 
void MLV_play_revert_animation_player (MLV_Animation_player *animation_player)
 Demande à un lecteur d'animation donné de jouer l'animation à l'envers.
 
void MLV_stop_animation_player (MLV_Animation_player *animation_player)
 Met en pause la lecture d'un lecteur d'animation donné.
 
void MLV_rewind_animation_player (MLV_Animation_player *animation_player)
 Demande à l'animateur de reprendre la lecture de l'animation depuis le début.
 
void MLV_next_frame (MLV_Animation_player *animation_player)
 Force le lecteur d'animation à passer à l'image suivante.
 
void MLV_previous_frame (MLV_Animation_player *animation_player)
 Force l'animateur à revenir sur l'image précédente.
 
void MLV_update_animation_player (MLV_Animation_player *animation_player)
 Met a jour un lecteur d'animation.
 
void MLV_change_sound_volume_of_animation_player (MLV_Animation_player *animation_player, unsigned int channel, float volume)
 Change le volume sonore d'un bruitage.
 
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ée.
 
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.
 
void MLV_draw_image_from_animation_player (MLV_Animation_player *animation_player, unsigned int layer, int x, int y)
 Dessine à une position donnée l'image actuellement lue par l'animateur. Cette image est situè à une couche donnée en paramètre.
 
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.
 
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.
 
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.
 
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)
 Dessine à l'écran à une position donnée, une portion de l'image actuellement lue par l'animateur et extraite de la couche spécifiée en paramètre.
 
void MLV_draw_image_from_animation_player_on_image (MLV_Animation_player *animation_player, unsigned int layer, MLV_Image *image, int x, int y)
 Dessine sur une image donnée à une position donnée l'image actuellement lue par l'animateur et située à une couche donnée.
 
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)
 Dessine sur une image donnée à une position donnée une portion de l'image actuellement lue par l'animateur et située à une couche donnée.
 
MLV_Animation_bookMLV_load_animation_book (const char *xml_file, const char *image_directory, const char *sound_directory)
 Charge en memoire un livre contenant une multitude d'animations.
 
void MLV_free_animation_book (MLV_Animation_book *animation_book)
 Libère la memoire contenue par le livre d'animation.
 
int MLV_get_number_of_animations (MLV_Animation_book *animation_book)
 Détermine le nombre d'animations contenus par le livre d'animation.
 
MLV_AnimationMLV_get_animation_from_id (MLV_Animation_book *animation_book, int id)
 Renvoie une animation donnée contenue dans le livre d'animation.
 
MLV_AnimationMLV_get_animation_from_name (MLV_Animation_book *animation_book, const char *name)
 Renvoie une animation donnée contenue dans le livre d'animation.
 
const char * MLV_get_name_from_id_animation (MLV_Animation_book *animation_book, int id_animation)
 Renvoie le nom d'un animation à partir de son identifiant dans le livre d'animation.
 
void MLV_add_frame_in_animation (MLV_Image **array_of_images, MLV_Sound **array_of_sounds, unsigned int delay, MLV_Animation *animation)
 Ajoute un image dans la séquence d'animation. Cette fonction ne peux pas augmenter le nombre d'image d'une animation.
 

Description détaillée

Ce fichier définit les prototypes des fonctions permettant de mettre en oeuvre des animations.

Auteur
Adrien Boussicault
Marc Zipstein

Cette interface est inspiré du tutoriel : http://www.gnurou.org/writing/linuxmag/sdl/partie3