{"name":"CT PROGRESS","title":"CT PROGRESS","type":"topic","url":"https://community.bistudio.com/wiki/CT_PROGRESS","revid":259182,"updated":"2021-06-06T13:56:05Z","aliases":["DialogControls-ProgressBar"],"markdown":"### Introduction\n\nSince Arma 2 the progressSetPosition command can be used to change the value.\nSince Arma 3 v1.40 the fill color can be changed via the ctrlSetTextColor command. Prior to Arma 2 there were no means to manipulate a progress bar.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- progressSetPosition\n- progressPosition\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n\n### Alphabetical Order\n\n> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_PROGRESS 8\n```\n\n#### C\n\n##### colorBar\n\n**Type:** Array\n\n**Description:** Color of the filled progress bar.\n\n```cpp\ncolorBar[] = {1,1,1,1};\n```\n\n##### colorFrame\n\n**Type:** Array\n\n**Description:** Color of the surrounding frame.\n\n```cpp\ncolorFrame[] = {0,0,0,0};\n```\n\n#### T\n\n##### texture\n\n**Type:** String\n\n**Description:** Texture of the bar. See Procedural Textures. If *texture* and *colorBar* are provided, both are mixed together, creating a different color.\n\n```cpp\ntexture = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n### Default Classes\n\n> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext.\n\n#### RscExample\n\n```cpp\nclass RscProgress\n{\n    onLoad = \"_this spawn { for '_i' from 0 to 1 step 0.01 do { (_this # 0) progressSetPosition _i; sleep 0.01 } }\";\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_PROGRESS;\n    style = ST_HORIZONTAL;\n    colorFrame[] = {0,0,0,0};\n    colorBar[] =\n    {\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])\"\n    };\n    x = 0.344;\n    y = 0.619;\n    w = 0.313726;\n    h = 0.0261438;\n    shadow = 2;\n    texture = \"#(argb,8,8,3)color(1,1,1,1)\";\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"Since Arma 2 the progressSetPosition command can be used to change the value.\nSince Arma 3 v1.40 the fill color can be changed via the ctrlSetTextColor command. Prior to Arma 2 there were no means to manipulate a progress bar."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- progressSetPosition\n- progressPosition"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General"},{"heading":"Alphabetical Order","level":3,"markdown":"> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_PROGRESS 8\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"colorBar","level":5,"markdown":"**Type:** Array\n\n**Description:** Color of the filled progress bar.\n\n```cpp\ncolorBar[] = {1,1,1,1};\n```"},{"heading":"colorFrame","level":5,"markdown":"**Type:** Array\n\n**Description:** Color of the surrounding frame.\n\n```cpp\ncolorFrame[] = {0,0,0,0};\n```"},{"heading":"T","level":4,"markdown":""},{"heading":"texture","level":5,"markdown":"**Type:** String\n\n**Description:** Texture of the bar. See Procedural Textures. If *texture* and *colorBar* are provided, both are mixed together, creating a different color.\n\n```cpp\ntexture = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"Default Classes","level":3,"markdown":"> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext."},{"heading":"RscExample","level":4,"markdown":"```cpp\nclass RscProgress\n{\n    onLoad = \"_this spawn { for '_i' from 0 to 1 step 0.01 do { (_this # 0) progressSetPosition _i; sleep 0.01 } }\";\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_PROGRESS;\n    style = ST_HORIZONTAL;\n    colorFrame[] = {0,0,0,0};\n    colorBar[] =\n    {\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])\",\n        \"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])\"\n    };\n    x = 0.344;\n    y = 0.619;\n    w = 0.313726;\n    h = 0.0261438;\n    shadow = 2;\n    texture = \"#(argb,8,8,3)color(1,1,1,1)\";\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}