You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
746 B
31 lines
746 B
#ifndef BUTTONS_H_
|
|
#define BUTTONS_H_
|
|
|
|
#include "raylib.h"
|
|
#include "../game.h"
|
|
|
|
#define BUTTON_FONT_SIZE 36
|
|
|
|
typedef struct Button{
|
|
Texture2D textures[3]; // [0]: Normal [1]: Hovered [2]: Pressed
|
|
Vector2 position;
|
|
Vector2 centerPosition;
|
|
char text[20];
|
|
int state; // 0: default 1: hovered 2: pressed
|
|
int id;
|
|
} Button;
|
|
|
|
Button * InitButton(Texture2D textures[3], Vector2 *position, char *text, int textLEN, int id);
|
|
|
|
// executes the logic of one button of certain id - huge switch?
|
|
void ButtonExecuteButton(Button *button, Game * game);
|
|
|
|
int ButtonUpdateButtonState(Button * button);
|
|
|
|
void ButtonDrawButton(Button * button);
|
|
|
|
int ButtonisButtonPressed(Button * button);
|
|
|
|
int ButtonisButtonHovered(Button * button);
|
|
|
|
#endif |