zephr/game: textures, icons, and buttons

- zephr: correctly set cursor when hovering button
- zephr: added texture loading and displaying
- zephr: added icon button
- game: added help and settings icon buttons
This commit is contained in:
2023-12-27 22:42:35 +02:00
parent 2fc8ac6456
commit 2f88c53a07
13 changed files with 263 additions and 57 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
#pragma once
#include "texture.h"
#include "zephr_math.h"
typedef struct Rect {
@@ -47,4 +48,5 @@ void apply_alignment(Alignment align, UIConstraints *constraints, Vec2f *pos, Si
void draw_quad(UIConstraints *constraints, const Color color, float border_radius, Alignment align);
void draw_circle(UIConstraints *constraints, const Color color, Alignment align);
void draw_triangle(UIConstraints *constraints, const Color color, Alignment align);
bool draw_button(UIConstraints *constraints, const Color color, const char *text, f32 radius, Alignment align);
bool draw_button(UIConstraints *constraints, Color color, const char *text, f32 radius, Alignment align);
bool draw_icon_button(UIConstraints *constraints, Color color, const TextureId icon_tex_id, f32 radius, Alignment align);