text, scrolltext, markdown
The three ways to display text.
text — regular text (18 properties)
<text name="titre">
<pos>0.06 0.08</pos>
<size>0.5 0.1</size>
<text>${system}</text>
<fontPath>${root}/data/fonts/Exo2.otf</fontPath>
<fontSize>0.05</fontSize>
<color>FFFFFF</color>
<alignment>left</alignment>
<forceUppercase>true</forceUppercase>
</text>
| Property | Type | Role |
|---|---|---|
pos size origin rotation rotationOrigin | pair | placement — see Position, size, origin |
text | text | the content, variables included |
path | path | reads the content from a file, instead of text |
fontPath | path | the font |
fontSize | number | < 1 = screen-height ratio, >= 1 = pixels |
fontStyle | text | normal, bold, italic, bolditalic |
color | color | the text color |
backgroundColor | color | a background behind the text |
alignment | text | see below |
forceUppercase | yes/no | all capitals |
lineSpacing | number | line spacing, 1.2 by default |
multiline | yes/no | allow line breaks |
zIndex | number | depth |
disabled | yes/no | switch the component off |
alignment acts on two axes
The value combines the horizontal and the vertical.
Nine positions, thirteen ways to write them — four values are synonyms:
| Position | To write | Synonym |
|---|---|---|
| top-left | topleft | |
| top-center | topcenter | top |
| top-right | topright | |
| center-left | centerleft | left |
| center | center | |
| center-right | centerright | right |
| bottom-left | bottomleft | |
| bottom-center | bottomcenter | bottom |
| bottom-right | bottomright |
⚠️ An unknown value does not keep the previous alignment: it falls back to center-left, the default value.
The text is aligned within its size box: without size, the alignment has nothing to act on.
scrolltext — scrolling text (16 properties)
Same properties as text, without multiline and lineSpacing. The text scrolls horizontally when it overflows its box.
<scrolltext name="titre-long">
<size>0.4 0.06</size>
<text>${game.name}</text>
<fontSize>0.04</fontSize>
</scrolltext>
To be reserved for values whose length you do not control — a game name, a developer.
markdown — formatted text (15 properties)
<markdown name="synopsis">
<pos>0.06 0.5</pos>
<size>0.4 0.35</size>
<text>${game.synopsis}</text>
<fontSize>0.028</fontSize>
<color>C6CBD8</color>
</markdown>
Same properties as text, without fontStyle, backgroundColor or multiline.
It understands simple formatting in the text: **bold**, *italic*, # heading, dashed lists. Useful for a synopsis or an “about” page.
⚠️
markdowndoes not scroll: a text longer than its box is cut off.