ctrlPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]3(\|.*)]]" to "{{GameCategory|arma3|Scripting Commands}}")
m (Fix note)
 
(34 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma1 |Game name=
|game1= arma1
|version1= 1.00


|1.00|Game version=
|game2= arma2
|version2= 1.00


|gr1= GUI Control |GROUP1=
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


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


| '''ctrlPosition''' controlName|SYNTAX=
|game5= arma3
|version5= 0.50


|p1= controlName: [[Control]] |PARAMETER1=
|gr1= GUI Control - Positioning


| [[Array]] |RETURNVALUE=
|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.
|x1= <code>_pos = [[ctrlPosition]] _control;</code> |EXAMPLE1=
____________________________________________________________________________________________


| [[ctrlCreate]], [[ctrlDelete]], [[ctrlModel]], [[ctrlSetModel]], [[ctrlSetPosition]], [[ctrlClassName]], [[displayCtrl]], [[ctrlModelScale]], [[ctrlSetModelScale]], [[ctrlModelDirAndUp]], [[ctrlSetModelDirAndUp]]  |SEEALSO=
|s1= [[ctrlPosition]] controlName


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


<h3 style="display:none">Notes</h3>
|r1= [[Array]] in format {{hl|[x, y, w, h]}} (2D) or {{hl|[x, y, z]}} (3D)
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x1= <sqf>_pos = ctrlPosition _control;</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[ctrlCreate]] [[ctrlDelete]] [[ctrlModel]] [[ctrlSetModel]] [[ctrlSetPosition]] [[ctrlClassName]] [[displayCtrl]] [[ctrlModelScale]] [[ctrlSetModelScale]] [[ctrlModelDirAndUp]] [[ctrlSetModelDirAndUp]]
 
}}
[[Category:Scripting Commands|CTRLPOSITION]]
{{GameCategory|arma1|Scripting Commands}}
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<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>
</dl>
<!-- DISCONTINUE Notes -->
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<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>
<!-- DISCONTINUE Notes -->

Latest revision as of 11: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