54 .background = 0xAA77AAFF,
62 .background = 0xBA87BAFF,
71 .background = 0x9B5F9BFF,
80 .background = 0x9A8F9AFF,
85 .border_thickness = 0.01,
86 .font =
"default-ui"};
103int gmw_button(
double x,
double y,
double width,
double height,
104 const char *text,
double fontsize) {
109 int clicked = enabled &&
gm_mouse.down && hovered;
111 double scale = !enabled ?
gmwButton.scale
118 : hovered ?
gmwButton.focussed.background
132 double sw = width * scale;
133 double sh = height * scale;
137 sh +
gmwButton.border_thickness * 2, border);
Defines collision structures and provides functions for 2D collision detection.
int gm_mouse_in_rect(const double x, const double y, const double w, const double h)
Checks if the mouse cursor is currently within a given rectangular area.
Definition collision.h:172
#define GM_WHITE
White color.
Definition color.h:892
uint32_t gmColor
Type definition for color values, stored as a 32-bit unsigned integer. The color components are packe...
Definition color.h:13
Functions for drawing shapes, text, and images.
int32_t gm_draw_text(double x, double y, const char *text, const char *font, double font_size, gmColor c)
Draws text centered at a point.
Definition draw.h:140
int32_t gm_draw_rectangle(double x, double y, double w, double h, gmColor c)
Draws a rectangle centered at a point.
Definition draw.h:57
struct _gmMouse gm_mouse
Definition mouse.h:32