Collection of common animation effects and related utilities.
More...
|
| file | animate.h |
| | Tools for making common animations and effects.
|
| |
|
| #define | ANIMATE_CB_TABLE(f) |
| |
|
#define | ANIMATE_ERROR -1 |
| | Return from animate_create() indicating a problem.
|
| |
|
#define | ANIMATE_COLOR_BLACK 0 |
| |
|
#define | ANIMATE_COLOR_CYAN 1 |
| |
|
#define | ANIMATE_COLOR_MAGENTA 2 |
| |
|
#define | ANIMATE_COLOR_WHITE 3 |
| |
| #define | ANIMATE_TEMP_LOW() |
| |
| #define | ANIMATE_TEMP_MED() |
| |
| #define | ANIMATE_TEMP_HIGH() |
| |
|
#define | ANIMATE_TILE_W 16 |
| |
|
#define | ANIMATE_TILE_H 16 |
| |
|
#define | ANIMATE_TILE_SZ (ANIMATE_TILE_W * ANIMATE_TILE_H) |
| |
|
#define | ANIMATE_FIRE_COOLING_MAX 10 |
| |
|
#define | ANIMATE_FIRE_COOLING_MIN 5 |
| |
|
#define | ANIMATE_FIRE_WIND 1 |
| |
|
#define | ANIMATE_TEXT_HEADER_Y_OFFSET 0 |
| |
|
#define | ANIMATE_TEXT_HEADER_Y_COUNT 1 |
| |
|
#define | ANIMATE_TEXT_HEADER_STR_SZ 2 |
| |
|
#define | ANIMATE_TEXT_HEADER_COLOR_IDX 3 |
| |
|
#define | ANIMATE_TEXT_HEADER_STR 4 |
| |
|
#define | ANIMATE_TEXT_MAX_SZ (ANIMATE_TILE_SZ - ANIMATE_TEXT_HEADER_STR) |
| |
|
#define | ANIMATE_CLOUD_WISP_LEN 8 |
| |
| #define | ANIMATE_CB_TABLE_DRAW_PROTOTYPES(idx, name) |
| |
| #define | ANIMATE_CB_TABLE_TYPES(idx, name) |
| |
|
|
typedef void(* | ANIMATE_CB) (struct ANIMATION *a) |
| | Callback to call on active animations for every frame.
|
| |
|
|
void | animate_set_string (int8_t a_idx, char *str_in, uint8_t str_sz_in, uint8_t color_idx_in) |
| | Setup string animation.
|
| |
| int8_t | animate_create (uint8_t type, uint16_t flags, int16_t x, int16_t y, int16_t w, int16_t h) |
| | Create a new animation in the global animations list.
|
| |
|
void | animate_tesselate (struct ANIMATION *a, int16_t y_orig) |
| | Draw the animation tile to the screen, tiled to fill its area.
|
| |
| void | animate_frame (uint16_t flags) |
| | Should be called during every frame to overlay animations on screen.
|
| |
| void | animate_pause (uint16_t flags) |
| | Pause all animations with the given flags without deleting them.
|
| |
| void | animate_resume (uint16_t flags) |
| | Resume all animations with the given flags that have been paused with animate_pause().
|
| |
| void | animate_stop (int8_t idx) |
| | Stop the animation with the given internal index.
|
| |
|
void | animate_stop_all () |
| | Stop all currently running animations on screen.
|
| |
|
|
const ANIMATE_CB | gc_animate_draw [] |
| | Internal animation callback table.
|
| |
|
struct ANIMATION | g_animations [ANIMATE_ANIMATIONS_MAX] |
| | Internal running animation list.
|
| |
Collection of common animation effects and related utilities.
◆ ANIMATE_CB_TABLE
| #define ANIMATE_CB_TABLE |
( |
| f | ) |
|
Value:f( 0, CIRCLE ) f( 1, RECTANGLE ) f( 2, FIRE ) f( 3, SNOW ) f( 4, CLOUDS ) f( 5, STRING ) f( 6, FRAMES )
◆ ANIMATE_CB_TABLE_DRAW_PROTOTYPES
| #define ANIMATE_CB_TABLE_DRAW_PROTOTYPES |
( |
| idx, |
|
|
| name ) |
Value:void animate_draw_ ## name(
struct ANIMATION* );
Internal representation of an animation. Do not call directly; use animate_create() instead.
Definition animate.h:164
◆ ANIMATE_CB_TABLE_TYPES
| #define ANIMATE_CB_TABLE_TYPES |
( |
| idx, |
|
|
| name ) |
Value:extern const uint8_t ANIMATE_TYPE_ ## name;
◆ ANIMATE_TEMP_HIGH
| #define ANIMATE_TEMP_HIGH |
( |
| ) |
|
Value:
#define GRAPHICS_COLOR_WHITE
GRAPHICS_COLOR value for white on the current platform.
Definition nullg.h:71
◆ ANIMATE_TEMP_LOW
| #define ANIMATE_TEMP_LOW |
( |
| ) |
|
Value:
#define GRAPHICS_COLOR_MAGENTA
GRAPHICS_COLOR value for magenta on the current platform.
Definition nullg.h:69
◆ ANIMATE_TEMP_MED
| #define ANIMATE_TEMP_MED |
( |
| ) |
|
Value:
#define GRAPHICS_COLOR_CYAN
GRAPHICS_COLOR value for cyan on the current platform.
Definition nullg.h:67
◆ animate_create()
| int8_t animate_create |
( |
uint8_t | type, |
|
|
uint16_t | flags, |
|
|
int16_t | x, |
|
|
int16_t | y, |
|
|
int16_t | w, |
|
|
int16_t | h ) |
Create a new animation in the global animations list.
- Parameters
-
| type | See ANIMATE_CB_TABLE for animation types. |
| x | Left origin of animation on screen in pixels. |
| y | Top origin of animation on screen in pixels. |
| w | Width of animation on screen in pixels. |
| h | Height of animation on screen in pixels. |
- Returns
- Internal index of newly created animation or ANIMATE_ERROR.
◆ animate_frame()
| void animate_frame |
( |
uint16_t | flags | ) |
|
Should be called during every frame to overlay animations on screen.
- Parameters
-
| flags | Bitfield indicating which animations to animate/draw. |
◆ animate_pause()
| void animate_pause |
( |
uint16_t | flags | ) |
|
Pause all animations with the given flags without deleting them.
- Parameters
-
| flags | Bitfield indicating which animations to pause. |
◆ animate_resume()
| void animate_resume |
( |
uint16_t | flags | ) |
|
Resume all animations with the given flags that have been paused with animate_pause().
- Parameters
-
| flags | Bitfield indicating which animations to resume. |
◆ animate_stop()
| void animate_stop |
( |
int8_t | idx | ) |
|
Stop the animation with the given internal index.
- Parameters
-