-
Notifications
You must be signed in to change notification settings - Fork 0
MouseCursor
TechnologicalTurtle edited this page Jul 20, 2026
·
3 revisions
Handles cursor input and looks.
You shouldn't initialize MouseCursor by yourself, because it's automatically initialized with window.
You can get three different kinds of input from MouseCursor object
| Type | Name | Despription |
|---|---|---|
Vec2 |
position |
Current cursors position, {0, 0} on upper left corner of parent window. |
double |
scroll |
Mouse scroll delta value. |
MouseButton |
left_button |
Handles input for left mouse button. |
MouseButton |
middle_button |
Handles input for middle mouse button. |
MouseButton |
right_button |
Handles input for right mouse button. |
You can also change how cursor looks.
Using SetLooks(const LibGui::CursorShape_ shape) you can set cursor looks to predefined icons
MyWindow.cursor.SetLooks(LibGui::CursorShape_PointingHand);With SetLooks(LibGui::Image shape, const Vec2i pivot), you can set cursor looks to your own shape image, the pivot parameter means the center of cursor.
MyWindow.cursor.SetLooks(MyImage, {0, 250});This function is called in window.Draw() call, therefore you shouldn't call it.
Features