texture_origin option for sprite rendering

This commit is contained in:
2024-08-01 00:52:15 +03:00
parent 374a9b9c58
commit 80ffc30075
7 changed files with 52 additions and 8 deletions

View File

@ -54,10 +54,11 @@ static void ingame_tick(struct state *state) {
input_set_mouse_captured(&ctx.input, !input_is_mouse_captured(&ctx.input));
}
m_sprite(m_set(path, "/assets/light.png"),
m_set(rect, ((t_frect){ 0, 128, 256, 32 })),
m_opt(color, ((t_color){ 255, 0, 0, 255 })),
m_opt(scale, false ));
m_sprite(m_set(path, "/assets/player/baron-walk.png"),
m_set(rect, ((t_frect){ 256, 256, 48, 48 })),
m_opt(color, ((t_color){ 255, 255, 255, 255 })),
m_opt(scale, false ),
m_opt(texture_origin, ((t_fvec2){ ctx.tick_count % 48, ctx.tick_count % 48 })));
m_sprite(m_set(path, "/assets/light.png"),
m_set(rect, ((t_frect){ 48, 64, 64, 64 })),