<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MajkuS</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MajkuS"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/MajkuS"/>
	<updated>2026-04-16T13:02:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetCursorPosition&amp;diff=64524</id>
		<title>SetCursorPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetCursorPosition&amp;diff=64524"/>
		<updated>2019-10-15T12:18:48Z</updated>

		<summary type="html">&lt;p&gt;MajkuS: /* Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the current position of the mouse cursor.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setCursorPosition ( int cursorX, int cursorY )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
&amp;lt;!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --&amp;gt;&lt;br /&gt;
*'''cursorX:''' Position over the X axis&lt;br /&gt;
*'''cursorY:''' Position over the Y axis&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns ''true'' if the position has been successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example sets your cursor position to the center of your screen after using the command ''cursorpos''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function centerCursorFunction()&lt;br /&gt;
    local showing = isCursorShowing ()&lt;br /&gt;
    if showing then -- if the cursor is showing&lt;br /&gt;
        local screenX, screenY = guiGetScreenSize () --get the screen size in pixels&lt;br /&gt;
        setCursorPosition (screenX/2, screenY/2) --set the cursor position to the center of the screen&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox( &amp;quot;Your cursor is not showing.&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;centerCursor&amp;quot;, centerCursorFunction )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|8941|setCursorPosition [fixed]}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_input_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setCursorPosition]]&lt;/div&gt;</summary>
		<author><name>MajkuS</name></author>
	</entry>
</feed>