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
30
typedef
struct
Button
{
31
Rectangle
rect
;
32
const
char
*
text
;
33
int
fontSize
;
34
Color
baseColor
;
35
Color
hoverColor
;
36
bool
hovered
;
37
}
Button
;
38
39
Button
buttonCreate
(
const
char
* text,
int
x,
int
y,
int
w,
int
h);
40
void
buttonDraw
(
Button
* b);
41
bool
buttonPressed
(
Button
* b);
42
43
#endif
// BUTTON_H
buttonCreate
Button buttonCreate(const char *text, int x, int y, int w, int h)
Creates a new Button.
Definition
button.c:42
buttonPressed
bool buttonPressed(Button *b)
Check if a Button is pressed.
Definition
button.c:82
buttonDraw
void buttonDraw(Button *b)
Draws a Button.
Definition
button.c:64
Button
Definition
button.h:30
Button::hoverColor
Color hoverColor
Button color on hover.
Definition
button.h:35
Button::text
const char * text
Button text.
Definition
button.h:32
Button::hovered
bool hovered
Is mouse over Button?
Definition
button.h:36
Button::rect
Rectangle rect
Button size.
Definition
button.h:31
Button::fontSize
int fontSize
Button font size.
Definition
button.h:33
Button::baseColor
Color baseColor
Button color.
Definition
button.h:34
include
button.h
Generated by
1.13.2