Skip to content

MouseCursor

TechnologicalTurtle edited this page Jul 20, 2026 · 3 revisions

MouseCursor

Handles cursor input and looks.

Initialization

You shouldn't initialize MouseCursor by yourself, because it's automatically initialized with window.

Input

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.

Looks

You can also change how cursor looks.

Using cursor presets

Using SetLooks(const LibGui::CursorShape_ shape) you can set cursor looks to predefined icons

MyWindow.cursor.SetLooks(LibGui::CursorShape_PointingHand);

Using you own image

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});

void Update()

This function is called in window.Draw() call, therefore you shouldn't call it.

Clone this wiki locally