{"name":"ctrlSetFade","title":"ctrlSetFade","type":"command","url":"https://community.bistudio.com/wiki/ctrlSetFade","revid":369232,"updated":"2024-09-03T10:35:00Z","groups":["GUI Control"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","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>\n> this control will interfere with other controls that were defined earlier and in the exact same position.\n>\n> To counter that, the faded control **must** be disabled with ctrlEnable.","syntaxes":[{"syntax":"controlName ctrlSetFade fade","params":[{"name":"controlName","type":"Control","type_expr":"Control"},{"name":"fade","type":"Number","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"controlName"},"right":{"text":"fade"}}],"examples":[{"code":["_control ctrlSetFade 1;\n_control ctrlCommit 5;"]}],"problems":"Despite having `fade = 1;` in a control's config, ctrlFade will still report a fade of 0 - resulting in `ctrlSetFade 0` doing nothing.\nTo counter that, first use `ctrlSetFade 1`, then `ctrlCommit 0` to apply it, and only then ctrlSetFade can be used as usual.","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."}]}