Making your first theme
The way to go — with the studio, or by hand.
The result is the same: a theme folder. Two ways to get there.
With the studio
- Start from a template. A blank page is the worst starting point. A template comes with its components already in place: you replace them.
- Choose your screen resolutions — HD 16:9, CRT 4:3, vertical screen (TATE). What fits on a wide screen does not fit on a CRT television. Start with one, add the others later.
- Place your components: drag them from the left column, adjust them in the right one.
- Switch systems in View options and look: the most common mistake is a theme tuned on a single machine that breaks everywhere else. Logos do not all have the same shape, names do not all have the same length.
- Export, copy the folder to your machine, try it — see Trying your theme.
Code mode
In between, the studio has one more level: Code, in the Studio level selector at the top of the right column. The left column then shows the theme files — the ones the export will write —, opened on the file of the view on screen; the option files that act on the screen are marked with a dot. The right column becomes an editor:
- what you type is applied to the preview half a second after the last key, and what you do in the preview shows up in the code;
- a click on a component in the preview takes the editor to its block, and the other way round;
- the editor suggests the tags, properties and attributes the component accepts, then the conditions of an
if; - on a number, Alt + ↑ / ↓ moves it by one screen pixel, ten with Shift as well;
- a malformed file is underlined in red and not applied; a tag or attribute Recalbox does not read is underlined in yellow — it ignores it, and so does the studio.
Only view files can be applied for now; the others are read only.
By hand
- Start from an existing theme. Open one, read it: it is the fastest way to understand how things are done. The official Recalbox theme is a good start.
- Create the folder and its
theme.xml— the only mandatory file. See Folders and files. - Announce what you target in the
<theme>tag:compatibilityfor the screen types,resolutionsfor the resolutions. These two attributes light up the pictograms of the theme manager, and announcing them wrong is promising what the theme does not deliver. See The header. - Write your views, one per screen, and split into several files as soon as it grows — see The minimal working theme, then Splitting your theme.
- Serve the other screens with conditions rather than copying everything:
<include if="crt">. - Copy the folder to your machine and try it — and read
themes.logat the first invisible component.
In both cases, the same mistake lies in wait: only checking on YOUR screen and YOUR system.