SetCursorPosition: Difference between revisions
Jump to navigation
Jump to search
Zangomangu (talk | contribs) (Removed fixed issue) |
Fernando187 (talk | contribs) m (fix see also) |
||
Line 33: | Line 33: | ||
==See Also== | ==See Also== | ||
{{ | {{Client_cursor_functions}} | ||
[[hu:setCursorPosition]] | [[hu:setCursorPosition]] |
Revision as of 15:09, 6 November 2024
This function sets the current position of the mouse cursor.
Syntax
bool setCursorPosition ( int cursorX, int cursorY )
Required Arguments
- cursorX: Position over the X axis
- cursorY: Position over the Y axis
Returns
Returns true if the position has been successfully set, false otherwise.
Example
This example sets your cursor position to the center of your screen after using the command cursorpos.
function centerCursorFunction() local showing = isCursorShowing () if showing then -- if the cursor is showing local screenX, screenY = guiGetScreenSize () --get the screen size in pixels setCursorPosition (screenX/2, screenY/2) --set the cursor position to the center of the screen else outputChatBox( "Your cursor is not showing." ) end end addCommandHandler( "cursorpos", centerCursorFunction )
See Also
This page is marked for deletion. | |
Reason: No longer used, this was just referring to another template Actions: Delete (Administrators) - Discuss - What links here - Category
|