{"name":"CT ACTIVETEXT","title":"CT ACTIVETEXT","type":"topic","url":"https://community.bistudio.com/wiki/CT_ACTIVETEXT","revid":351452,"updated":"2023-12-06T09:57:40Z","aliases":[],"markdown":"### Introduction\n\nThe active text control behaves very similar to buttons. It shows up as regular text with the additional functionality that you can click and select it. The dialog's currently selected Active Text control will be underlined to indicate its status. By default, the first Active Text control is selected. When the mouse cursor hovers over an instance of this control, it will show up in the color defined in the *colorActive* property. It is also possible to show a clickable image instead of text.\n\n> [!NOTE]\n> If you need to show text and an image at the same time you can use CT_SHORTCUTBUTTON.\n\n**Notice:** This control doesn't render the usually common *colorBackground* property and *colorText* is replaced with *color*.\n\n- For Arrowhead, this is not true. The properties are there, and it might be an attempt to standardise, or to account for pictures\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Button (TODO)\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n- Commands: 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_ACTIVETEXT 11\n```\n\n#### A\n\n##### action\n\n**Type:** String\n\n**Description:** **SQS** code to execute when the control is clicked.\n\n> [!IMPORTANT]\n> Use onButtonClick instead.\n\n```cpp\naction = \"[finddisplay 26] call (uinamespace getvariable 'BIS_fnc_help');\";\n```\n\n##### angle\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nangle = 180;\n```\n\n#### B\n\n##### blinkingPeriod\n\n**Type:** Number\n\n**Description:** Makes the text start transparent, go to full opacity and back to full transparent in the amount of time specified.\n\n```cpp\nblinkingPeriod = 1.2;\n```\n\n#### C\n\n##### canDrag\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\ncanDrag = 1;\n```\n\n##### color\n\n**Type:** Array\n\n**Description:** **Replaces *colorText***, standard text and underline color.\n\n```cpp\ncolor[] = {1,1,1,0.7};\n```\n\n##### colorActive\n\n**Type:** Array\n\n**Description:** Text and underline color whenever the mouse hovers over the control.\n\n```cpp\ncolorActive[] = {1,1,1,1};\n```\n\n##### colorBackgroundSelected\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorBackgroundSelected[] = {1,1,1,0.1};\n```\n\n##### colorFocused\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorFocused[] = {0,0,0,0};\n```\n\n##### colorShade\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorShade[] = {1,1,1,1};\n```\n\n#### D\n\n##### default\n\n**Type:** Number\n\n**Description:** Whether or not this control is the dialog's initially selected active text.\n\n```cpp\ndefault = 1;\n```\n\n##### DLCTemplate\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass DLCTemplate\n{\n    class controls\n    {\n        class DlcBg\n        {\n            idc = 101;\n            text = \"\\A3\\Ui_f\\data\\GUI\\Rsc\\RscDisplayInventory\\InventoryStripe_ca.paa\";\n            color[] = {1,1,1,1};\n            x = 0;\n            y = 0;\n            w = 1.8 * GUI_GRID_W;\n            h = 1.8 * GUI_GRID_H;\n        };\n        class DlcIcon\n        {\n            idc = 100;\n            text = \"\";\n            color[] = {1,1,1,1};\n            x = 0 * GUI_GRID_W;\n            y = 0 * GUI_GRID_H;\n            w = 1 * GUI_GRID_W;\n            h = 1 * GUI_GRID_H;\n        };\n    };\n};\n```\n\n#### E\n\n##### enabled\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\nenabled = 0;\n```\n\n#### P\n\n##### picture\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\npicture = \"a3\\ui_f\\data\\gui\\rsc\\rscdisplaymultiplayersetup\\flag_opfor_empty_ca.paa\";\n```\n\n##### pictureHeight\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\npictureHeight = 1;\n```\n\n##### pictureWidth\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\npictureWidth = 1;\n```\n\n#### S\n\n##### shortcuts\n\n**Type:** Array\n\n**Description:** n/a\n\n```cpp\nshortcuts[] = {\"512 + 0x11\"};\n```\n\n##### sideDisabled\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nsideDisabled = \"a3\\ui_f\\data\\gui\\rsc\\rscdisplaymultiplayersetup\\flag_none_ca.paa\";\n```\n\n##### sideToggle\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\nsideToggle = \"a3\\ui_f\\data\\gui\\rsc\\rscdisplaymultiplayersetup\\flag_opfor_ca.paa\";\n```\n\n##### soundClick\n\n**Type:** Array\n\n**Description:** The sound to play, when the button is being released.\n\n```cpp\nsoundClick[] = {\"\",0.1,1};\n```\n\n##### soundDoubleClick\n\n**Type:** Array\n\n**Description:** The sound to play, when the cursor enters the button's bounds.\n\n```cpp\nsoundDoubleClick[] = {\"\",0.1,1};\n```\n\n##### soundEnter\n\n**Type:** Array\n\n**Description:** The sound to play, when the cursor enters the button's bounds.\n\n```cpp\nsoundEnter[] = {\"\",0.1,1};\n```\n\n##### soundEscape\n\n**Type:** Array\n\n**Description:** The sound to play, when the button has been pushed and the mouse button is released when not over the control.\n\n```cpp\nsoundEscape[] = {\"\",0.1,1};\n```\n\n##### soundPush\n\n**Type:** Array\n\n**Description:** The sound to play, when the button has been pushed.\n\n```cpp\nsoundPush[] = {\"\",0.1,1};\n```\n\n#### T\n\n##### textHeight\n\n**Type:** Number\n\n**Description:** n/a\n\n```cpp\ntextHeight = 0.38;\n```\n\n##### textMuted\n\n**Type:** String\n\n**Description:** n/a\n\n```cpp\ntextMuted = \"\\A3\\Ui_f\\Data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n```\n\n#### U\n\n##### url\n\n**Type:** String\n\n**Description:** Link to open when control is pressed.\n\n```cpp\nurl = \"\";\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#### RscActiveText\n\n```cpp\nclass RscActiveText\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_ACTIVETEXT;\n    style = ST_CENTER;\n    color[] = {0,0,0,1};\n    colorActive[] = {0.3,0.4,0,1};\n    colorDisabled[] = {1,1,1,0.25};\n    soundEnter[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    soundPush[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    soundClick[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    soundEscape[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    text = \"\";\n    default = 0;\n    idc = -1;\n    x = 0;\n    y = 0;\n    h = 0.035;\n    w = 0.035;\n    font = \"RobotoCondensed\";\n    shadow = 2;\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    url = \"\";\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n};\n```\n\n#### RscActivePicture\n\n```cpp\nclass RscActivePicture : RscActiveText\n{\n    style = ST_MULTI + ST_TITLE_BAR;\n    color[] = {1,1,1,0.5};\n    colorActive[] = {1,1,1,1};\n};\n```\n\n#### RscActivePictureKeepAspect\n\n```cpp\nclass RscActivePictureKeepAspect : RscActivePicture\n{\n    style = ST_MULTI + ST_TITLE_BAR + ST_KEEP_ASPECT_RATIO;\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"The active text control behaves very similar to buttons. It shows up as regular text with the additional functionality that you can click and select it. The dialog's currently selected Active Text control will be underlined to indicate its status. By default, the first Active Text control is selected. When the mouse cursor hovers over an instance of this control, it will show up in the color defined in the *colorActive* property. It is also possible to show a clickable image instead of text.\n\n> [!NOTE]\n> If you need to show text and an image at the same time you can use CT_SHORTCUTBUTTON.\n\n**Notice:** This control doesn't render the usually common *colorBackground* property and *colorText* is replaced with *color*.\n\n- For Arrowhead, this is not true. The properties are there, and it might be an attempt to standardise, or to account for pictures"},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Button (TODO)"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General\n- Commands: 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_ACTIVETEXT 11\n```"},{"heading":"A","level":4,"markdown":""},{"heading":"action","level":5,"markdown":"**Type:** String\n\n**Description:** **SQS** code to execute when the control is clicked.\n\n> [!IMPORTANT]\n> Use onButtonClick instead.\n\n```cpp\naction = \"[finddisplay 26] call (uinamespace getvariable 'BIS_fnc_help');\";\n```"},{"heading":"angle","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nangle = 180;\n```"},{"heading":"B","level":4,"markdown":""},{"heading":"blinkingPeriod","level":5,"markdown":"**Type:** Number\n\n**Description:** Makes the text start transparent, go to full opacity and back to full transparent in the amount of time specified.\n\n```cpp\nblinkingPeriod = 1.2;\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"canDrag","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\ncanDrag = 1;\n```"},{"heading":"color","level":5,"markdown":"**Type:** Array\n\n**Description:** **Replaces *colorText***, standard text and underline color.\n\n```cpp\ncolor[] = {1,1,1,0.7};\n```"},{"heading":"colorActive","level":5,"markdown":"**Type:** Array\n\n**Description:** Text and underline color whenever the mouse hovers over the control.\n\n```cpp\ncolorActive[] = {1,1,1,1};\n```"},{"heading":"colorBackgroundSelected","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorBackgroundSelected[] = {1,1,1,0.1};\n```"},{"heading":"colorFocused","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorFocused[] = {0,0,0,0};\n```"},{"heading":"colorShade","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\ncolorShade[] = {1,1,1,1};\n```"},{"heading":"D","level":4,"markdown":""},{"heading":"default","level":5,"markdown":"**Type:** Number\n\n**Description:** Whether or not this control is the dialog's initially selected active text.\n\n```cpp\ndefault = 1;\n```"},{"heading":"DLCTemplate","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass DLCTemplate\n{\n    class controls\n    {\n        class DlcBg\n        {\n            idc = 101;\n            text = \"\\A3\\Ui_f\\data\\GUI\\Rsc\\RscDisplayInventory\\InventoryStripe_ca.paa\";\n            color[] = {1,1,1,1};\n            x = 0;\n            y = 0;\n            w = 1.8 * GUI_GRID_W;\n            h = 1.8 * GUI_GRID_H;\n        };\n        class DlcIcon\n        {\n            idc = 100;\n            text = \"\";\n            color[] = {1,1,1,1};\n            x = 0 * GUI_GRID_W;\n            y = 0 * GUI_GRID_H;\n            w = 1 * GUI_GRID_W;\n            h = 1 * GUI_GRID_H;\n        };\n    };\n};\n```"},{"heading":"E","level":4,"markdown":""},{"heading":"enabled","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\nenabled = 0;\n```"},{"heading":"P","level":4,"markdown":""},{"heading":"picture","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\npicture = \"a3\\ui_f\\data\\gui\\rsc\\rscdisplaymultiplayersetup\\flag_opfor_empty_ca.paa\";\n```"},{"heading":"pictureHeight","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\npictureHeight = 1;\n```"},{"heading":"pictureWidth","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\npictureWidth = 1;\n```"},{"heading":"S","level":4,"markdown":""},{"heading":"shortcuts","level":5,"markdown":"**Type:** Array\n\n**Description:** n/a\n\n```cpp\nshortcuts[] = {\"512 + 0x11\"};\n```"},{"heading":"sideDisabled","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nsideDisabled = \"a3\\ui_f\\data\\gui\\rsc\\rscdisplaymultiplayersetup\\flag_none_ca.paa\";\n```"},{"heading":"sideToggle","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\nsideToggle = \"a3\\ui_f\\data\\gui\\rsc\\rscdisplaymultiplayersetup\\flag_opfor_ca.paa\";\n```"},{"heading":"soundClick","level":5,"markdown":"**Type:** Array\n\n**Description:** The sound to play, when the button is being released.\n\n```cpp\nsoundClick[] = {\"\",0.1,1};\n```"},{"heading":"soundDoubleClick","level":5,"markdown":"**Type:** Array\n\n**Description:** The sound to play, when the cursor enters the button's bounds.\n\n```cpp\nsoundDoubleClick[] = {\"\",0.1,1};\n```"},{"heading":"soundEnter","level":5,"markdown":"**Type:** Array\n\n**Description:** The sound to play, when the cursor enters the button's bounds.\n\n```cpp\nsoundEnter[] = {\"\",0.1,1};\n```"},{"heading":"soundEscape","level":5,"markdown":"**Type:** Array\n\n**Description:** The sound to play, when the button has been pushed and the mouse button is released when not over the control.\n\n```cpp\nsoundEscape[] = {\"\",0.1,1};\n```"},{"heading":"soundPush","level":5,"markdown":"**Type:** Array\n\n**Description:** The sound to play, when the button has been pushed.\n\n```cpp\nsoundPush[] = {\"\",0.1,1};\n```"},{"heading":"T","level":4,"markdown":""},{"heading":"textHeight","level":5,"markdown":"**Type:** Number\n\n**Description:** n/a\n\n```cpp\ntextHeight = 0.38;\n```"},{"heading":"textMuted","level":5,"markdown":"**Type:** String\n\n**Description:** n/a\n\n```cpp\ntextMuted = \"\\A3\\Ui_f\\Data\\IGUI\\RscIngameUI\\RscDisplayChannel\\MuteVON_crossed_ca.paa\";\n```"},{"heading":"U","level":4,"markdown":""},{"heading":"url","level":5,"markdown":"**Type:** String\n\n**Description:** Link to open when control is pressed.\n\n```cpp\nurl = \"\";\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":"RscActiveText","level":4,"markdown":"```cpp\nclass RscActiveText\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_ACTIVETEXT;\n    style = ST_CENTER;\n    color[] = {0,0,0,1};\n    colorActive[] = {0.3,0.4,0,1};\n    colorDisabled[] = {1,1,1,0.25};\n    soundEnter[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    soundPush[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    soundClick[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    soundEscape[] =\n    {\n        \"\",\n        0.1,\n        1\n    };\n    text = \"\";\n    default = 0;\n    idc = -1;\n    x = 0;\n    y = 0;\n    h = 0.035;\n    w = 0.035;\n    font = \"RobotoCondensed\";\n    shadow = 2;\n    sizeEx = GUI_TEXT_SIZE_MEDIUM;\n    url = \"\";\n    tooltipColorText[] = {1,1,1,1};\n    tooltipColorBox[] = {1,1,1,1};\n    tooltipColorShade[] = {0,0,0,0.65};\n};\n```"},{"heading":"RscActivePicture","level":4,"markdown":"```cpp\nclass RscActivePicture : RscActiveText\n{\n    style = ST_MULTI + ST_TITLE_BAR;\n    color[] = {1,1,1,0.5};\n    colorActive[] = {1,1,1,1};\n};\n```"},{"heading":"RscActivePictureKeepAspect","level":4,"markdown":"```cpp\nclass RscActivePictureKeepAspect : RscActivePicture\n{\n    style = ST_MULTI + ST_TITLE_BAR + ST_KEEP_ASPECT_RATIO;\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}