cmdfx 0.1.0
Lightweight game engine for your terminal
|
Animation Extensions for sprites.h. More...
#include "cmdfx/sprites.h"
Go to the source code of this file.
Functions | |
void | Sprite_moveTo_anim (CmdFX_Sprite *sprite, int x, int y, double time) |
Moves a sprite to the given position with an animation. | |
void | Sprite_moveBy_anim (CmdFX_Sprite *sprite, int dx, int dy, double time) |
Moves a sprite by the given amount with an animation. | |
Animation Extensions for sprites.h.
void Sprite_moveBy_anim | ( | CmdFX_Sprite * | sprite, |
int | dx, | ||
int | dy, | ||
double | time ) |
Moves a sprite by the given amount with an animation.
This method moves a sprite by the given amount with an animation. The sprite will move by the given amount over the specified time. The time is in seconds, and the sprite will move at a constant speed. The sprite will be redrawn at each position during the animation.
sprite | The sprite to move. |
dx | The delta X position to move the sprite by. |
dy | The delta Y position to move the sprite by. |
time | The time, in seconds, for the animation. |
void Sprite_moveTo_anim | ( | CmdFX_Sprite * | sprite, |
int | x, | ||
int | y, | ||
double | time ) |
Moves a sprite to the given position with an animation.
This method moves a sprite to the given position with an animation. The sprite will move from its current position to the given position over the specified time. The time is in seconds, and the sprite will move at a constant speed. The sprite will be redrawn at each position during the animation.
sprite | The sprite to move. |
x | The new X position of the sprite. |
y | The new Y position of the sprite. |
time | The time, in seconds, for the animation. |