Structured Text: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add ampersand operator, formatting layout)
mNo edit summary
Line 1: Line 1:
=Description:=
== Description ==


Rich text is able to include images and formatting.
Rich text is able to include images and formatting.
Line 19: Line 19:
  hint _txt;
  hint _txt;


=Operators:=
== Operators ==


Insert a line break
=== Line break ===
<code><nowiki><br /></nowiki></code>
<nowiki><br /></nowiki>  


Insert specified image (images can also be inserted via the [[composeText]] and [[image]] commands)
=== Image ===
<code><img image=red.paa/></code>
Images can also be inserted via the [[composeText]] and [[image]] commands
<img image='red.paa' />


Format text between the two tags with the given attributes. Not all attributes need to be specified.
=== Color ===
<code><t size='1.2' color='#ffffff00'> </t></code>
In format [http://en.wikipedia.org/wiki/RGB RGB] or [http://en.wikipedia.org/wiki/ARGB ARGB]
<t color='#ff0000'>Red text</t>
<t color='#99ffffff'>Transparent white text</t>


Insert an ampersand (&) symbol
=== Size ===
<code>&amp;amp;</code>
Default is 1.
<t size='2'> Large text</t>


See [[parseText]] for more operators.
=== Font ===
Font are defined in ''CfgFontFamilies''
<t font='Zeppelin33'>Bold Text</t>
 
=== Align ===
Parameter can be 'left', 'center', 'right'
<t align='center'>Centered Text</t>
 
=== Underline ===
<t underline='true'>Underlined Text</t>
 
=== Shadow ===
Parameter can be '0' (no shadow), '1' (classic shadow, can be colored), '2' outline (always black)
<t shadow='1'>Text with shadow</t>
<t shadow='1' shadowColor='#ff0000'>Text with red Shadow</t>
<t shadow='2'>Text with outline</t>


[[Category: Data Types]]
[[Category: Data Types]]

Revision as of 15:23, 9 March 2011

Description

Rich text is able to include images and formatting.

It can be created using XML like syntax, as seen in parseText.

Introduced with Armed Assault, does not refer to Cold War Crisis or Resistance.

Related commands: parseText, composeText, ctrlSetStructuredText, hintC_structuredText

Code Examples:

_separator1 = parseText "<br />------------------------<br />";

_image = "\ca\ui\textures\aus_flag.paa";

_txt = composeText [image _image,"Heading Text",_separator1,"Content"];

hint _txt;

Operators

Line break

<br /> 

Image

Images can also be inserted via the composeText and image commands

<img image='red.paa' />

Color

In format RGB or ARGB

<t color='#ff0000'>Red text</t>
<t color='#99ffffff'>Transparent white text</t>

Size

Default is 1.

<t size='2'> Large text</t>

Font

Font are defined in CfgFontFamilies

<t font='Zeppelin33'>Bold Text</t>

Align

Parameter can be 'left', 'center', 'right'

<t align='center'>Centered Text</t>

Underline

<t underline='true'>Underlined Text</t>

Shadow

Parameter can be '0' (no shadow), '1' (classic shadow, can be colored), '2' outline (always black)

<t shadow='1'>Text with shadow</t>
<t shadow='1' shadowColor='#ff0000'>Text with red Shadow</t>
<t shadow='2'>Text with outline</t>