{"name":"CT STRUCTURED TEXT","title":"CT STRUCTURED TEXT","type":"topic","url":"https://community.bistudio.com/wiki/CT_STRUCTURED_TEXT","revid":352117,"updated":"2024-02-01T23:25:00Z","aliases":[],"markdown":"### Introduction\n\nThe Structured Text control can display Structured Text. This is a separate data type in Arma.\nStructured Text can not only hold some text values, it also can contain some attributes to format the text, as you can see in the example picture below.\n\nYou *can* add the `Attributes` subclass to change the default Structured Text attributes of your control, but the `Attributes` class and all of its attributes are *optional* and do not have to be specified.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Structured Text\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_STRUCTURED_TEXT 13\n```\n\n#### A\n\n##### Attributes\n\n**Type:** Class\n\n**Description**\n\nSubclass with options how the text should be rendered. Attributes represent the Structured Text options.\n\n> [!WARNING]\n> Attributes ( `class Attributes`) are not inherited from an existing CT_STRUCTURED_TEXT control. While no error is shown, properties of `class Attributes` will be set to some default values. Re-define needed properties manually.\n\n| Optional SubClass Attributes Properties |  |  |  |\n|---|---|---|---|\n| Name | Type | Remark | Default Value |\n| **font** | string | fontname to use | \"Zeppelin32\" |\n| **size** | Float | Set the size of the text where 1 is the size value of parent class. | 1 |\n| **color** | string | text color defined in HMTL-like syntax. | \"#ffffff\" |\n| **align** | string | align of text. Values can be \"left\", \"center\" or \"right\" | \"center\" |\n| **valign** | string | Vertical align of text. Values can be \"top\", \"middle\", \"bottom\".<br>> [!IMPORTANT]<br>> Seems to be broken | \"middle\" |\n| **shadow** | Integer | affects the shadow of the text. | 1 (true) |\n| **shadowColor** | string | shadow color defined in HMTL-like syntax. | \"#000000\" |\n| **shadowOffset** |  |  |  |\n| **image** | string |  |  |\n| **underline** |  |  |  |\n| **href** | string |  |  |\n| **linkColor** | string |  |  |\n\n```cpp\nclass Attributes\n{\n    font = \"RobotoCondensed\";\n    color = \"#ffffff\";\n    colorLink = \"#D09B43\";\n    align = \"left\";\n    shadow = 1;\n};\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#### RscStructuredText\n\n```cpp\nclass RscStructuredText\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_STRUCTURED_TEXT;\n    idc = -1;\n    style = ST_LEFT;\n    colorText[] = {1,1,1,1};\n    class Attributes\n    {\n        font = \"RobotoCondensed\";\n        color = \"#ffffff\";\n        colorLink = \"#D09B43\";\n        align = \"left\";\n        shadow = 1;\n    };\n    x = 0;\n    y = 0;\n    h = 0.035;\n    w = 0.1;\n    text = \"\";\n    size = GUI_TEXT_SIZE_MEDIUM;\n    shadow = 1;\n};\n```\n\n### Other Examples\n\nThe following example uses almost the same code as the controls shown in the example screenshot.\n\n```cpp\nclass MyRscStructuredText\n{\n    idc = -1;\n    type = CT_STRUCTURED_TEXT;    // defined constant\n    style = ST_LEFT;                // defined constant\n    colorBackground[] = { 1, 1, 1, 1 };\n    x = 0.1;\n    y = 0.1;\n    w = 0.3;\n    h = 0.1;\n    size = 0.018;\n    text = \"\";\n    class Attributes\n    {\n        font = \"TahomaB\";\n        color = \"#000000\";\n        align = \"center\";\n        valign = \"middle\";\n        shadow = false;\n        shadowColor = \"#ff0000\";\n        size = \"1\";\n    };\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"The Structured Text control can display Structured Text. This is a separate data type in Arma.\nStructured Text can not only hold some text values, it also can contain some attributes to format the text, as you can see in the example picture below.\n\nYou *can* add the `Attributes` subclass to change the default Structured Text attributes of your control, but the `Attributes` class and all of its attributes are *optional* and do not have to be specified."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- Commands: Structured Text"},{"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_STRUCTURED_TEXT 13\n```"},{"heading":"A","level":4,"markdown":""},{"heading":"Attributes","level":5,"markdown":"**Type:** Class\n\n**Description**\n\nSubclass with options how the text should be rendered. Attributes represent the Structured Text options.\n\n> [!WARNING]\n> Attributes ( `class Attributes`) are not inherited from an existing CT_STRUCTURED_TEXT control. While no error is shown, properties of `class Attributes` will be set to some default values. Re-define needed properties manually.\n\n| Optional SubClass Attributes Properties |  |  |  |\n|---|---|---|---|\n| Name | Type | Remark | Default Value |\n| **font** | string | fontname to use | \"Zeppelin32\" |\n| **size** | Float | Set the size of the text where 1 is the size value of parent class. | 1 |\n| **color** | string | text color defined in HMTL-like syntax. | \"#ffffff\" |\n| **align** | string | align of text. Values can be \"left\", \"center\" or \"right\" | \"center\" |\n| **valign** | string | Vertical align of text. Values can be \"top\", \"middle\", \"bottom\".<br>> [!IMPORTANT]<br>> Seems to be broken | \"middle\" |\n| **shadow** | Integer | affects the shadow of the text. | 1 (true) |\n| **shadowColor** | string | shadow color defined in HMTL-like syntax. | \"#000000\" |\n| **shadowOffset** |  |  |  |\n| **image** | string |  |  |\n| **underline** |  |  |  |\n| **href** | string |  |  |\n| **linkColor** | string |  |  |\n\n```cpp\nclass Attributes\n{\n    font = \"RobotoCondensed\";\n    color = \"#ffffff\";\n    colorLink = \"#D09B43\";\n    align = \"left\";\n    shadow = 1;\n};\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":"RscStructuredText","level":4,"markdown":"```cpp\nclass RscStructuredText\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_STRUCTURED_TEXT;\n    idc = -1;\n    style = ST_LEFT;\n    colorText[] = {1,1,1,1};\n    class Attributes\n    {\n        font = \"RobotoCondensed\";\n        color = \"#ffffff\";\n        colorLink = \"#D09B43\";\n        align = \"left\";\n        shadow = 1;\n    };\n    x = 0;\n    y = 0;\n    h = 0.035;\n    w = 0.1;\n    text = \"\";\n    size = GUI_TEXT_SIZE_MEDIUM;\n    shadow = 1;\n};\n```"},{"heading":"Other Examples","level":3,"markdown":"The following example uses almost the same code as the controls shown in the example screenshot.\n\n```cpp\nclass MyRscStructuredText\n{\n    idc = -1;\n    type = CT_STRUCTURED_TEXT;    // defined constant\n    style = ST_LEFT;                // defined constant\n    colorBackground[] = { 1, 1, 1, 1 };\n    x = 0.1;\n    y = 0.1;\n    w = 0.3;\n    h = 0.1;\n    size = 0.018;\n    text = \"\";\n    class Attributes\n    {\n        font = \"TahomaB\";\n        color = \"#000000\";\n        align = \"center\";\n        valign = \"middle\";\n        shadow = false;\n        shadowColor = \"#ff0000\";\n        size = \"1\";\n    };\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}