![]() |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
Represents various input button types, including keyboard keys, mouse buttons, and gamepad buttons. More...
#include <BufferedRaylib.hpp>
Public Types | |
| enum class | Type { Invalid = 0 , Keyboard , Mouse , Gamepad } |
Public Member Functions | |
| bool | operator< (const Button &o) const |
| Overloaded less-than operator for comparing buttons. More... | |
Static Public Member Functions | |
| static Button | btn (MouseButton button) |
| Creates a button associated with a mouse buttion. More... | |
| static Button | gamepad_button (GamepadButton button, int gamepad=0) |
| Creates a button associated with a gamepad buttion. More... | |
| static bool | IsPressed (const Button &button) |
| Checks if the specified button is currently pressed. More... | |
| static uint8_t | IsSetPressed (const std::set< Button > &buttons) |
| Checks if a set of buttons is pressed. More... | |
| static Button | joy (GamepadButton button, int gamepad=0) |
| Creates a button associated with a gamepad buttion. More... | |
| static Button | key (KeyboardKey key) |
| Creates a button associated with a keyboard key. More... | |
| static Button | mouse_button (MouseButton button) |
| Creates a button associated with a mouse buttion. More... | |
| static Button | pad (GamepadButton button, int gamepad=0) |
| Creates a button associated with a gamepad buttion. More... | |
Public Attributes | |
| union { | |
| struct { | |
| GamepadButton button | |
| int id | |
| } gamepad | |
| KeyboardKey keyboard | |
| MouseButton mouse | |
| }; | |
| enum raylib::Button::Type | type |
Represents various input button types, including keyboard keys, mouse buttons, and gamepad buttons.
Definition at line 37 of file BufferedRaylib.hpp.
|
strong |
Definition at line 39 of file BufferedRaylib.hpp.
|
inlinestatic |
Creates a button associated with a mouse buttion.
| button | the button |
Definition at line 93 of file BufferedRaylib.hpp.
Referenced by mouse_button().
|
inlinestatic |
Creates a button associated with a gamepad buttion.
| button | the button |
| gamrpad | the gamepad the button is associated with (default 0) |
Definition at line 128 of file BufferedRaylib.hpp.
References pad().
|
static |
Checks if the specified button is currently pressed.
| button | The button to check. |
Definition at line 21 of file BufferedRaylib.cpp.
Referenced by IsSetPressed().
|
static |
Checks if a set of buttons is pressed.
| buttons | The set of buttons to check. |
Definition at line 35 of file BufferedRaylib.cpp.
References IsPressed().
|
inlinestatic |
Creates a button associated with a gamepad buttion.
| button | the button |
| gamrpad | the gamepad the button is associated with (default 0) |
Definition at line 119 of file BufferedRaylib.hpp.
References pad().
|
inlinestatic |
Creates a button associated with a keyboard key.
| key | the key |
Definition at line 85 of file BufferedRaylib.hpp.
References key().
Referenced by key(), and raylib::Action::wasd().
|
inlinestatic |
Creates a button associated with a mouse buttion.
| button | the button |
Definition at line 101 of file BufferedRaylib.hpp.
References btn().
| bool raylib::Button::operator< | ( | const Button & | o | ) | const |
Overloaded less-than operator for comparing buttons.
| o | The button to compare against. |
Definition at line 14 of file BufferedRaylib.cpp.
|
inlinestatic |
Creates a button associated with a gamepad buttion.
| button | the button |
| gamrpad | the gamepad the button is associated with (default 0) |
Definition at line 110 of file BufferedRaylib.hpp.
Referenced by gamepad_button(), and joy().
| GamepadButton raylib::Button::button |
Definition at line 53 of file BufferedRaylib.hpp.
| int raylib::Button::id |
Definition at line 52 of file BufferedRaylib.hpp.
| KeyboardKey raylib::Button::keyboard |
Definition at line 49 of file BufferedRaylib.hpp.
| MouseButton raylib::Button::mouse |
Definition at line 50 of file BufferedRaylib.hpp.