Gama C Library
Gama C API Documentation
button.h File Reference

Defines the theme and functionality for a button widget. More...

#include "../collision.h"
#include "../draw.h"

Go to the source code of this file.

Data Structures

struct  gmwButtonTheme
 Structure defining the visual theme for a button widget. More...

Functions

int gmw_button (double x, double y, double width, double height, const char *text, double fontsize)
 Creates and renders an interactive button widget.

Variables

gmwButtonTheme gmwButton
 Global button theme instance with default values.

Detailed Description

Defines the theme and functionality for a button widget.

This file provides structures for customizing the appearance of buttons and a function to render an interactive button that responds to mouse input.

Function Documentation

◆ gmw_button()

int gmw_button ( double x,
double y,
double width,
double height,
const char * text,
double fontsize )

Creates and renders an interactive button widget.

This function draws a button at the specified coordinates and handles its interactive states (normal, hovered, active, disabled) based on mouse input and the global gmwButton theme.

Parameters
xThe x-coordinate of the button's center.
yThe y-coordinate of the button's center.
widthThe width of the button.
heightThe height of the button.
textThe text to display on the button (can be NULL).
fontsizeThe size of the text font.
Returns
1 if the button is currently hovered over, 0 otherwise.

Variable Documentation

◆ gmwButton

gmwButtonTheme gmwButton

Global button theme instance with default values.