-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.h
More file actions
64 lines (56 loc) · 2.09 KB
/
button.h
File metadata and controls
64 lines (56 loc) · 2.09 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
#ifndef BATTLESTAR_BUTTON_DATA
#define BATTLESTAR_BUTTON_DATA
#include "splashkit.h"
//Define Button Kinds
enum button_kind
{
//Main Menu Buttons
//Unselected
BUTTON_START_GAME_UNSELECTED,
BUTTON_HISCORES_UNSELECTED,
BUTTON_SETTINGS_UNSELECTED,
BUTTON_QUIT_GAME_UNSELECTED,
//Selected
BUTTON_START_GAME_SELECTED,
BUTTON_HISCORES_SELECTED,
BUTTON_SETTINGS_SELECTED,
BUTTON_QUIT_GAME_SELECTED,
//Hiscores Screen Buttons
//Unselected
BUTTON_BACK_TO_MAIN_MENU_UNSELECTED,
BUTTON_CLEAR_HISCORES_UNSELECTED,
//Selected
BUTTON_BACK_TO_MAIN_MENU_SELECTED,
BUTTON_CLEAR_HISCORES_SELECTED,
//Settings Screen Buttons
//Unselected
BUTTON_BACKGROUND_1_UNSELECTED,
BUTTON_BACKGROUND_2_UNSELECTED,
BUTTON_BACKGROUND_3_UNSELECTED,
BUTTON_BACKGROUND_4_UNSELECTED,
BUTTON_SHIP_1_UNSELECTED,
BUTTON_SHIP_2_UNSELECTED,
BUTTON_SHIP_3_UNSELECTED,
BUTTON_SHIP_4_UNSELECTED,
//Selected
BUTTON_BACKGROUND_1_SELECTED,
BUTTON_BACKGROUND_2_SELECTED,
BUTTON_BACKGROUND_3_SELECTED,
BUTTON_BACKGROUND_4_SELECTED,
BUTTON_SHIP_1_SELECTED,
BUTTON_SHIP_2_SELECTED,
BUTTON_SHIP_3_SELECTED,
BUTTON_SHIP_4_SELECTED
};
//Define Button struct
struct button_data
{
sprite button_sprite; //Button Sprite
button_kind kind; //Button Kind
};
button_data new_main_menu_button(button_kind kind, double y_pos); //Create a new Main Menu Button depending on the passed kind and x-position
button_data new_hiscores_screen_button(button_kind kind, double y_pos); //Create a new Hiscore Screen Button depending on the passed kind and x-position
button_data new_settings_screen_button(button_kind kind, double x_pos, double y_pos); //Create a new Settings Screen Button depending on the passed kind and x-position
void update_button(button_data &button); //Update the Button
void draw_button(button_data &button); //Draw the Button
#endif