setMousePosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(formatting and new command group)
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1


|1.00|= Game version
|version1= 1.00
____________________________________________________________________________________________


| 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. |= Description
|game2= arma2
____________________________________________________________________________________________


| '''setMousePosition''' [x, y] |= Syntax
|version2= 1.00


|p1= [x, y]: [[Array]] |= Parameter 1
|game3= arma2oa
|p2= x: [[Number]] - x in screen coordinates |= Parameter 1
|p3= y: [[Number]] - y in screen coordinates|= Parameter 1


| [[Nothing]] |= Return value
|version3= 1.51
____________________________________________________________________________________________
 
 
|game4= tkoh
|x1= <code>[[setMousePosition]] [0.5, 0.5];</code> |= Example 1
 
____________________________________________________________________________________________
|version4= 1.00
 
|game5= arma3
 
|version5= 0.50
 
|gr1= GUI Control - Positioning


| [[getMousePosition]], [[ctrlMapCursor]] |= See also
|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.


}}
|s1= '''setMousePosition''' [x, y]


<h3 style="display:none">Notes</h3>
|p1= x: [[Number]] - x in screen coordinates
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|p2= y: [[Number]] - y in screen coordinates
</dl>


<h3 style="display:none">Bottom Section</h3>
|r1= [[Nothing]]
[[Category:Scripting Commands|SETMOUSEPOSITION]]
 
[[Category:Scripting Commands OFP Elite |SETMOUSEPOSITION]]
|x1= <code>[[setMousePosition]] [0.5, 0.5];</code>
[[Category:Scripting Commands ArmA|SETMOUSEPOSITION]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
|seealso= [[getMousePosition]], [[ctrlMapCursor]], [[reversedMouseY]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Revision as of 12:04, 5 March 2021

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:
getMousePositionctrlMapCursorreversedMouseY

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