ctrlPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 $2")
m (Fix note)
 
(3 intermediate revisions by 2 users not shown)
Line 18: Line 18:
|gr1= GUI Control - Positioning
|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.
|descr= Returns the current position of 2D control as {{hl|[x, y, w, h]}} array. For 3D control it returns relative {{hl|[x, y, z]}}.<br>
If the control is within a [[CT_CONTROLS_GROUP]], the returned position will be relative to the group's position.<br>
If the control is a [[CT_CONTROLS_TABLE]] header or row the returned position is relative to the table's position.


|s1= [[ctrlPosition]] controlName
|s1= [[ctrlPosition]] controlName


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


|r1= [[Array]] in format {{ic|[x, y, w, h]}} (2D) or {{ic|[x, y, z]}} (3D)
|r1= [[Array]] in format {{hl|[x, y, w, h]}} (2D) or {{hl|[x, y, z]}} (3D)


|x1= <code>_pos = [[ctrlPosition]] _control;</code>
|x1= <sqf>_pos = ctrlPosition _control;</sqf>


|seealso= [[ctrlCreate]] [[ctrlDelete]] [[ctrlModel]] [[ctrlSetModel]] [[ctrlSetPosition]] [[ctrlClassName]] [[displayCtrl]] [[ctrlModelScale]] [[ctrlSetModelScale]] [[ctrlModelDirAndUp]] [[ctrlSetModelDirAndUp]]
|seealso= [[ctrlCreate]] [[ctrlDelete]] [[ctrlModel]] [[ctrlSetModel]] [[ctrlSetPosition]] [[ctrlClassName]] [[displayCtrl]] [[ctrlModelScale]] [[ctrlSetModelScale]] [[ctrlModelDirAndUp]] [[ctrlSetModelDirAndUp]]
}}
}}
<dl class="command_description">
<dt></dt>
<dd class="notedate">Posted on November 7, 2020 - 01:23 (UTC)</dd>
<dt class="note">[[User:Larrow|Larrow]]</dt>
<dd class="note">
If the control is a ControlsTable header or row control the returned position is relative to the ControlsTable position.
</dd>
</dl>

Latest revision as of 12:28, 22 March 2024

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 within a CT_CONTROLS_GROUP, the returned position will be relative to the group's position.
If the control is a CT_CONTROLS_TABLE header or row the returned position is relative to the table'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:
ctrlCreate ctrlDelete ctrlModel ctrlSetModel ctrlSetPosition ctrlClassName displayCtrl ctrlModelScale ctrlSetModelScale ctrlModelDirAndUp ctrlSetModelDirAndUp

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