---
name: "CT STRUCTURED TEXT"
type: topic
source: https://community.bistudio.com/wiki/CT_STRUCTURED_TEXT
revid: 352117
updated: 2024-02-01T23:25:00Z
---

# CT STRUCTURED TEXT

### Introduction

The Structured Text control can display [Structured Text](../topics/Structured_Text.md). This is a separate data type in Arma.
Structured 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.

You *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.

#### Related commands & functions

- Commands: General
- Commands: UI Eventhandlers
- Commands: Structured Text

#### Related User Interface Eventhandlers

- [Events: General](../topics/User_Interface_Event_Handlers.md#generic-events)

### Alphabetical Order

> [!NOTE]
> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found [**here**](../topics/Arma~3A_GUI_Configuration.md#common-properties).

> [!WARNING]
> 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.

```cpp
#define CT_STRUCTURED_TEXT 13
```

#### A

##### Attributes

**Type:** Class

**Description**

Subclass with options how the text should be rendered. Attributes represent the [Structured Text](../topics/Structured_Text.md) options.

> [!WARNING]
> Attributes ( `class Attributes`) are not inherited from an existing [CT_STRUCTURED_TEXT](../topics/CT_STRUCTURED_TEXT.md) control. While no error is shown, properties of `class Attributes` will be set to some default values. Re-define needed properties manually.

| Optional SubClass Attributes Properties |  |  |  |
|---|---|---|---|
| Name | Type | Remark | Default Value |
| **font** | string | fontname to use | "Zeppelin32" |
| **size** | Float | Set the size of the text where 1 is the size value of parent class. | 1 |
| **color** | string | text color defined in HMTL-like syntax. | "#ffffff" |
| **align** | string | align of text. Values can be "left", "center" or "right" | "center" |
| **valign** | string | Vertical align of text. Values can be "top", "middle", "bottom".<br>> [!IMPORTANT]<br>> Seems to be broken | "middle" |
| **shadow** | Integer | affects the shadow of the text. | 1 (true) |
| **shadowColor** | string | shadow color defined in HMTL-like syntax. | "#000000" |
| **shadowOffset** |  |  |  |
| **image** | string |  |  |
| **underline** |  |  |  |
| **href** | string |  |  |
| **linkColor** | string |  |  |

```cpp
class Attributes
{
    font = "RobotoCondensed";
    color = "#ffffff";
    colorLink = "#D09B43";
    align = "left";
    shadow = 1;
};
```

### Default Classes

> [!NOTE]
> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`
>
> ---
>
> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the [import](../topics/import_~28Config~29.md) keyword).
>
> In older versions, use `"Default" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the [description.ext](../topics/Description.ext.md).

#### RscStructuredText

```cpp
class RscStructuredText
{
    deletable = 0;
    fade = 0;
    access = 0;
    type = CT_STRUCTURED_TEXT;
    idc = -1;
    style = ST_LEFT;
    colorText[] = {1,1,1,1};
    class Attributes
    {
        font = "RobotoCondensed";
        color = "#ffffff";
        colorLink = "#D09B43";
        align = "left";
        shadow = 1;
    };
    x = 0;
    y = 0;
    h = 0.035;
    w = 0.1;
    text = "";
    size = GUI_TEXT_SIZE_MEDIUM;
    shadow = 1;
};
```

### Other Examples

The following example uses almost the same code as the controls shown in the example screenshot.

```cpp
class MyRscStructuredText
{
    idc = -1;
    type = CT_STRUCTURED_TEXT;    // defined constant
    style = ST_LEFT;                // defined constant
    colorBackground[] = { 1, 1, 1, 1 };
    x = 0.1;
    y = 0.1;
    w = 0.3;
    h = 0.1;
    size = 0.018;
    text = "";
    class Attributes
    {
        font = "TahomaB";
        color = "#000000";
        align = "center";
        valign = "middle";
        shadow = false;
        shadowColor = "#ff0000";
        size = "1";
    };
};
```

<sub>Source: [BI Community Wiki — CT STRUCTURED TEXT](https://community.bistudio.com/wiki/CT_STRUCTURED_TEXT) (revision 352117).</sub>
