ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:updatecursor

Table of Contents

UpdateCursor

void UpdateCursor()

Description

Reads the activator's mouse input and turns it into cursor motion. Takes the following cvars into account so that the cursor is not affected by game mouse settings:

  • mouse_sensitivity
  • m_yaw
  • m_pitch
  • invertmouse

This function needs to be called in a loop. To minimize input lag, the following sequence needs to be followed:

  1. UpdateCursor()
  2. handle player input
  3. redraw cursor
  4. Delay(1)

Examples

while (true)
{
    UpdateCursor();
    DrawCursor(CursorX(), CursorY());
    Delay(1);
}
functions/updatecursor.txt · Last modified: 2017/06/13 17:15 by korshun