Tuxánci 2
Successor to Tuxánci
 
Loading...
Searching...
No Matches
button.h
Go to the documentation of this file.
1/*
2 * Tuxánci 2 - Successor to Tuxánci
3 * Copyright (C) 2026 Connor Thomson
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
23
24#ifndef BUTTON_H
25#define BUTTON_H
26
27#include "raylib.h"
28#include <stdbool.h>
29
30typedef struct Button {
31 Rectangle rect;
32 const char* text;
34 Color baseColor;
35 Color hoverColor;
36 bool hovered;
37} Button;
38
39Button buttonCreate(const char* text, int x, int y, int w, int h);
40void buttonDraw(Button* b);
41bool buttonPressed(Button* b);
42
43#endif // BUTTON_H
Button buttonCreate(const char *text, int x, int y, int w, int h)
Creates a new Button.
Definition button.c:42
bool buttonPressed(Button *b)
Check if a Button is pressed.
Definition button.c:82
void buttonDraw(Button *b)
Draws a Button.
Definition button.c:64
Definition button.h:30
Color hoverColor
Button color on hover.
Definition button.h:35
const char * text
Button text.
Definition button.h:32
bool hovered
Is mouse over Button?
Definition button.h:36
Rectangle rect
Button size.
Definition button.h:31
int fontSize
Button font size.
Definition button.h:33
Color baseColor
Button color.
Definition button.h:34