ctrlPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
m (Fix note)
 
(69 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|CTRLPOSITION]]
{{RV|type=command
[[Category:Scripting Commands ArmA|CTRLPOSITION]]


|game1= arma1
|version1= 1.00


<h2 style="color:#000066">''' ctrlPosition ''control'''''</h2>
|game2= arma2
|version2= 1.00


|game3= arma2oa
|version3= 1.50


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


'''control''': [[Control]]
|game5= arma3
|version5= 0.50


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


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


'''Compatibility:'''
|s1= [[ctrlPosition]] controlName


Version 2.50 required.
|p1= controlName: [[Control]]


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


Returns the current position of '''control''' as [x, y] array.
|x1= <sqf>_pos = ctrlPosition _control;</sqf>


 
|seealso= [[ctrlCreate]] [[ctrlDelete]] [[ctrlModel]] [[ctrlSetModel]] [[ctrlSetPosition]] [[ctrlClassName]] [[displayCtrl]] [[ctrlModelScale]] [[ctrlSetModelScale]] [[ctrlModelDirAndUp]] [[ctrlSetModelDirAndUp]]
'''Example''':
}}
 
_pos = '''ctrlPosition''' _control

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