Making a Recalbox theme

49 pages · 8 sections
⌕
FRENESDE Show everything Create my theme

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>
PropertyTypeRole
pos size origin rotation rotationOriginpairplacement — see Position, size, origin
texttextthe content, variables included
pathpathreads the content from a file, instead of text
fontPathpaththe font
fontSizenumber< 1 = ratio of the smaller side of the screen, >= 1 = 240p size — see Ratio, percentage or pixels
fontStyletextnormal, bold, italic, bolditalic
colorcolorthe text color
backgroundColorcolora background behind the text
alignmenttextsee below
forceUppercaseyes/noall capitals
lineSpacingnumberline spacing, 1.5 by default — the step between two lines is lineSpacing × 0.8 × the height of a line
multilineyes/noallow line breaks
zIndexnumberdepth
disabledyes/noswitch 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:

PositionTo writeSynonym
top-lefttopleft
top-centertopcentertop
top-righttopright
center-leftcenterleftleft
centercenter
center-rightcenterrightright
bottom-leftbottomleft
bottom-centerbottomcenterbottom
bottom-rightbottomright

⚠️ An unknown value does not keep the previous alignment: it falls back to center-left, the default value.

toplefttopcenter= toptoprightcenterleft= leftcentercenterright= rightbottomleftbottomcenter= bottombottomrightthe text sits inside its `size` box — without size, alignment has nothing to act on

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. lineSpacing defaults to 1.1, and the space added between two lines is lineSpacing − 1 times the height of a line. Useful for a synopsis or an “about” page.

A text taller than its box scrolls on its own: it goes down, pauses at the bottom, then returns to the start. Scrolling calls for an alignment set to the top or the bottom — centred vertically, the text stays still.

Styling inside a line

What you writeWhat you get
**bold**bold
*italic* or _italic_italic
***bold italic***bold and italic
__underlined__underlined
___italic underlined___italic and underlined
~~struck~~struck-through text

A word between backticks switches to a fixed-pitch font:

Run `retroarch` to play.

The fixed-pitch font keeps the Recalbox typeface: fontPath does not apply to it.

A marker you do not close is shown as is. A backslash cancels the marker that follows it: \* shows a star. Between backticks, everything is literal.

Headings

One to four hashes followed by a space. Each level has its own size, and a heading is always bold. Beyond four hashes, the heading stays at the fourth level. You may close it with hashes, leaving a space before them.

# Level 1
## Level 2
### Level 3
#### Level 4
# Closed #

The first two levels can also be written under the text: a line of = for level 1, a line of - for level 2.

Level 1
=======

Level 2
-------

Lists

What you writeWhat you get
- itema bullet
+ itema bullet
* itema bullet
1. itema bullet — Recalbox draws the bullet, never the number

The dash, the plus and the star are followed by a space or a tab; the dot of a number, by a space. A line that is too long wraps aligned under the text, not under the bullet. There is only one level: a list inside a list does not exist.

The separator line

A line of - or = after an empty line draws a rule across the full width.

The first paragraph.

---

The second one.

Lines and sizes

Every line of the text is a line on screen. An empty line adds a gap, and several empty lines in a row count as one.

fontSize gives the size of the running text; headings and the fixed pitch follow from it.

LevelSize
#fontSize × 2.83
##fontSize × 2.17
###fontSize × 1.5
####fontSize × 1.17
running textfontSize
fixed pitchfontSize × 0.7

Without fontSize, the running text is 0.030.

Links and images are not part of the formatting.