1#ifndef RAYLIB_CPP_INCLUDE_MOUSE_HPP_
2#define RAYLIB_CPP_INCLUDE_MOUSE_HPP_
5#include "./Vector2.hpp"
17 return ::IsMouseButtonPressed(button);
24 return ::IsMouseButtonDown(button);
31 return ::IsMouseButtonReleased(button);
35 return ::IsMouseButtonUp(button);
46 static inline void SetX(
int x) {
47 ::SetMousePosition(x,
GetY());
50 static inline void SetY(
int y) {
51 ::SetMousePosition(
GetX(), y);
55 return ::GetMousePosition();
59 ::SetMousePosition(x, y);
63 ::SetMousePosition(
static_cast<int>(position.x),
static_cast<int>(position.y));
66 static inline void SetOffset(
int offsetX = 0,
int offsetY = 0) {
67 ::SetMouseOffset(offsetX, offsetY);
71 ::SetMouseOffset(
static_cast<int>(offset.x),
static_cast<int>(offset.y));
74 static inline void SetScale(
float scaleX = 1.0f,
float scaleY = 1.0f) {
75 ::SetMouseScale(scaleX, scaleY);
79 ::SetMouseScale(scale.x, scale.y);
83 return ::GetMouseWheelMove();
91 static inline void SetCursor(
int cursor = MOUSE_CURSOR_DEFAULT) {
92 ::SetMouseCursor(cursor);
106 return ::GetTouchY();
113 return ::GetTouchPosition(index);
Input-related functions: mouse.
static void SetScale(float scaleX=1.0f, float scaleY=1.0f)
static int GetTouchX()
Get touch position X for touch point 0 (relative to screen size)
static bool IsButtonDown(int button)
Detect if a mouse button is being pressed.
static void SetScale(::Vector2 scale)
static int GetTouchY()
Get touch position Y for touch point 0 (relative to screen size)
static void SetOffset(::Vector2 offset)
static void SetOffset(int offsetX=0, int offsetY=0)
static bool IsButtonUp(int button)
static Vector2 GetTouchPosition(int index)
Get touch position XY for a touch point index (relative to screen size)
static void SetCursor(int cursor=MOUSE_CURSOR_DEFAULT)
Sets the current mouse cursor icon.
static bool IsButtonReleased(int button)
Detect if a mouse button has been released once.
static void SetPosition(::Vector2 position)
static bool IsButtonPressed(int button)
Detect if a mouse button has been pressed once.
static Vector2 GetPosition()
static void SetPosition(int x, int y)
static float GetWheelMove()
All raylib-cpp classes and functions appear in the raylib namespace.