|
JNGL
Easy to use cross-platform 2D game library
|
Classes | |
| struct | Down |
| struct | Over |
Public Member Functions | |
| void | transform (const jngl::Mat3 &transformationMatrix) |
| Applies the transformationMatrix on the mouse position. | |
| std::span< Over > | cursors () |
| Only returns mouse cursors that are currently not over something. | |
Friends | |
| class | jngl::Window |
Definition at line 18 of file MouseInfo.hpp.
| void transform | ( | const jngl::Mat3 & | transformationMatrix | ) |
Applies the transformationMatrix on the mouse position.
Let's say you want to move the move position in MouseInfo 50 pixel to the right, you'd do:
If (mousePos.x, mousePos.y, 1) is
It uses the inverse of the passed matrix, because normally transformations are for rendering where world coordinates are transformed into screen coordinates. The mouse position is in screen coordinates and you want to transform it to world coordinates. This is useful if you have a camera matrix and use it for rendering (applying it on jngl::modelview()) and here.
|
friend |
Definition at line 82 of file MouseInfo.hpp.