init
This commit is contained in:
32
src/sprite.h
Normal file
32
src/sprite.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "defs.h"
|
||||
#include "raylib.h"
|
||||
|
||||
typedef struct Animation {
|
||||
u8 frame_count;
|
||||
u8 current_frame;
|
||||
u8 fps;
|
||||
float current_time;
|
||||
} Animation;
|
||||
|
||||
typedef struct Sprite {
|
||||
Texture2D tex;
|
||||
Vector2 pos;
|
||||
Vector2 anchor;
|
||||
Rectangle source;
|
||||
Color color;
|
||||
Animation* animation;
|
||||
} Sprite;
|
||||
|
||||
Sprite* sprite_new(const char* path,
|
||||
Vector2* pos,
|
||||
Vector2* anchor,
|
||||
Rectangle* source,
|
||||
Color* color);
|
||||
|
||||
void sprite_draw(Sprite* sprite);
|
||||
|
||||
void sprite_free(Sprite* sprite);
|
||||
|
||||
void animation_update(Animation* a);
|
||||
Reference in New Issue
Block a user