This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
cursor_library [2017/07/14 21:17] – created korshun | cursor_library [2017/07/14 21:40] (current) – korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Cursor library ====== | ====== Cursor library ====== | ||
The ACSUtils cursor library allows mods to easily add mouse cursor support. | The ACSUtils cursor library allows mods to easily add mouse cursor support. | ||
+ | |||
+ | It fully supports wide screens and takes into account all mouse settings of the user to provide consistent cursor support regardless of aiming settings. | ||
+ | |||
+ | <note important> | ||
+ | - serverside cursors are very laggy. | ||
+ | - cursor library can't read user's mouse settings to adjust cursor speed and direction. | ||
+ | - cursor library can't read user's aspect ratio to find correct screen boundaries. | ||
+ | </ | ||
===== Basic usage ===== | ===== Basic usage ===== | ||
Line 9: | Line 17: | ||
{ | { | ||
UpdateCursor(); | UpdateCursor(); | ||
+ | | ||
+ | SetHudSize(640, | ||
// Draw cursor at CursorX(), CursorY() | // Draw cursor at CursorX(), CursorY() | ||
Delay(1); | Delay(1); | ||
Line 15: | Line 25: | ||
</ | </ | ||
- | [[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]]. | + | [[functions:UpdateCursor]] reads player input and moves the cursor. [[functions:CursorX]] and [[functions:CursorY]] return the current position of the cursor on the screen in [[HUD coordinate system]]. |
+ | |||
+ | <note tip>The cursor library does not draw the cursor for you. You can draw it manually using [[zdoom> | ||
+ | |||
+ | ===== Advanced features ===== | ||
+ | |||
+ | ==== Getting cursor motion ==== | ||
+ | |||
+ | [[functions: | ||
+ | |||
+ | [[functions: | ||
+ | |||
+ | ==== Setting coordinate system scale ==== | ||
+ | |||
+ | [[functions: | ||
+ | |||
+ | Calling [[functions: | ||
+ | |||
+ | ==== Moving the cursor ==== | ||
+ | |||
+ | [[functions: | ||
+ | |||
+ | ==== Changing cursor speed ==== | ||
+ | |||
+ | [[functions: | ||
+ | |||
+ | ==== Cursor wraparound ==== | ||
+ | |||
+ | [[functions: | ||
+ | |||
+ | |||
+ | |||
+ |