setMousePosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add. ArmA2 classification)
(formatting and new command group)
(32 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1


|1.00|= Game version
|version1= 1.00
____________________________________________________________________________________________


| Move (UI) mouse pointer to specified position of the screen.
|game2= arma2


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


| setMousePosition '''[x, y]''' |= Syntax
|game3= arma2oa


|p1= [x, y]: [[Array]] |= Parameter 1
|version3= 1.51


| [[Nothing]] |= Return value
|game4= tkoh
____________________________________________________________________________________________
 
 
|version4= 1.00
|x1= <pre>setMousePosition [0.5, 0.5]</pre> |= Example 1
 
____________________________________________________________________________________________
|game5= arma3
 
|version5= 0.50
 
|gr1= GUI Control - Positioning
 
|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.


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


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


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


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


<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}}}}]]

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