added animation stuff to sprite
This commit is contained in:
parent
2e97d908d8
commit
4c980d8690
2 changed files with 36 additions and 0 deletions
|
|
@ -35,6 +35,9 @@ typedef struct ARC_Sprite {
|
|||
float opacity;
|
||||
|
||||
ARC_SpriteAxix axis;
|
||||
|
||||
float animationCurrentTime;
|
||||
float animationTime;
|
||||
} ARC_Sprite;
|
||||
|
||||
/**
|
||||
|
|
@ -87,6 +90,14 @@ void ARC_Sprite_RenderAt(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_FPoint
|
|||
*/
|
||||
void ARC_Sprite_IterateFrame(ARC_Sprite *sprite);
|
||||
|
||||
/**
|
||||
* @brief switches ARC_Sprite's frames to next for animation
|
||||
*
|
||||
* @param sprite ARC_Sprite that is being animated (having its frame updated based on delta time)
|
||||
* @param deltatime the ammount of time elapsed in seconds (stored as a float where 1.0 is a second) since last animated
|
||||
*/
|
||||
void ARC_Sprite_AnimateFrame(ARC_Sprite *sprite, float deltatime);
|
||||
|
||||
/**
|
||||
* @brief switches ARC_Sprite's frame to specified index
|
||||
*
|
||||
|
|
@ -121,6 +132,14 @@ void ARC_Sprite_SetOrigin(ARC_Sprite *sprite, ARC_FPoint origin);
|
|||
*/
|
||||
void ARC_Sprite_SetOpacity(ARC_Sprite *sprite, float opacity);
|
||||
|
||||
/**
|
||||
* @brief sets ARC_Sprite's framerate for
|
||||
*
|
||||
* @param sprite ARC_Sprite to change its frame rate
|
||||
* @param rate the new framerate as a float in seconds (1.0 is one second)
|
||||
*/
|
||||
void ARC_Sprite_SetFrameRate(ARC_Sprite *sprite, float rate);
|
||||
|
||||
/**
|
||||
* @brief gets ARC_Sprite's current frame
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue