Making a Recalbox theme

45 pages · 8 sections
FRENESDE Show everything Create my theme

Splitting your theme: <include>

A serious theme does not fit in a single file.

<include> loads another file at that exact spot, as if its content were copied there.

<include>${root}/views/system.xml</include>
<include path="${root}/views/detailed.xml" />

Both spellings work: the path as the tag's content, or as a path attribute.

Order matters

Recalbox reads top to bottom, and two components with the same name replace each other: the last one wins.

base.xml background = blue rouge.xml background = red the background is RED read top to bottom: two components with the same name replace each other, the LAST one wins that is the whole overlay mechanism — and therefore the options

That is the whole overlay mechanism — and it is how theme options are built: each choice is a file loaded on top, redefining only what changes. See What an option is.

<include>${root}/views/base.xml</include>       <!-- paints the background blue -->
<include>${root}/options/rouge.xml</include>     <!-- repaints it red -->

Including under a condition

An <include> accepts if=, like a component: the file is only loaded if the condition is true.

<include if="crt">${root}/views/system-crt.xml</include>

That is how you serve a different layout per screen, without duplicating everything else. The list of conditions is in Conditional display.