A button structure containing the common button functionalities Including highlight and pressing functionalities. More...
#include <tonc_types.h>Go to the source code of this file.
Data Structures | |
| struct | Button |
| A button representation. More... | |
Macros | |
| #define | BTN_HIGHLIGHT_COLOR 0xFFFF |
| #define | BUTTON_SFX_VOLUME 154 |
Typedefs | |
| typedef void(* | ButtonOnPressedFunc) (void) |
| The function to be called when the button is pressed. | |
| typedef bool(* | ButtonCanBePressedFunc) (void) |
| Returns true if the button should be activated when pressed. | |
Functions | |
| void | button_set_highlight (Button *button, bool highlight) |
| Set the button highlight on or off. | |
| void | button_press (Button *button) |
| Execute a button press, by calling the button's on_pressed function. This checks the button's can_be_pressed function and will do nothing if returns false. | |
A button structure containing the common button functionalities Including highlight and pressing functionalities.
Definition in file button.h.
| typedef bool(* ButtonCanBePressedFunc) (void) |
| typedef void(* ButtonOnPressedFunc) (void) |
| void button_press | ( | Button * | button | ) |
Execute a button press, by calling the button's on_pressed function. This checks the button's can_be_pressed function and will do nothing if returns false.
Button presses should go through this function rather than directly call on_pressed.
| button | The button being pressed. No-op on NULL. |