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.
26 lines
565 B
26 lines
565 B
#ifndef BUTTONS_H_
|
|
#define BUTTONS_H_
|
|
|
|
#include "raylib.h"
|
|
#include "../game.h"
|
|
|
|
typedef struct Button{
|
|
Texture2D *textures[3]; // [0]: Normal [1]: Hovered [2]: Pressed
|
|
Vector2 position;
|
|
//char text[20];
|
|
int state; // 0: default 1: hovered 2: pressed
|
|
int id;
|
|
} Button;
|
|
|
|
// executes the logic of one button of certain id - huge switch?
|
|
void executeButton(Button *button, Game * game);
|
|
|
|
int updateButtonState(Button * button);
|
|
|
|
void drawButton(Button * button);
|
|
|
|
int isButtonPressed(Button * button);
|
|
|
|
int isButtonHovered(Button * button);
|
|
|
|
#endif |