{"name":"CT SHORTCUTBUTTON","title":"CT SHORTCUTBUTTON","type":"topic","url":"https://community.bistudio.com/wiki/CT_SHORTCUTBUTTON","revid":369833,"updated":"2024-10-16T07:26:33Z","aliases":[],"markdown":"### Introduction\n\nA more customizable and modern version of CT_BUTTON that also supports Structured Text and an image with text at the same time (see below).\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n- Events: Button\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_SHORTCUTBUTTON 16\n```\n\n#### A\n\n##### action\n\n**Type:** String\n\n**Description:** SQS code executed when button is clicked.\n\n```cpp\naction = \"if (profilenamespace getvariable ['BIS_fnc_init_recompileEditor',false]) then {[1] call (uinamespace getvariable 'BIS_fnc_recompile')}\";\n```\n\n##### animTextureDefault\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureDefault = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n```\n\n##### animTextureDisabled\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureDisabled = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n```\n\n##### animTextureFocused\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureFocused = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### animTextureNormal\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureNormal = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### animTextureOver\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureOver = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### animTexturePressed\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTexturePressed = \"#(argb,8,8,3)color(1,1,1,1)\";\n```\n\n##### Attributes\n\n**Type:** Class\n\n**Description:** Attributes of the text (Only 'font' has effect). See Structured Text control text attributes.\n\n```cpp\nclass Attributes\n{\n    font = \"PuristaLight\";\n    color = \"#E5E5E5\";\n    align = \"left\";\n    shadow = \"false\";\n};\n```\n\n##### AttributesImage\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass AttributesImage\n{\n    font = \"RobotoCondensed\";\n    color = \"#E5E5E5\";\n    align = \"left\";\n};\n```\n\n##### autoAdjustTexture\n\n**Type:** Boolean\n\n**Description:** Introduced with Arma 3 v2.10. Default: false. When this attribute set to true the texture will be rendered in the following way:\n\n- If the original texture aspect ratio is 2:1 or more (`w >= 2 * h`) and the button aspect ration is 2:1 or more (`w >= 2 * h`), the corners of the texture are preserved (rounded corners would scale but not stretch).\n- In all other cases the texture is stretched to cover the button.\n\n```cpp\nautoAdjustTexture = true;\n```\n\n#### C\n\n##### color\n\n**Type:** Array\n\n**Description:** Text color.\n\n```cpp\ncolor[] = {1,1,1,1};\n```\n\n##### color2\n\n**Type:** Array\n\n**Description:** When hovering over the button the text color changes from color[] to color2[].\n\n```cpp\ncolor2[] = {0.95,0.95,0.95,1};\n```\n\n##### color2Secondary\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolor2Secondary[] = {0,0,0,1};\n```\n\n##### colorBackground2\n\n**Type:** Array\n\n**Description:** When hovering over the button the background color changes from colorBackground[] to colorBackground2[].\n\n```cpp\ncolorBackground2[] = {1,1,1,1};\n```\n\n##### colorBackgroundActive\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorBackgroundActive[] = {\"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])\",\"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])\",\"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])\",1};\n```\n\n##### colorBackgroundFocused\n\n**Type:** Array\n\n**Description:** Color of the background when the control is focused.\n\n```cpp\ncolorBackgroundFocused[] = {1,1,1,1};\n```\n\n##### colorDisabledSecondary\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorDisabledSecondary[] = {1,1,1,0.25};\n```\n\n##### colorFocused\n\n**Type:** Array\n\n**Description:** Text color when the control is focused.\n\n```cpp\ncolorFocused[] = {0,0,0,1};\n```\n\n##### colorFocusedSecondary\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorFocusedSecondary[] = {0,0,0,1};\n```\n\n##### colorSecondary\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSecondary[] = {1,1,1,1};\n```\n\n#### D\n\n##### default\n\n**Type:** Number\n\n**Description:** If set to 1, this control is focused when the GUI is opened.\n\n```cpp\ndefault = 1;\n```\n\n#### F\n\n##### fontSecondary\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nfontSecondary = \"PuristaLight\";\n```\n\n#### H\n\n##### HitZone\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass HitZone\n{\n    left = 0;\n    top = 0;\n    right = 0;\n    bottom = 0;\n};\n```\n\n#### K\n\n##### KeyHints\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass KeyHints\n{\n    class A\n    {\n        key = \"0x00050000 + 0\";\n        hint = \"\";\n    };\n};\n```\n\n#### P\n\n##### period\n\n**Type:** Number\n\n**Description:** Blinking period.\n\n```cpp\nperiod = 1.2;\n```\n\n##### periodFocus\n\n**Type:** Number\n\n**Description:** Blinking period when focused.\n\n```cpp\nperiodFocus = 1.2;\n```\n\n##### periodOver\n\n**Type:** Number\n\n**Description:** Blinking period when mouse is hovering over the button.\n\n```cpp\nperiodOver = 1.2;\n```\n\n#### S\n\n##### ShortcutPos\n\n**Type:** Class\n\n**Description:** Position of the texture used on the button.\n\n```cpp\nclass ShortcutPos\n{\n    left = \"5.25 * (((safezoneW / safezoneH) min 1.2) / 40)\";\n    top = 0;\n    w = \"1 * (((safezoneW / safezoneH) min 1.2) / 40)\";\n    h = \"1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)\";\n};\n```\n\n##### shortcuts\n\n**Type:** Array\n\n**Description:** Key shortcuts. often over-ridden/ignored by engine.\n\n```cpp\nshortcuts[] = {\"0x00050000 + 1\"};\n```\n\n##### shpw\n\n**Type:** Number\n\n**Description:** Typo for **show**. See common attributes.\n\n```cpp\nshpw = 0;\n```\n\n##### sizeExSecondary\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nsizeExSecondary = \"(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)\";\n```\n\n##### soundClick\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundClick[] = {\"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundClick\",0.09,1};\n```\n\n##### soundEnter\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundEnter[] = {\"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundEnter\",0.09,1};\n```\n\n##### soundEscape\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundEscape[] = {\"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundEscape\",0.09,1};\n```\n\n##### soundPush\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundPush[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundPush\",0.09,1};\n```\n\n#### T\n\n##### TextPos\n\n**Type:** Class\n\n**Description:** Position of the text. Useful for aligning with ShortcutPos.\n\n```cpp\nclass TextPos\n{\n    left = 0;\n    top = \"(1*(safezoneH / 40) - (0.028*SafezoneH)) / 2\";\n    right = 0.005;\n    bottom = 0;\n    forceMiddle = true; // Since Arma 3 v2.10, default false. When true, text will be forced in the middle of the button vertically\n};\n```\n\n##### textSecondary\n\n**Type:** String\n\n**Description:** Sets the secondary text of the button.\n\n```cpp\ntextSecondary = \"\";\n```\n\n##### textureNoShortcut\n\n**Type:** String\n\n**Description:** A custom Texture to be displayed alongside text. Position can be set in the ShortcutPos (texture) and TextPos (text) class.\n\n```cpp\ntextureNoShortcut = \"#(argb,8,8,3)color(0,0,0,0)\";\n```\n\n#### U\n\n##### url\n\n**Type:** String\n\n**Description:** Link to open when clicked.\n\n```cpp\nurl = \"https://steamcommunity.com/workshop/browse?appid=107410\";\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#### RscShortcutButton\n\nAn older version of the shortcut button.\n\n```cpp\nclass RscShortcutButton\n{\n    deletable = 0;\n    fade = 0;\n    type = CT_SHORTCUTBUTTON;\n    x = 0.1;\n    y = 0.1;\n    class HitZone\n    {\n        left = 0;\n        top = 0;\n        right = 0;\n        bottom = 0;\n    };\n    class ShortcutPos\n    {\n        left = 0;\n        top = ((GUI_GRID_HAbs / 20) - GUI_TEXT_SIZE_MEDIUM) / 2;\n        w = GUI_TEXT_SIZE_MEDIUM * (3/4);\n        h = GUI_TEXT_SIZE_MEDIUM;\n    };\n    class TextPos\n    {\n        left = GUI_TEXT_SIZE_MEDIUM * (3/4);\n        top = ((GUI_GRID_HAbs / 20) - GUI_TEXT_SIZE_MEDIUM) / 2;\n        right = 0.005;\n        bottom = 0;\n    };\n    shortcuts[] = {};\n    textureNoShortcut = \"#(argb,8,8,3)color(0,0,0,0)\";\n    color[] = {1,1,1,1};\n    colorFocused[] = {1,1,1,1};\n    color2[] = {0.95,0.95,0.95,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorBackground[] =\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        1\n    };\n    colorBackgroundFocused[] =\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        1\n    };\n    colorBackground2[] = {1,1,1,1};\n    soundEnter[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButton\\soundEnter\",\n        0.09,\n        1\n    };\n    soundPush[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButton\\soundPush\",\n        0.09,\n        1\n    };\n    soundClick[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButton\\soundClick\",\n        0.09,\n        1\n    };\n    soundEscape[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButton\\soundEscape\",\n        0.09,\n        1\n    };\n    class Attributes\n    {\n        font = \"RobotoCondensed\";\n        color = \"#E5E5E5\";\n        align = \"left\";\n        shadow = \"true\";\n    };\n    idc = -1;\n    style = ST_LEFT;\n    default = 0;\n    shadow = 1;\n    w = 0.183825;\n    h = (GUI_GRID_HAbs / 20);\n    textSecondary = \"\";\n    colorSecondary[] = {1,1,1,1};\n    colorFocusedSecondary[] = {1,1,1,1};\n    color2Secondary[] = {0.95,0.95,0.95,1};\n    colorDisabledSecondary[] = {1,1,1,0.25};\n    sizeExSecondary = GUI_TEXT_SIZE_MEDIUM;\n    fontSecondary = \"RobotoCondensed\";\n    animTextureDefault = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n    animTextureNormal = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n    animTextureDisabled = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n    animTextureOver = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\over_ca.paa\";\n    animTextureFocused = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\focus_ca.paa\";\n    animTexturePressed = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\down_ca.paa\";\n    periodFocus = 1.2;\n    periodOver = 0.8;\n    period = 0.4;\n    font = \"RobotoCondensed\";\n    size = GUI_TEXT_SIZE_MEDIUM;\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    text = \"\";\n    url = \"\";\n    action = \"\";\n    class AttributesImage\n    {\n        font = \"RobotoCondensed\";\n        color = \"#E5E5E5\";\n        align = \"left\";\n    };\n};\n```\n\n#### RscButtonMenu\n\nThe modern Arma 3 button like the ones in the escape display.\n\n```cpp\nclass RscButtonMenu : RscShortcutButton\n{\n    idc = -1;\n    type = CT_SHORTCUTBUTTON;\n    style = ST_CENTER + ST_FRAME + ST_HUD_BACKGROUND;\n    default = 0;\n    shadow = 0;\n    x = 0;\n    y = 0;\n    w = 0.095589;\n    h = 0.039216;\n    animTextureNormal = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTextureDisabled = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTextureOver = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTextureFocused = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTexturePressed = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTextureDefault = \"#(argb,8,8,3)color(1,1,1,1)\";\n    colorBackground[] = {0,0,0,0.8};\n    colorBackgroundFocused[] = {1,1,1,1};\n    colorBackground2[] = {0.75,0.75,0.75,1};\n    color[] = {1,1,1,1};\n    colorFocused[] = {0,0,0,1};\n    color2[] = {0,0,0,1};\n    colorText[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.25};\n    textSecondary = \"\";\n    colorSecondary[] = {1,1,1,1};\n    colorFocusedSecondary[] = {0,0,0,1};\n    color2Secondary[] = {0,0,0,1};\n    colorDisabledSecondary[] = {1,1,1,0.25};\n    sizeExSecondary = GUI_TEXT_SIZE_MEDIUM;\n    fontSecondary = \"PuristaLight\";\n    period = 1.2;\n    periodFocus = 1.2;\n    periodOver = 1.2;\n    size = GUI_TEXT_SIZE_MEDIUM;\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n    class TextPos\n    {\n        left = 0.25 * GUI_GRID_W;\n        top = (GUI_GRID_H - GUI_TEXT_SIZE_MEDIUM) / 2;\n        right = 0.005;\n        bottom = 0;\n    };\n    class Attributes\n    {\n        font = \"PuristaLight\";\n        color = \"#E5E5E5\";\n        align = \"left\";\n        shadow = \"false\";\n    };\n    class ShortcutPos\n    {\n        left = 5.25 * GUI_GRID_W;\n        top = 0;\n        w = 1 * GUI_GRID_W;\n        h = 1 * GUI_GRID_H;\n    };\n    soundEnter[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundEnter\",\n        0.09,\n        1\n    };\n    soundPush[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundPush\",\n        0.09,\n        1\n    };\n    soundClick[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundClick\",\n        0.09,\n        1\n    };\n    soundEscape[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundEscape\",\n        0.09,\n        1\n    };\n};\n```\n\n### Other examples\n\nThis is an example with an image and text combined in one control.\n\n```cpp\nclass RscButtonMenuSteam : RscButtonMenu\n{\n    text = \"STEAM\";\n    colorBackground[] = {0.03137255,0.72156864,0.91764706,1.0};\n    textureNoShortcut = \"\\A3\\Ui_f\\data\\GUI\\RscCommon\\RscButtonMenuSteam\\steam_ca.paa\";\n    class TextPos\n    {\n        left = 0.0325;\n        top = \"(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2\";\n        right = 0.005;\n        bottom = 0.0;\n    };\n    class ShortcutPos\n    {\n        left = 0.005;\n        top = 0.005;\n        w = 0.0225;\n        h = 0.03;\n    };\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"A more customizable and modern version of CT_BUTTON that also supports Structured Text and an image with text at the same time (see below)."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General\n- Events: Button"},{"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_SHORTCUTBUTTON 16\n```"},{"heading":"A","level":4,"markdown":""},{"heading":"action","level":5,"markdown":"**Type:** String\n\n**Description:** SQS code executed when button is clicked.\n\n```cpp\naction = \"if (profilenamespace getvariable ['BIS_fnc_init_recompileEditor',false]) then {[1] call (uinamespace getvariable 'BIS_fnc_recompile')}\";\n```"},{"heading":"animTextureDefault","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureDefault = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n```"},{"heading":"animTextureDisabled","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureDisabled = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n```"},{"heading":"animTextureFocused","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureFocused = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"animTextureNormal","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureNormal = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"animTextureOver","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTextureOver = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"animTexturePressed","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nanimTexturePressed = \"#(argb,8,8,3)color(1,1,1,1)\";\n```"},{"heading":"Attributes","level":5,"markdown":"**Type:** Class\n\n**Description:** Attributes of the text (Only 'font' has effect). See Structured Text control text attributes.\n\n```cpp\nclass Attributes\n{\n    font = \"PuristaLight\";\n    color = \"#E5E5E5\";\n    align = \"left\";\n    shadow = \"false\";\n};\n```"},{"heading":"AttributesImage","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass AttributesImage\n{\n    font = \"RobotoCondensed\";\n    color = \"#E5E5E5\";\n    align = \"left\";\n};\n```"},{"heading":"autoAdjustTexture","level":5,"markdown":"**Type:** Boolean\n\n**Description:** Introduced with Arma 3 v2.10. Default: false. When this attribute set to true the texture will be rendered in the following way:\n\n- If the original texture aspect ratio is 2:1 or more (`w >= 2 * h`) and the button aspect ration is 2:1 or more (`w >= 2 * h`), the corners of the texture are preserved (rounded corners would scale but not stretch).\n- In all other cases the texture is stretched to cover the button.\n\n```cpp\nautoAdjustTexture = true;\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"color","level":5,"markdown":"**Type:** Array\n\n**Description:** Text color.\n\n```cpp\ncolor[] = {1,1,1,1};\n```"},{"heading":"color2","level":5,"markdown":"**Type:** Array\n\n**Description:** When hovering over the button the text color changes from color[] to color2[].\n\n```cpp\ncolor2[] = {0.95,0.95,0.95,1};\n```"},{"heading":"color2Secondary","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolor2Secondary[] = {0,0,0,1};\n```"},{"heading":"colorBackground2","level":5,"markdown":"**Type:** Array\n\n**Description:** When hovering over the button the background color changes from colorBackground[] to colorBackground2[].\n\n```cpp\ncolorBackground2[] = {1,1,1,1};\n```"},{"heading":"colorBackgroundActive","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorBackgroundActive[] = {\"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])\",\"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])\",\"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])\",1};\n```"},{"heading":"colorBackgroundFocused","level":5,"markdown":"**Type:** Array\n\n**Description:** Color of the background when the control is focused.\n\n```cpp\ncolorBackgroundFocused[] = {1,1,1,1};\n```"},{"heading":"colorDisabledSecondary","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorDisabledSecondary[] = {1,1,1,0.25};\n```"},{"heading":"colorFocused","level":5,"markdown":"**Type:** Array\n\n**Description:** Text color when the control is focused.\n\n```cpp\ncolorFocused[] = {0,0,0,1};\n```"},{"heading":"colorFocusedSecondary","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorFocusedSecondary[] = {0,0,0,1};\n```"},{"heading":"colorSecondary","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorSecondary[] = {1,1,1,1};\n```"},{"heading":"D","level":4,"markdown":""},{"heading":"default","level":5,"markdown":"**Type:** Number\n\n**Description:** If set to 1, this control is focused when the GUI is opened.\n\n```cpp\ndefault = 1;\n```"},{"heading":"F","level":4,"markdown":""},{"heading":"fontSecondary","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nfontSecondary = \"PuristaLight\";\n```"},{"heading":"H","level":4,"markdown":""},{"heading":"HitZone","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass HitZone\n{\n    left = 0;\n    top = 0;\n    right = 0;\n    bottom = 0;\n};\n```"},{"heading":"K","level":4,"markdown":""},{"heading":"KeyHints","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass KeyHints\n{\n    class A\n    {\n        key = \"0x00050000 + 0\";\n        hint = \"\";\n    };\n};\n```"},{"heading":"P","level":4,"markdown":""},{"heading":"period","level":5,"markdown":"**Type:** Number\n\n**Description:** Blinking period.\n\n```cpp\nperiod = 1.2;\n```"},{"heading":"periodFocus","level":5,"markdown":"**Type:** Number\n\n**Description:** Blinking period when focused.\n\n```cpp\nperiodFocus = 1.2;\n```"},{"heading":"periodOver","level":5,"markdown":"**Type:** Number\n\n**Description:** Blinking period when mouse is hovering over the button.\n\n```cpp\nperiodOver = 1.2;\n```"},{"heading":"S","level":4,"markdown":""},{"heading":"ShortcutPos","level":5,"markdown":"**Type:** Class\n\n**Description:** Position of the texture used on the button.\n\n```cpp\nclass ShortcutPos\n{\n    left = \"5.25 * (((safezoneW / safezoneH) min 1.2) / 40)\";\n    top = 0;\n    w = \"1 * (((safezoneW / safezoneH) min 1.2) / 40)\";\n    h = \"1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)\";\n};\n```"},{"heading":"shortcuts","level":5,"markdown":"**Type:** Array\n\n**Description:** Key shortcuts. often over-ridden/ignored by engine.\n\n```cpp\nshortcuts[] = {\"0x00050000 + 1\"};\n```"},{"heading":"shpw","level":5,"markdown":"**Type:** Number\n\n**Description:** Typo for **show**. See common attributes.\n\n```cpp\nshpw = 0;\n```"},{"heading":"sizeExSecondary","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nsizeExSecondary = \"(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)\";\n```"},{"heading":"soundClick","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundClick[] = {\"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundClick\",0.09,1};\n```"},{"heading":"soundEnter","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundEnter[] = {\"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundEnter\",0.09,1};\n```"},{"heading":"soundEscape","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundEscape[] = {\"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundEscape\",0.09,1};\n```"},{"heading":"soundPush","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nsoundPush[] = {\"\\A3\\ui_f\\data\\sound\\RscButton\\soundPush\",0.09,1};\n```"},{"heading":"T","level":4,"markdown":""},{"heading":"TextPos","level":5,"markdown":"**Type:** Class\n\n**Description:** Position of the text. Useful for aligning with ShortcutPos.\n\n```cpp\nclass TextPos\n{\n    left = 0;\n    top = \"(1*(safezoneH / 40) - (0.028*SafezoneH)) / 2\";\n    right = 0.005;\n    bottom = 0;\n    forceMiddle = true; // Since Arma 3 v2.10, default false. When true, text will be forced in the middle of the button vertically\n};\n```"},{"heading":"textSecondary","level":5,"markdown":"**Type:** String\n\n**Description:** Sets the secondary text of the button.\n\n```cpp\ntextSecondary = \"\";\n```"},{"heading":"textureNoShortcut","level":5,"markdown":"**Type:** String\n\n**Description:** A custom Texture to be displayed alongside text. Position can be set in the ShortcutPos (texture) and TextPos (text) class.\n\n```cpp\ntextureNoShortcut = \"#(argb,8,8,3)color(0,0,0,0)\";\n```"},{"heading":"U","level":4,"markdown":""},{"heading":"url","level":5,"markdown":"**Type:** String\n\n**Description:** Link to open when clicked.\n\n```cpp\nurl = \"https://steamcommunity.com/workshop/browse?appid=107410\";\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":"RscShortcutButton","level":4,"markdown":"An older version of the shortcut button.\n\n```cpp\nclass RscShortcutButton\n{\n    deletable = 0;\n    fade = 0;\n    type = CT_SHORTCUTBUTTON;\n    x = 0.1;\n    y = 0.1;\n    class HitZone\n    {\n        left = 0;\n        top = 0;\n        right = 0;\n        bottom = 0;\n    };\n    class ShortcutPos\n    {\n        left = 0;\n        top = ((GUI_GRID_HAbs / 20) - GUI_TEXT_SIZE_MEDIUM) / 2;\n        w = GUI_TEXT_SIZE_MEDIUM * (3/4);\n        h = GUI_TEXT_SIZE_MEDIUM;\n    };\n    class TextPos\n    {\n        left = GUI_TEXT_SIZE_MEDIUM * (3/4);\n        top = ((GUI_GRID_HAbs / 20) - GUI_TEXT_SIZE_MEDIUM) / 2;\n        right = 0.005;\n        bottom = 0;\n    };\n    shortcuts[] = {};\n    textureNoShortcut = \"#(argb,8,8,3)color(0,0,0,0)\";\n    color[] = {1,1,1,1};\n    colorFocused[] = {1,1,1,1};\n    color2[] = {0.95,0.95,0.95,1};\n    colorDisabled[] = {1,1,1,0.25};\n    colorBackground[] =\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        1\n    };\n    colorBackgroundFocused[] =\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        1\n    };\n    colorBackground2[] = {1,1,1,1};\n    soundEnter[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButton\\soundEnter\",\n        0.09,\n        1\n    };\n    soundPush[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButton\\soundPush\",\n        0.09,\n        1\n    };\n    soundClick[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButton\\soundClick\",\n        0.09,\n        1\n    };\n    soundEscape[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButton\\soundEscape\",\n        0.09,\n        1\n    };\n    class Attributes\n    {\n        font = \"RobotoCondensed\";\n        color = \"#E5E5E5\";\n        align = \"left\";\n        shadow = \"true\";\n    };\n    idc = -1;\n    style = ST_LEFT;\n    default = 0;\n    shadow = 1;\n    w = 0.183825;\n    h = (GUI_GRID_HAbs / 20);\n    textSecondary = \"\";\n    colorSecondary[] = {1,1,1,1};\n    colorFocusedSecondary[] = {1,1,1,1};\n    color2Secondary[] = {0.95,0.95,0.95,1};\n    colorDisabledSecondary[] = {1,1,1,0.25};\n    sizeExSecondary = GUI_TEXT_SIZE_MEDIUM;\n    fontSecondary = \"RobotoCondensed\";\n    animTextureDefault = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n    animTextureNormal = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n    animTextureDisabled = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\normal_ca.paa\";\n    animTextureOver = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\over_ca.paa\";\n    animTextureFocused = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\focus_ca.paa\";\n    animTexturePressed = \"\\A3\\ui_f\\data\\GUI\\RscCommon\\RscShortcutButton\\down_ca.paa\";\n    periodFocus = 1.2;\n    periodOver = 0.8;\n    period = 0.4;\n    font = \"RobotoCondensed\";\n    size = GUI_TEXT_SIZE_MEDIUM;\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    text = \"\";\n    url = \"\";\n    action = \"\";\n    class AttributesImage\n    {\n        font = \"RobotoCondensed\";\n        color = \"#E5E5E5\";\n        align = \"left\";\n    };\n};\n```"},{"heading":"RscButtonMenu","level":4,"markdown":"The modern Arma 3 button like the ones in the escape display.\n\n```cpp\nclass RscButtonMenu : RscShortcutButton\n{\n    idc = -1;\n    type = CT_SHORTCUTBUTTON;\n    style = ST_CENTER + ST_FRAME + ST_HUD_BACKGROUND;\n    default = 0;\n    shadow = 0;\n    x = 0;\n    y = 0;\n    w = 0.095589;\n    h = 0.039216;\n    animTextureNormal = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTextureDisabled = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTextureOver = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTextureFocused = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTexturePressed = \"#(argb,8,8,3)color(1,1,1,1)\";\n    animTextureDefault = \"#(argb,8,8,3)color(1,1,1,1)\";\n    colorBackground[] = {0,0,0,0.8};\n    colorBackgroundFocused[] = {1,1,1,1};\n    colorBackground2[] = {0.75,0.75,0.75,1};\n    color[] = {1,1,1,1};\n    colorFocused[] = {0,0,0,1};\n    color2[] = {0,0,0,1};\n    colorText[] = {1,1,1,1};\n    colorDisabled[] = {1,1,1,0.25};\n    textSecondary = \"\";\n    colorSecondary[] = {1,1,1,1};\n    colorFocusedSecondary[] = {0,0,0,1};\n    color2Secondary[] = {0,0,0,1};\n    colorDisabledSecondary[] = {1,1,1,0.25};\n    sizeExSecondary = GUI_TEXT_SIZE_MEDIUM;\n    fontSecondary = \"PuristaLight\";\n    period = 1.2;\n    periodFocus = 1.2;\n    periodOver = 1.2;\n    size = GUI_TEXT_SIZE_MEDIUM;\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n    class TextPos\n    {\n        left = 0.25 * GUI_GRID_W;\n        top = (GUI_GRID_H - GUI_TEXT_SIZE_MEDIUM) / 2;\n        right = 0.005;\n        bottom = 0;\n    };\n    class Attributes\n    {\n        font = \"PuristaLight\";\n        color = \"#E5E5E5\";\n        align = \"left\";\n        shadow = \"false\";\n    };\n    class ShortcutPos\n    {\n        left = 5.25 * GUI_GRID_W;\n        top = 0;\n        w = 1 * GUI_GRID_W;\n        h = 1 * GUI_GRID_H;\n    };\n    soundEnter[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundEnter\",\n        0.09,\n        1\n    };\n    soundPush[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundPush\",\n        0.09,\n        1\n    };\n    soundClick[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundClick\",\n        0.09,\n        1\n    };\n    soundEscape[] =\n    {\n        \"\\A3\\ui_f\\data\\sound\\RscButtonMenu\\soundEscape\",\n        0.09,\n        1\n    };\n};\n```"},{"heading":"Other examples","level":3,"markdown":"This is an example with an image and text combined in one control.\n\n```cpp\nclass RscButtonMenuSteam : RscButtonMenu\n{\n    text = \"STEAM\";\n    colorBackground[] = {0.03137255,0.72156864,0.91764706,1.0};\n    textureNoShortcut = \"\\A3\\Ui_f\\data\\GUI\\RscCommon\\RscButtonMenuSteam\\steam_ca.paa\";\n    class TextPos\n    {\n        left = 0.0325;\n        top = \"(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2\";\n        right = 0.005;\n        bottom = 0.0;\n    };\n    class ShortcutPos\n    {\n        left = 0.005;\n        top = 0.005;\n        w = 0.0225;\n        h = 0.03;\n    };\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}