setMousePosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
(36 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.00


|1.00|= Game version
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| Move (UI) mouse pointer to specified position of the screen.
|game3= arma2oa
|version3= 1.50


Values of '''x''' and '''y''' can be in the range from 0 to 1.  |= Description
|game4= tkoh
____________________________________________________________________________________________
|version4= 1.00


| '''setMousePosition''' [x, y] |= Syntax
|game5= arma3
|version5= 0.50


|p1= [x, y]: [[Array]] |= Parameter 1
|gr1= GUI Control - Positioning


| [[Nothing]] |= Return value
|descr= Moves mouse pointer to specified position on the screen. '''x''' and '''y''' could be any number, but will be clipped so mouse never leaves the screen area.
____________________________________________________________________________________________
 
|x1= <pre>setMousePosition [0.5, 0.5]</pre> |= Example 1
____________________________________________________________________________________________


| |= See also
|s1= [[setMousePosition]] [x, y]


}}
|p1= x: [[Number]] - x in screen coordinates
 
|p2= y: [[Number]] - y in screen coordinates


<h3 style="display:none">Notes</h3>
|r1= [[Nothing]]
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x1= <sqf>setMousePosition [0.5, 0.5];</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[getMousePosition]] [[ctrlMapCursor]] [[reversedMouseY]]
[[Category:Scripting Commands|SETMOUSEPOSITION]]
}}
[[Category:Scripting Commands OFP Elite |SETMOUSEPOSITION]]
[[Category:Scripting Commands ArmA|SETMOUSEPOSITION]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Revision as of 11:24, 13 May 2022

Hover & click on the images for description

Description

Description:
Moves mouse pointer to specified position on the screen. x and y could be any number, but will be clipped so mouse never leaves the screen area.
Groups:
GUI Control - Positioning

Syntax

Syntax:
setMousePosition [x, y]
Parameters:
x: Number - x in screen coordinates
y: Number - y in screen coordinates
Return Value:
Nothing

Examples

Example 1:
setMousePosition [0.5, 0.5];

Additional Information

See also:
getMousePosition ctrlMapCursor reversedMouseY

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note