mouse: Return float movement for precise scrolling where possible (#1397)
This commit is contained in:
parent
a4ea9f872f
commit
b29311c7ca
8 changed files with 19 additions and 19 deletions
|
@ -103,7 +103,7 @@ GetMousePosition|Vector2|(void);|
|
|||
SetMousePosition|void|(int x, int y);|
|
||||
SetMouseOffset|void|(int offsetX, int offsetY);|
|
||||
SetMouseScale|void|(float scaleX, float scaleY);|
|
||||
GetMouseWheelMove|int|(void);|
|
||||
GetMouseWheelMove|float|(void);|
|
||||
GetTouchX|int|(void);|
|
||||
GetTouchY|int|(void);|
|
||||
GetTouchPosition|Vector2|(int index);|
|
||||
|
|
|
@ -436,7 +436,7 @@
|
|||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetMouseWheelMove" func="yes">
|
||||
<Overload retVal="int" descr="Returns mouse wheel movement Y"></Overload>
|
||||
<Overload retVal="float" descr="Returns mouse wheel movement Y"></Overload>
|
||||
</KeyWord>
|
||||
|
||||
<!-- Input-related functions: touch -->
|
||||
|
|
|
@ -571,7 +571,7 @@
|
|||
</Overload>
|
||||
</KeyWord>
|
||||
<KeyWord name="GetMouseWheelMove" func="yes">
|
||||
<Overload retVal="int" descr="Returns mouse wheel movement Y"></Overload>
|
||||
<Overload retVal="float" descr="Returns mouse wheel movement Y"></Overload>
|
||||
</KeyWord>
|
||||
|
||||
<!-- Input-related functions: touch -->
|
||||
|
|
|
@ -147,7 +147,7 @@ RLAPI Vector2 GetMousePosition(void); // Returns mouse p
|
|||
RLAPI void SetMousePosition(int x, int y); // Set mouse position XY
|
||||
RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset
|
||||
RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling
|
||||
RLAPI int GetMouseWheelMove(void); // Returns mouse wheel movement Y
|
||||
RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y
|
||||
|
||||
// Input-related functions: touch
|
||||
RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size)
|
||||
|
|
|
@ -213,7 +213,7 @@ void App::GameLoop()
|
|||
DisableCursor();
|
||||
}
|
||||
|
||||
static int pos = 0;
|
||||
static float pos = 0;
|
||||
pos -= GetMouseWheelMove();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
|
@ -235,7 +235,7 @@ void App::GameLoop()
|
|||
if (IsKeyDown(KEY_BACKSPACE)) DrawRectangle(280, 250, 20, 20, BLACK);
|
||||
if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) DrawRectangle(280, 250, 20, 20, BLACK);
|
||||
|
||||
DrawRectangle(280, pos + 50, 20, 20, BLACK);
|
||||
DrawRectangle(280, (int)pos + 50, 20, 20, BLACK);
|
||||
DrawRectangle(250, 280 + (gTime++ % 60), 10, 10, PURPLE);
|
||||
|
||||
EndDrawing();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue