{"name":"ctrlCommit","title":"ctrlCommit","type":"command","url":"https://community.bistudio.com/wiki/ctrlCommit","revid":369237,"updated":"2024-09-03T10:35:01Z","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":"Commits control animation to last specified duration.\n\n> [!IMPORTANT]\n> The duration of the animation is not guaranteed to be exactly the same as the given time.","syntaxes":[{"syntax":"control ctrlCommit time","params":[{"name":"control","type":"Control","description":"control to animate","type_expr":"Control"},{"name":"time","type":"Number","description":"animation duration","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"control"},"right":{"text":"time"}}],"examples":[{"code":["_control ctrlCommit 2; // make animation last approx. 2 seconds"]}],"see_also":["ctrlCommitted","ctrlSetPosition","ctrlSetFade"],"notes":[{"user":"Nelis75733126","date":"2015-04-11T23:06:00Z","text":"**2024-04-16 edit:**:\n`ctrlCommit` is required to apply the effect of, for example, ctrlSetFade."},{"user":"Demellion","date":"2017-08-28T11:33:00Z","text":"The resulting speed might not to be exactly what ctrlCommit commands it to be. It seems to be dependent on your current framerate. Example:\n\n```sqf\n_ctrl ctrlSetFade 0.5;\n_ctrl ctrlCommit 1;\n```\n\nWill actually result in:\n\n| FPS | Duration |\n|---|---|\n| 60+ | ~1.0s |\n| ~30 | ~1.2s |\n| 10- | ~5-10s |\n\nThis phenomenon probably occurs because of engine time simulation disruption caused by performance damage."}]}