setMousePosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
(47 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|SETMOUSEPOSITION]]
{{RV|type=command
[[Category:Scripting Commands OFP Elite |SETMOUSEPOSITION]]
[[Category:Scripting Commands ArmA|SETMOUSEPOSITION]]


|game1= arma1
|version1= 1.00


<h2 style="color:#000066">''''' setMousePosition ''[x, y]'''''</h2>
|game2= arma2
|version2= 1.00


|game3= arma2oa
|version3= 1.50


'''Operand types:'''
|game4= tkoh
|version4= 1.00


'''[x, y]:''' [[Array]]
|game5= arma3
|version5= 0.50


'''Type of returned value:'''
|gr1= GUI Control - Positioning


[[Nothing]]
|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.


'''Compatibility:'''
|s1= [[setMousePosition]] [x, y]


Version 2.91 required.
|p1= x: [[Number]] - x in screen coordinates


'''Description:'''
|p2= y: [[Number]] - y in screen coordinates


Move (UI) mouse pointer to specified position of the screen.
|r1= [[Nothing]]


|x1= <sqf>setMousePosition [0.5, 0.5];</sqf>


'''Example:'''
|seealso= [[getMousePosition]] [[ctrlMapCursor]] [[reversedMouseY]]
 
}}
'''setMousePosition''' [0.5, 0.5]

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