ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


setcursorarea

This is an old revision of the document!


Table of Contents

SetCursorArea

void SetCursorArea(fixed width, fixed height)

Description

Sets the size of the cursor coordinate system. The coordinate system used by the cursor matches the SetHudSize coordinate system exactly.

Cursor position is fully fixed-point, even SetCursorArea(1.0, 1.0) will work correctly.

When this function is called, cursor position is changed so that the cursor remains in the same place on screen after coordinate system change.

The default size is 640×480 (SetCursorArea(640.0, 480.0)).

Use the same coordinate system for both the cursor and the hud, like this:
SetCursorArea(640.0, 480.0);
SetHudSize(640, 480, 0);

Or, using HudLib:

SetCursorArea(640.0, 480.0);
HudSetVirtualSize(640.0, 480.0);

Examples

// The cursor is in the center of the screen.
SetCursorArea(640.0, 480.0);
CursorX() -> 320.0
SetCursorArea(320.0, 240.0);
CursorX() -> 160.0
SetCursorArea(1.0, 1.0);
CursorX() -> 0.5
setcursorarea.1490100452.txt.gz ยท Last modified: 2017/03/21 14:47 by korshun