CT STRUCTURED TEXT: Difference between revisions
(page overhaul) Tag: Removed redirect |
Lou Montana (talk | contribs) m (Text replacement - "{{Feature|Warning|" to "{{Feature|warning|") |
||
(11 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{CT|intro | {{CT|intro | ||
|macro = CT_STRUCTURED_TEXT | |macro = CT_STRUCTURED_TEXT | ||
|value = 13 | |value = 13 | ||
|description = The Structured Text control can display [[Structured Text]]. This is a separate [[Data Types|data type]] in Arma. | |description = The Structured Text control can display [[Structured Text]]. This is a separate [[:Category: Data Types|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. | 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'' | |||
You ''can'' add the {{hl|Attributes}} subclass to change the default Structured Text attributes of your control, but the {{hl|Attributes}} class and all of its attributes are ''optional'' and do not have to be specified. | |||
|gallery=Image:ControlStructuredText.jpg{{!}}A StructuredText control with some formatting included. | |gallery=Image:ControlStructuredText.jpg{{!}}A StructuredText control with some formatting included. | ||
|commands = | |commands = | ||
Line 24: | Line 26: | ||
shadow = 1; | shadow = 1; | ||
}; | }; | ||
|description=Subclass with options how the text should be rendered. Attributes represent the [[Structured Text]] options. | |description=Subclass with options how the text should be rendered. Attributes represent the [[Structured Text]] options. {{Feature|warning|Attributes ( {{hl|class Attributes}}) are not inherited from an existing [[CT_STRUCTURED_TEXT]] control. While no error is shown, properties of {{hl|class Attributes}} will be set to some default values. Re-define needed properties manually. }} | ||
{{{!}}class="wikitable" border="1" align="left" cellpadding="3" cellspacing="0" {{!}} | {{{!}}class="wikitable" border="1" align="left" cellpadding="3" cellspacing="0" {{!}} | ||
! colspan="4" bgcolor="#bbbbff" {{!}} Optional SubClass Attributes Properties | ! colspan="4" bgcolor="#bbbbff" {{!}} Optional SubClass Attributes Properties | ||
Line 55: | Line 57: | ||
{{!}} '''valign''' | {{!}} '''valign''' | ||
{{!}} string | {{!}} string | ||
{{!}} | {{!}} Vertical align of text. Values can be "top", "middle", "bottom". {{Feature|important|Seems to be broken}} | ||
{{!}} "middle" | {{!}} "middle" | ||
{{!}}- | {{!}}- | ||
{{!}} '''shadow''' | {{!}} '''shadow''' | ||
{{!}} | {{!}} Integer | ||
{{!}} affects the shadow of the text. | {{!}} affects the shadow of the text. | ||
{{!}} 1 (true) | {{!}} 1 (true) | ||
Line 99: | Line 101: | ||
{{CT|examples}} | {{CT|examples}} | ||
=== RscStructuredText === | === RscStructuredText === | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
class RscStructuredText | class RscStructuredText | ||
Line 127: | Line 131: | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Other Examples == | == Other Examples == | ||
The following example uses almost the same code as the controls shown in the example screenshot. | The following example uses almost the same code as the controls shown in the example screenshot. | ||
<syntaxhighlight lang="cpp">class MyRscStructuredText | <syntaxhighlight lang="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"; | |||
}; | |||
};</syntaxhighlight> | }; | ||
</syntaxhighlight> | |||
[[Category: Control Types]] |
Latest revision as of 00:25, 2 February 2024
Control Types / MACRO (TYPE VALUE) | |
---|---|
Text/Image/Video |
CT_STATIC (0) | CT_EDIT (2) | CT_HTML (9) | CT_STRUCTURED_TEXT (13) |
Buttons |
CT_BUTTON (1) | CT_ACTIVETEXT (11) | CT_SHORTCUTBUTTON (16) | CT_CHECKBOX (77) | CT_XBUTTON (41) |
Lists |
CT_COMBO (4) | CT_TOOLBOX (6) | CT_CHECKBOXES (7) | CT_TREE (12) | CT_CONTROLS_TABLE (19) | CT_XCOMBO (44) | CT_LISTBOX (5) | CT_LISTNBOX (102) | CT_LISTNBOX_CHECKABLE (104) | CT_XLISTBOX (45) |
3D Objects |
CT_OBJECT (80) | CT_OBJECT_ZOOM (81) | CT_OBJECT_CONTAINER (82) | CT_OBJECT_CONT_ANIM (83) |
Maps |
CT_MAP (100) | CT_MAP_MAIN (101) |
Meta |
CT_SLIDER (3) | CT_XSLIDER (43) | CT_PROGRESS (8) | CT_CONTROLS_GROUP (15) | CT_WEBBROWSER (106) | CT_EXTENSION (107) |
Menu |
CT_CONTEXT_MENU (14) | CT_MENU (46) | CT_MENU_STRIP (47) |
Unknown |
CT_STATIC_SKEW (10) | CT_HITZONES (17) | CT_VEHICLETOGGLES (18) | CT_XKEYDESC (40) | CT_ANIMATED_TEXTURE (45) | CT_LINEBREAK (98) | CT_USER (99) | CT_ITEMSLOT (103) | CT_VEHICLE_DIRECTION (105) |
Introduction
The Structured Text control can display Structured Text. 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
Related User Interface Eventhandlers
Alphabetical Order
#define CT_STRUCTURED_TEXT 13
A
Attributes
- Type
- Class
- Description
- Subclass with options how the text should be rendered. Attributes represent the Structured Text options.
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". | "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 |
class Attributes
{
font = "RobotoCondensed";
color = "#ffffff";
colorLink = "#D09B43";
align = "left";
shadow = 1;
};
Default Classes
RscStructuredText
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.
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";
};
};