{"name":"ctrlSetFade","operator":null,"title":"ctrlSetFade","type":"command","url":"https://community.bistudio.com/wiki/ctrlSetFade","revid":369232,"updated":"2024-09-03T10:35:00Z","groups":["GUI Control"],"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":"Sets wanted transparency for control animation. Requires ctrlCommit to commit changes. To hide or show a control instantly, use ctrlShow.\n\n> [!NOTE]\n> If there are multiple (interactable) controls on top of each other but the top-most control is faded using `ctrlSetFade 1`,\n> this control will interfere with other controls that were defined earlier and in the exact same position.\n> To counter that, the faded control **must** be disabled with ctrlEnable.","syntaxes":[{"syntax":"controlName ctrlSetFade fade","since":null,"effect":null,"exec":null,"params":[{"name":"controlName","type":"Control","optional":false,"default":null,"description":null,"types":["Control"],"since":null,"text":"controlName: Control"},{"name":"fade","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"fade: Number"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"controlName","types":["Control"]},"right":{"text":"fade","types":["Number"]}}],"examples":[{"text":"```sqf\n_control ctrlSetFade 1;\n_control ctrlCommit 5;\n```","code":["_control ctrlSetFade 1;\n_control ctrlCommit 5;"]}],"multiplayer":null,"problems":"Despite having `fade = 1;` in a control's config, ctrlFade will still report a fade of 0 - resulting in `ctrlSetFade 0` doing nothing.\n\nTo counter that, first use `ctrlSetFade 1`, then `ctrlCommit 0` to apply it, and only then ctrlSetFade can be used as usual.","aliases":[],"see_also":["ctrlFade","cutFadeOut","ctrlCommit"],"notes":[{"user":"Nelis75733126","date":"2024-04-16T21:10:07Z","text":"in Arma 3 2.17, when `ctrlSetFade` is used on a CtrlToolbox or RscToolbox, it only has effect on the text of it."}],"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","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}