ctrlMousePosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
(added seeAlso)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


|game1= arma3
|game1= arma3
|version1= 2.00


|version= 2.00
|gr1= GUI Control - Positioning


|gr1= GUI Control
|descr= Returns position of the mouse on the screen relative to UI Control in UI coordinates. Also works within [[CT_CONTROLS_GROUP]]s. In that case, returned position is relative to the position of the group.
 
|descr= Returns position of the mouse on the screen relative to UI Control in UI coordinates.
 
|mp= |Multiplayer Behaviour=
 
|pr= |Problems=


|s1= [[ctrlMousePosition]] control
|s1= [[ctrlMousePosition]] control
Line 19: Line 14:
|r1= [[Array]]
|r1= [[Array]]


|x1= <code>_mousePos = [[ctrlMousePosition]] _ctrl;</code>
|x1= <sqf>private _mouseRelPos = ctrlMousePosition _ctrl;</sqf>


|seealso= [[setMousePosition]] [[getMousePosition]] [[controlsGroupCtrl]] [[ctrlParentControlsGroup]]
|seealso= [[ctrlSetMousePosition]] [[setMousePosition]] [[getMousePosition]] [[ctrlMapCursor]]
}}
}}
<dl class="command_description">
<!-- BEGIN Note Section -->
<!-- END Note Section -->
</dl>
<h3 style="display:none">Bottom Section</h3>
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 2, 2020 - 11:14 (UTC)</dd>
<dt class="note">[[User:Dscha|Dscha]]</dt>
<dd class="note">
[[ctrlMousePosition]] also do work with Controls within a [[CT_CONTROLS_GROUP]]. The return would be its position, relative to the parent position ([[ctrlParentControlsGroup]]).
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 12:08, 7 May 2023

Hover & click on the images for description

Description

Description:
Returns position of the mouse on the screen relative to UI Control in UI coordinates. Also works within CT_CONTROLS_GROUPs. In that case, returned position is relative to the position of the group.
Groups:
GUI Control - Positioning

Syntax

Syntax:
ctrlMousePosition control
Parameters:
control: Control
Return Value:
Array

Examples

Example 1:
private _mouseRelPos = ctrlMousePosition _ctrl;

Additional Information

See also:
ctrlSetMousePosition setMousePosition getMousePosition ctrlMapCursor

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