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
11typedef struct Button {
12 Vector2 pos;
17
23
24
28extern void button_system_init(ButtonSystem *buttonSystem);
29
34extern void button_update(ButtonSystem *buttonSystem, InputSystem *inputState);
35
40extern int button_is_validated(ButtonSystem *buttonSystem);
41
47extern int button_is_button_validated(ButtonSystem *buttonSystem, int buttonID);
48
54extern void button_create(ButtonSystem *buttonSystem, int x, int y);
55
63extern void button_create_ex(ButtonSystem *buttonSystem, int x, int y, int left,
64 int right);
65
69extern int button_get_current_buttonID(ButtonSystem *buttonSystem);
70
76
82extern Vector2 button_get_button_position(ButtonSystem *buttonSystem,
83 int buttonID);
84
92extern void button_draw_button_text(ButtonSystem *buttonSystem, int buttonID,
93 char *text, int fontSize, Color color);
94
103extern void button_draw_button_text_touhou98(ButtonSystem *buttonSystem, int buttonID, char *text, int fontSize, Color color);
104
113extern void button_draw_selector_text(ButtonSystem *buttonSystem, int x_offset,
114 int y_offset, char *text, int fontSize,
115 Color color);
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.
void button_draw_button_text(ButtonSystem *buttonSystem, int buttonID, char *text, int fontSize, Color color)
Dessine le texte d'un bouton spécifique.
int button_is_validated(ButtonSystem *buttonSystem)
Vérifie si le bouton actif a été validé
int button_is_button_validated(ButtonSystem *buttonSystem, int buttonID)
Vérifie si un bouton spécifique a été validé
void button_system_init(ButtonSystem *buttonSystem)
Initialise le système de boutons.
Button button_get_current_button(ButtonSystem *buttonSystem)
Récupère le bouton actuellement sélectionné (retourne la structure complète du bouton).
Vector2 button_get_button_position(ButtonSystem *buttonSystem, int buttonID)
Récupère la position d'un bouton spécifique.
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".
void button_create(ButtonSystem *buttonSystem, int x, int y)
Crée un nouveau bouton.
void button_create_ex(ButtonSystem *buttonSystem, int x, int y, int left, int right)
Crée un nouveau bouton avec des touches spécifiques.
#define MAX_BUTTONS
Definition button.h:8
void button_update(ButtonSystem *buttonSystem, InputSystem *inputState)
Met à jour le système de boutons en fonction de l'état des entrées.
int button_get_current_buttonID(ButtonSystem *buttonSystem)
Récupère l'ID du bouton actuellement sélectionné
Definition button.h:18
Button buttons[MAX_BUTTONS]
Definition button.h:19
int selection
Definition button.h:20
int nbButtons
Definition button.h:21
Definition button.h:11
int buttonLeft
Definition button.h:13
Vector2 pos
Definition button.h:12
int validated
Definition button.h:15
int buttonRight
Definition button.h:14
Système d'entrée complet contenant keybinds et états courants des touches.
Definition input.h:43