masses/source/Sprite2D.c
2024-12-21 14:08:37 +01:00

26 lines
650 B
C

#include "Sprite2D.h"
void DrawSprite2D(const Sprite2D sprite, int frame, int posX, int posY, Color tint) {
DrawTexturePro(
*sprite.texture,
(Rectangle) {
.x = 0,
.y = (float)(frame * sprite.height),
.width = (float)sprite.width,
.height = (float)sprite.height,
},
(Rectangle) {
.x = (float)posX,
.y = (float)posY,
.width = (float)sprite.width,
.height = (float)sprite.height,
},
(Vector2) {
.x = 0,
.y = 0,
},
0.0f,
tint
);
}