{"name":"ctrlSetAngle","operator":null,"title":"ctrlSetAngle","type":"command","url":"https://community.bistudio.com/wiki/ctrlSetAngle","revid":376965,"updated":"2026-01-01T05:57:04Z","groups":["GUI Control"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.62"}],"since":{"game":"arma3","name":"Arma 3","version":"1.62"},"arma3_since":"1.62","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"description":"Sets the rotation of a control set as `ST_PICTURE`. Rotation will be done within the control boundaries, so if the X and Y are given off center, the picture may get clipped by the control boundaries.\nOnly requires ctrlCommit when fourth parameter is set to false. Procedural textures filled controls do not rotate. Supported control types:\n- CT_STATIC\n- Arma 3 v2.10 CT_ACTIVETEXT\n\n> [!IMPORTANT]\n> Images that touch borders may \"bleed\" during rotation transformation, to avoid this, make sure the image has a 1px transparent padding.","syntaxes":[{"syntax":"control ctrlSetAngle [angle, centerX, centerY, now]","since":null,"effect":null,"exec":null,"params":[{"name":"control","type":"Control","optional":false,"default":null,"description":"picture control","types":["Control"],"since":null,"text":"control: Control - picture control"},{"name":"angle","type":"Number","optional":false,"default":null,"description":"rotation angle (clockwise)","types":["Number"],"since":null,"text":"angle: Number - rotation angle (clockwise)"},{"name":"centerX","type":"Number in range 0..1","optional":false,"default":null,"description":"rotation center X. Control center is 0.5","types":["Number"],"since":null,"text":"centerX: Number in range 0..1 - rotation center X. Control center is 0.5"},{"name":"centerY","type":"Number in range 0..1","optional":false,"default":null,"description":"rotation center Y. Control center is 0.5","types":["Number"],"since":null,"text":"centerY: Number in range 0..1 - rotation center Y. Control center is 0.5"},{"name":"now","type":"Boolean","optional":true,"default":"true","description":"if false, control will wait for ctrlCommit input for result to apply","types":["Boolean"],"since":"arma3 1.78","text":"now: Boolean - (Optional, default true) if false, control will wait for ctrlCommit input for result to apply"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"control","types":["Control"]},"right":{"text":"[angle, centerX, centerY, now]","types":["Array"]}}],"examples":[{"text":"```sqf\n_control ctrlSetAngle [25, 0.5, 0.5];\n```","code":["_control ctrlSetAngle [25, 0.5, 0.5];"]},{"text":"```sqf\nwith uiNamespace do\n{\n    ctrl = findDisplay 46 ctrlCreate [\"RscPictureKeepAspect\", -1];\n    ctrl ctrlSetPosition [0,0,1,1];\n    ctrl ctrlSetText \"A3\\Missions_F_Exp\\data\\Img\\lobby\\ui_campaign_lobby_background_tablet_radial_left_ca.paa\";\n    ctrl ctrlCommit 0;\n    angle = 0;\n    onEachFrame\n    {\n        with uiNamespace do\n        {\n            if (angle > 359) then { angle = 0 };\n            ctrl ctrlSetAngle [angle, 0.5, 0.5];\n            angle = angle + 1;\n        };\n    };\n};\n```","code":["with uiNamespace do\n{\n\tctrl = findDisplay 46 ctrlCreate [\"RscPictureKeepAspect\", -1];\n\tctrl ctrlSetPosition [0,0,1,1];\n\tctrl ctrlSetText \"A3\\Missions_F_Exp\\data\\Img\\lobby\\ui_campaign_lobby_background_tablet_radial_left_ca.paa\";\n\tctrl ctrlCommit 0;\n\tangle = 0;\n\tonEachFrame\n\t{\n\t\twith uiNamespace do\n\t\t{\n\t\t\tif (angle > 359) then { angle = 0 };\n\t\t\tctrl ctrlSetAngle [angle, 0.5, 0.5];\n\t\t\tangle = angle + 1;\n\t\t};\n\t};\n};"]},{"text":"```sqf\n_control ctrlSetAngle [25, 0.5, 0.5, false];\n_control ctrlCommit 1; // Rotation applies smoothly for 1 second.\n```","code":["_control ctrlSetAngle [25, 0.5, 0.5, false];\n_control ctrlCommit 1; // Rotation applies smoothly for 1 second."]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["ctrlAngle"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control","Introduced with Arma 3 version 1.62","Scripting Commands","Scripting Commands: Local Effect"]}