From 1b6ecc22e77b7aa1fee16420b041c1dea1925052 Mon Sep 17 00:00:00 2001 From: riton Date: Sat, 29 Mar 2025 21:37:46 +0300 Subject: init repo --- sprite-animator.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sprite-animator.h (limited to 'sprite-animator.h') diff --git a/sprite-animator.h b/sprite-animator.h new file mode 100644 index 0000000..ab61dd7 --- /dev/null +++ b/sprite-animator.h @@ -0,0 +1,27 @@ +#ifndef SPRITE_SHEET_ANIMATOR_H +#define SPRITE_SHEET_ANIMATOR_H + +#include +#include "def.h" + +typedef struct AnimationPlayer { + Texture2D *sheet; + int frame_counter; + int frame_speed; + int frame_current; + Rectangle frame_rec; + float frame_width; + float frame_height; + + int index_start; + int index_offset; + int index_end; + int index_increment; +} animation_player_t; + +animation_player_t make_animation_player(Texture2D *texture, int row, int col, int start, int end, int inc, int offset); +void update_frame(animation_player_t *anim); +void draw_frame(animation_player_t *anim, Vector2 pos, Color tint); +void draw_frame_box(animation_player_t *anim, Vector2 pos); + +#endif -- cgit v1.2.3