Cursor library

The ACSUtils cursor library allows mods to easily add mouse cursor support.

Basic usage

script "Menu" (void) CLIENTSIDE
{
while (true)
{
UpdateCursor();
SetHudSize(640, 480, false);
// Draw cursor at CursorX(), CursorY()
Delay(1);
}
}

UpdateCursor reads player input and moves the cursor. CursorX and CursorY return the current position of the cursor on the screen in HUD coordinate system. The coordinate system is 640×480 by default.

The cursor library does not draw the cursor for you. You can draw it manually using HudMessage or HUD Library, or even keep it invisible.

Advanced features

Getting cursor motion

CursorDeltaX and CursorDeltaY return the difference between the current and the previous cursor positions.

CursorMotionX and CursorMotionY return the difference between the current and the previous cursor positions that would've been there if the cursor was not blocked by screen boundaries.