Input-related functions: gamepads.
More...
#include <Gamepad.hpp>
|
| | Gamepad (int gamepadNumber=0) |
| |
| int | GetAxisCount () const |
| | Return gamepad axis count for a gamepad.
|
| |
| float | GetAxisMovement (int axis) const |
| | Return axis movement value for a gamepad axis.
|
| |
| std::string | GetName () const |
| | Return gamepad internal name id.
|
| |
| int | GetNumber () const |
| | Retrieves the number value for the object.
|
| |
| bool | IsAvailable () const |
| | Detect if a gamepad is available.
|
| |
| bool | IsButtonDown (int button) const |
| | Detect if a gamepad button is being pressed.
|
| |
| bool | IsButtonPressed (int button) const |
| | Detect if a gamepad button has been pressed once.
|
| |
| bool | IsButtonReleased (int button) const |
| | Detect if a gamepad button has been released once.
|
| |
| bool | IsButtonUp (int button) const |
| | Detect if a gamepad button is NOT being pressed.
|
| |
| | operator int () const |
| |
| | operator std::string () const |
| | Return gamepad internal name id.
|
| |
| Gamepad & | operator= (const Gamepad &gamepad) |
| |
| Gamepad & | operator= (int gamepadNumber) |
| |
| void | SetNumber (int value) |
| | Sets the number value for the object.
|
| |
| void | SetVibration (float leftMotor, float rightMotor, float duration) const |
| | Set gamepad vibration for both motors (duration in seconds)
|
| |
|
| static int | GetButtonPressed () |
| | Get the last gamepad button pressed.
|
| |
| static bool | IsAvailable (int number) |
| | Detect if a gamepad is available.
|
| |
| static int | SetMappings (const std::string &mappings) |
| |
|
| void | set (int gamepadNumber) |
| |
Input-related functions: gamepads.
Definition at line 13 of file Gamepad.hpp.
◆ Gamepad()
| raylib::Gamepad::Gamepad |
( |
int |
gamepadNumber = 0 | ) |
|
|
inline |
◆ GetAxisCount()
| int raylib::Gamepad::GetAxisCount |
( |
| ) |
const |
|
inline |
Return gamepad axis count for a gamepad.
Definition at line 84 of file Gamepad.hpp.
◆ GetAxisMovement()
| float raylib::Gamepad::GetAxisMovement |
( |
int |
axis | ) |
const |
|
inline |
Return axis movement value for a gamepad axis.
Definition at line 89 of file Gamepad.hpp.
◆ GetButtonPressed()
| static int raylib::Gamepad::GetButtonPressed |
( |
| ) |
|
|
inlinestatic |
Get the last gamepad button pressed.
Definition at line 79 of file Gamepad.hpp.
◆ GetName()
| std::string raylib::Gamepad::GetName |
( |
| ) |
const |
|
inline |
◆ GetNumber()
| int raylib::Gamepad::GetNumber |
( |
| ) |
const |
|
inline |
Retrieves the number value for the object.
- Returns
- The number value of the object.
Definition at line 18 of file Gamepad.hpp.
◆ IsAvailable() [1/2]
| bool raylib::Gamepad::IsAvailable |
( |
| ) |
const |
|
inline |
Detect if a gamepad is available.
Definition at line 39 of file Gamepad.hpp.
◆ IsAvailable() [2/2]
| static bool raylib::Gamepad::IsAvailable |
( |
int |
number | ) |
|
|
inlinestatic |
Detect if a gamepad is available.
Definition at line 44 of file Gamepad.hpp.
◆ IsButtonDown()
| bool raylib::Gamepad::IsButtonDown |
( |
int |
button | ) |
const |
|
inline |
Detect if a gamepad button is being pressed.
Definition at line 64 of file Gamepad.hpp.
◆ IsButtonPressed()
| bool raylib::Gamepad::IsButtonPressed |
( |
int |
button | ) |
const |
|
inline |
Detect if a gamepad button has been pressed once.
Definition at line 59 of file Gamepad.hpp.
◆ IsButtonReleased()
| bool raylib::Gamepad::IsButtonReleased |
( |
int |
button | ) |
const |
|
inline |
Detect if a gamepad button has been released once.
Definition at line 69 of file Gamepad.hpp.
◆ IsButtonUp()
| bool raylib::Gamepad::IsButtonUp |
( |
int |
button | ) |
const |
|
inline |
Detect if a gamepad button is NOT being pressed.
Definition at line 74 of file Gamepad.hpp.
◆ operator int()
| raylib::Gamepad::operator int |
( |
| ) |
const |
|
inlineexplicit |
◆ operator std::string()
| raylib::Gamepad::operator std::string |
( |
| ) |
const |
|
inlineexplicit |
◆ operator=() [1/2]
◆ operator=() [2/2]
| Gamepad & raylib::Gamepad::operator= |
( |
int |
gamepadNumber | ) |
|
|
inline |
◆ set()
| void raylib::Gamepad::set |
( |
int |
gamepadNumber | ) |
|
|
inlineprotected |
◆ SetMappings()
| static int raylib::Gamepad::SetMappings |
( |
const std::string & |
mappings | ) |
|
|
inlinestatic |
◆ SetNumber()
| void raylib::Gamepad::SetNumber |
( |
int |
value | ) |
|
|
inline |
Sets the number value for the object.
- Parameters
-
| value | The value of which to set number to. |
Definition at line 18 of file Gamepad.hpp.
◆ SetVibration()
| void raylib::Gamepad::SetVibration |
( |
float |
leftMotor, |
|
|
float |
rightMotor, |
|
|
float |
duration |
|
) |
| const |
|
inline |
Set gamepad vibration for both motors (duration in seconds)
Definition at line 96 of file Gamepad.hpp.
◆ number
| int raylib::Gamepad::number |