{"name":"ctrlPosition","operator":null,"title":"ctrlPosition","type":"command","url":"https://community.bistudio.com/wiki/ctrlPosition","revid":377302,"updated":"2026-01-02T06:38:20Z","groups":["GUI Control - Positioning"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns the current position of 2D control as `[x, y, w, h]` array. For 3D control it returns relative `[x, z, y]`.\n\nIf the control is within a CT_CONTROLS_GROUP, the returned position will be relative to the group's position.\n\nIf the control is a CT_CONTROLS_TABLE header or row the returned position is relative to the table's position.","syntaxes":[{"syntax":"ctrlPosition controlName","since":null,"effect":null,"exec":null,"params":[{"name":"controlName","type":"Control","optional":false,"default":null,"description":null,"types":["Control"],"since":null,"text":"controlName: Control"}],"returns":{"type":"Array format `[x, y, w, h]` (2D) or `[x, z, y]` (3D)","types":["Array"],"description":null,"text":"Array format `[x, y, w, h]` (2D) or `[x, z, y]` (3D)"},"form":"unary","operator":null,"left":null,"right":{"text":"controlName","types":["Control"]}}],"examples":[{"text":"```sqf\n_pos = ctrlPosition _control;\n```","code":["_pos = ctrlPosition _control;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["ctrlCreate","ctrlDelete","ctrlModel","ctrlSetModel","ctrlSetPosition","ctrlClassName","displayCtrl","ctrlModelScale","ctrlSetModelScale","ctrlModelDirAndUp","ctrlSetModelDirAndUp"],"notes":[],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control - Positioning","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}