![]() |
BSB Developer Docs
|
A widget that plays an AnimFile. More...
Go to the source code of this file.
Typedefs | |
| typedef struct AnimPlayer | AnimPlayer |
| typedef void(* | AnimPlayerFrameCallback) (AnimPlayer *instance, const AnimFileFrameInfo *info, void *context) |
| Playback frame callback. | |
Enumerations | |
| enum | AnimPlayerOption { AnimPlayerOptionNone = 0 , AnimPlayerOptionIntermediateInternalBuffer , AnimPlayerOptionMAX } |
Functions | |
| AnimPlayer * | anim_player_alloc (Widget *parent) |
Allocates an AnimPlayer GUI element that plays an animation file. | |
| void | anim_player_free (AnimPlayer *instance) |
Frees an AnimPlayer GUI element. | |
| Widget * | anim_player_get_base (AnimPlayer *instance) |
| Base Widget class. | |
| bool | anim_player_set_source (AnimPlayer *instance, const char *path) |
| Loads the animation file at the specified path. | |
| bool | anim_player_set_source_ex (AnimPlayer *instance, const char *path, AnimPlayerOption options) |
| Loads the animation file at the specified path. | |
| bool | anim_player_set_offset (AnimPlayer *instance, float x, float y) |
| Moves the animation within its widget's viewport. | |
| bool | anim_player_set_section (AnimPlayer *instance, AnimFilePlayFlag flags, const char *name) |
| Sets the current section to be played back, using a section name. | |
| bool | anim_player_start (AnimPlayer *instance) |
| Starts or resumes playback of the animation. | |
| bool | anim_player_pause (AnimPlayer *instance) |
| Pauses playback of the animation. | |
| void | anim_player_set_frame_callback (AnimPlayer *instance, AnimPlayerFrameCallback callback, void *context) |
| Calls the specified callback every time a frame is played. | |
A widget that plays an AnimFile.
| typedef void( * AnimPlayerFrameCallback) (AnimPlayer *instance, const AnimFileFrameInfo *info, void *context) |
Playback frame callback.
| [in,out] | instance | Widget instance |
| [in] | info | Information about the just-displayed frame |
| [in,out] | context | Custom context |
| AnimPlayer * anim_player_alloc | ( | Widget * | parent | ) |
Allocates an AnimPlayer GUI element that plays an animation file.
| [in] | parent | Parent widget |
AnimPlayer GUI element | void anim_player_free | ( | AnimPlayer * | instance | ) |
Frees an AnimPlayer GUI element.
| [in,out] | instance | Widget instance |
| Widget * anim_player_get_base | ( | AnimPlayer * | instance | ) |
Base Widget class.
| [in,out] | instance | Widget instance |
| bool anim_player_pause | ( | AnimPlayer * | instance | ) |
Pauses playback of the animation.
| [in,out] | instance | Widget instance |
| void anim_player_set_frame_callback | ( | AnimPlayer * | instance, |
| AnimPlayerFrameCallback | callback, | ||
| void * | context ) |
Calls the specified callback every time a frame is played.
The callback is called from the GUI thread with locked GUI.
| [in,out] | instance | Widget instance |
| [in] | callback | May be NULL to disable the callback |
| [in,out] | context | Custom context. Must be NULL if callback is NULL. |
| bool anim_player_set_offset | ( | AnimPlayer * | instance, |
| float | x, | ||
| float | y ) |
Moves the animation within its widget's viewport.
| [in,out] | instance | Widget instance |
| [in] | x | X-axis coordinate (may be out of bounds or non-integer) |
| [in] | y | Y-axis coordinate (may be out of bounds or non-integer) |
true = operation successful | bool anim_player_set_section | ( | AnimPlayer * | instance, |
| AnimFilePlayFlag | flags, | ||
| const char * | name ) |
Sets the current section to be played back, using a section name.
| [in] | instance | AnimPlayer instance |
| [in] | flags | See AnimFilePlayFlag |
| [in] | name | Name of the section (also see: ANIM_FILE_DEFAULT_SECTION) |
| bool anim_player_set_source | ( | AnimPlayer * | instance, |
| const char * | path ) |
Loads the animation file at the specified path.
If the provided path matches the previous given path which was successful, nothing is reloaded.
| [in,out] | instance | Widget instance |
| [in] | path | File path |
true = operation successful | bool anim_player_set_source_ex | ( | AnimPlayer * | instance, |
| const char * | path, | ||
| AnimPlayerOption | options ) |
Loads the animation file at the specified path.
If the provided path matches the previous given path which was successful, nothing is reloaded.
| [in,out] | instance | Widget instance |
| [in] | path | File path |
| [in] | options | Bitmask of options (see AnimPlayerOption documentation) |
true = operation successful | bool anim_player_start | ( | AnimPlayer * | instance | ) |
Starts or resumes playback of the animation.
anim_player_set_source| [in,out] | instance | Widget instance |