-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.h
More file actions
65 lines (62 loc) · 1.11 KB
/
Copy pathbutton.h
File metadata and controls
65 lines (62 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
** EPITECH PROJECT, 2020
** MUL_my_rpg_2019
** File description:
** button
*/
#ifndef BUTTON_H_
#define BUTTON_H_
#include <SFML/Graphics.h>
#include <SFML/System.h>
#include <SFML/Audio.h>
#include <SFML/Window.h>
#include <stdbool.h>
/**
* @brief different types of buttons
* @enum button_type
*
*/
enum button_type {
P_RESUME,
P_MAIN_MENU,
P_SAVE,
P_QUIT,
D_RESTART,
D_QUIT,
S_START,
S_HTP,
S_QUIT,
};
/**
* @struct button
* @typedef button_t
* @brief info about a button
*
*/
typedef struct button {
sfVector2f position;
sfVector2f size;
sfColor color;
sfIntRect rect;
unsigned int character_size;
char *font_pathfile;
char *text;
} button_t;
/**
* @struct button_display
* @typedef button_display_t
* @brief info needed to display a button
*/
typedef struct button_display {
sfRectangleShape *shape;
sfIntRect rect;
sfText *text;
sfFont *font;
} button_display_t;
/**
* @brief create a new button
* @param button_to_create
* @return new button
*/
button_display_t create_button(button_t button_to_create);
#endif /* !BUTTON_H_ */