This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
functions:cursor [2016/08/08 18:03] – [Coordinate system] korshun | functions:cursor [2017/06/12 15:39] (current) – removed korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Cursor ====== | ||
- | |||
- | This is a simple library that implements the mouse cursor in ACS. | ||
- | |||
- | This library takes into account the player' | ||
- | |||
- | <note important> | ||
- | |||
- | Serverside cursors are very laggy in mods that use them and can't take the player' | ||
- | |||
- | <note important> | ||
- | |||
- | ===== Example ===== | ||
- | |||
- | < | ||
- | while (true) | ||
- | { | ||
- | // Get mouse input. | ||
- | UpdateCursor(); | ||
- | | ||
- | // Draw the cursor at CursorX(), CursorY(). | ||
- | HudSetPoint(CursorX(), | ||
- | HudDrawText(1, | ||
- | | ||
- | // Wait for next frame. | ||
- | Delay(1); | ||
- | } | ||
- | </ | ||
- | |||
- | ===== Coordinate system ===== | ||
- | |||
- | The cursor' | ||
- | |||
- | <note warning> | ||
- | ===== Functions ===== | ||
- | |||
- | ==== UpdateCursor ==== | ||
- | '' | ||
- | |||
- | Updates the cursor position using the input from ConsolePlayer (current computer). | ||
- | |||
- | ==== CursorX ==== | ||
- | '' | ||
- | |||
- | Returns the cursor' | ||
- | |||
- | ==== CursorY ==== | ||
- | '' | ||
- | |||
- | Returns the cursor' | ||
- | |||
- | ==== CenterCursor ==== | ||
- | '' | ||
- | |||
- | Centers the cursor on the screen. | ||
- | |||
- | ==== SetCursorPosition ==== | ||
- | '' | ||
- | |||
- | Sets the cursor' | ||
- | |||
- | ==== SetCursorSpeed ==== | ||
- | '' | ||
- | |||
- | Sets the cursor' | ||
- | |||
- | Default is 1.0. | ||
- | |||
- | ==== SetCursorSpeedX ==== | ||
- | '' | ||
- | |||
- | Sets the cursor' | ||
- | |||
- | Default is 1.0. | ||
- | |||
- | ==== SetCursorSpeedY ==== | ||
- | '' | ||
- | |||
- | Sets the cursor' | ||
- | |||
- | Default is 1.0. | ||
- | |||
- | ==== EnableCursorWrap ==== | ||
- | '' | ||
- | |||
- | If enabled, the cursor when moved outside the screen, will teleport to the opposite edge of the screen. | ||
- | |||
- | ==== SetCursorArea ==== | ||
- | '' | ||
- | |||
- | Sets the coordinate system for the cursor. You can use any size from 1.0 to several thousands for any axis. When '' | ||
- | |||
- | Default is 640x480. | ||
- | |||
- | <note tip>This function does not change the cursor' | ||
- | |||
- | ==== CursorDeltaX ==== | ||
- | '' | ||
- | |||
- | Returns the last **change** in cursor' | ||
- | |||
- | ==== CursorDeltaY ==== | ||
- | '' | ||
- | |||
- | Returns the last **change** in cursor' | ||
- | |||