ctrlPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
(formatting and new command group)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma1
|game1= arma1


|1.00
|version1= 1.00


|gr1= GUI Control
|game2= arma2


| Returns the current position of 2D control as [x, y, w, h] array. For 3D control it returns relative [x,y,z].
|version2= 1.00


| '''ctrlPosition''' controlName
|game3= arma2oa
 
|version3= 1.51
 
|game4= tkoh
 
|version4= 1.00
 
|game5= arma3
 
|version5= 0.5
 
|gr1= GUI Control - Positioning
 
|descr= Returns the current position of 2D control as {{ic|[x, y, w, h]}} array. For 3D control it returns relative {{ic|[x, y, z]}}. If the control is part of a [[CT_CONTROLS_GROUP]], the returned position will be relative to the group's position.
 
|s1= '''ctrlPosition''' controlName


|p1= controlName: [[Control]]
|p1= controlName: [[Control]]


| [[Array]]
|r1= [[Array]] in format {{ic|[x, y, w, h]}} (2D) or {{ic|[x, y, z]}} (3D)
   
   
|x1= <code>_pos = [[ctrlPosition]] _control;</code>
|x1= <code>_pos = [[ctrlPosition]] _control;</code>
Line 20: Line 36:
}}
}}


{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
<dd class="notedate">Posted on May 22, 2017 - 23:02 (UTC)</dd>
<dt class="note">[[User:Lucian|Lucian]]</dt>
<dd class="note">
If the ctrl is part of a CtrlGroup the returned position is relative to the ctrlGroups position.
</dd>
<dd class="notedate">Posted on November 7, 2020 - 01:23 (UTC)</dd>
<dd class="notedate">Posted on November 7, 2020 - 01:23 (UTC)</dd>
<dt class="note">[[User:Larrow|Larrow]]</dt>
<dt class="note">[[User:Larrow|Larrow]]</dt>
Line 41: Line 43:
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 02:32, 5 March 2021

Hover & click on the images for description

Description

Description:
Returns the current position of 2D control as [x, y, w, h] array. For 3D control it returns relative [x, y, z]. If the control is part of a CT_CONTROLS_GROUP, the returned position will be relative to the group's position.
Groups:
GUI Control - Positioning

Syntax

Syntax:
ctrlPosition controlName
Parameters:
controlName: Control
Return Value:
Array in format [x, y, w, h] (2D) or [x, y, z] (3D)

Examples

Example 1:
_pos = ctrlPosition _control;

Additional Information

See also:
ctrlCreatectrlDeletectrlModelctrlSetModelctrlSetPositionctrlClassNamedisplayCtrlctrlModelScalectrlSetModelScalectrlModelDirAndUpctrlSetModelDirAndUp

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
Posted on November 7, 2020 - 01:23 (UTC)
Larrow
If the control is a ControlsTable header or row control the returned position is relative to the ControlsTable position.