Yume Project
3.0
Touhou-inspired Danmaku game made in C only
Chargement...
Recherche...
Aucune correspondance
button.h
Aller à la documentation de ce fichier.
1
#pragma once
2
3
// #include "../include/raylib.h"
4
#include "
screen.h
"
5
#include "
input.h
"
6
#include <raylib.h>
7
8
#define MAX_BUTTONS 30
9
#define NO_BUTTON -1
10
11
typedef
struct
Button
{
12
Vector2
pos
;
13
int
buttonLeft
;
14
int
buttonRight
;
15
int
validated
;
16
}
Button
;
17
18
typedef
struct
ButtonSystem
{
19
Button
buttons
[
MAX_BUTTONS
];
20
int
selection
;
21
int
nbButtons
;
22
}
ButtonSystem
;
23
24
28
extern
void
button_system_init
(
ButtonSystem
*buttonSystem);
29
34
extern
void
button_update
(
ButtonSystem
*buttonSystem,
InputSystem
*inputState);
35
40
extern
int
button_is_validated
(
ButtonSystem
*buttonSystem);
41
47
extern
int
button_is_button_validated
(
ButtonSystem
*buttonSystem,
int
buttonID);
48
54
extern
void
button_create
(
ButtonSystem
*buttonSystem,
int
x,
int
y);
55
63
extern
void
button_create_ex
(
ButtonSystem
*buttonSystem,
int
x,
int
y,
int
left,
64
int
right);
65
69
extern
int
button_get_current_buttonID
(
ButtonSystem
*buttonSystem);
70
75
extern
Button
button_get_current_button
(
ButtonSystem
*buttonSystem);
76
82
extern
Vector2
button_get_button_position
(
ButtonSystem
*buttonSystem,
83
int
buttonID);
84
92
extern
void
button_draw_button_text
(
ButtonSystem
*buttonSystem,
int
buttonID,
93
char
*text,
int
fontSize, Color color);
94
103
extern
void
button_draw_button_text_touhou98
(
ButtonSystem
*buttonSystem,
int
buttonID,
char
*text,
int
fontSize, Color color);
104
113
extern
void
button_draw_selector_text
(
ButtonSystem
*buttonSystem,
int
x_offset,
114
int
y_offset,
char
*text,
int
fontSize,
115
Color color);
button_draw_selector_text
void button_draw_selector_text(ButtonSystem *buttonSystem, int x_offset, int y_offset, char *text, int fontSize, Color color)
Dessine le texte du sélecteur de bouton.
button_draw_button_text
void button_draw_button_text(ButtonSystem *buttonSystem, int buttonID, char *text, int fontSize, Color color)
Dessine le texte d'un bouton spécifique.
button_is_validated
int button_is_validated(ButtonSystem *buttonSystem)
Vérifie si le bouton actif a été validé
button_is_button_validated
int button_is_button_validated(ButtonSystem *buttonSystem, int buttonID)
Vérifie si un bouton spécifique a été validé
button_system_init
void button_system_init(ButtonSystem *buttonSystem)
Initialise le système de boutons.
button_get_current_button
Button button_get_current_button(ButtonSystem *buttonSystem)
Récupère le bouton actuellement sélectionné (retourne la structure complète du bouton).
button_get_button_position
Vector2 button_get_button_position(ButtonSystem *buttonSystem, int buttonID)
Récupère la position d'un bouton spécifique.
button_draw_button_text_touhou98
void button_draw_button_text_touhou98(ButtonSystem *buttonSystem, int buttonID, char *text, int fontSize, Color color)
Dessine le texte du sélecteur de bouton avec la police "Touhou98".
button_create
void button_create(ButtonSystem *buttonSystem, int x, int y)
Crée un nouveau bouton.
button_create_ex
void button_create_ex(ButtonSystem *buttonSystem, int x, int y, int left, int right)
Crée un nouveau bouton avec des touches spécifiques.
MAX_BUTTONS
#define MAX_BUTTONS
Definition
button.h:8
button_update
void button_update(ButtonSystem *buttonSystem, InputSystem *inputState)
Met à jour le système de boutons en fonction de l'état des entrées.
button_get_current_buttonID
int button_get_current_buttonID(ButtonSystem *buttonSystem)
Récupère l'ID du bouton actuellement sélectionné
input.h
screen.h
ButtonSystem
Definition
button.h:18
ButtonSystem::buttons
Button buttons[MAX_BUTTONS]
Definition
button.h:19
ButtonSystem::selection
int selection
Definition
button.h:20
ButtonSystem::nbButtons
int nbButtons
Definition
button.h:21
Button
Definition
button.h:11
Button::buttonLeft
int buttonLeft
Definition
button.h:13
Button::pos
Vector2 pos
Definition
button.h:12
Button::validated
int validated
Definition
button.h:15
Button::buttonRight
int buttonRight
Definition
button.h:14
InputSystem
Système d'entrée complet contenant keybinds et états courants des touches.
Definition
input.h:43
lib
internal
systems
button.h
Généré par
1.16.1