2012-08-13 18:32:53 +00:00
Themes
======
2013-11-12 23:28:15 +00:00
EmulationStation allows each system to have its own "theme." A theme is a collection of resources defined in an XML document.
2012-08-13 18:32:53 +00:00
2013-11-12 23:28:15 +00:00
Themes are loaded like this:
2012-10-17 18:32:01 +00:00
2013-11-12 23:28:15 +00:00
1. Initialize to default values.
2. If `$HOME/.emulationstation/es_theme_default.xml` exists, load it.
3a. If there is a `theme.xml` present in the root of a system's `path` directory, load it.
3b. IF NOT, If `$HOME/.emulationstation/%SYSTEMNAME%/theme.xml` exists, load it.
2012-08-13 18:32:53 +00:00
Example
=======
```
< theme >
< listPrimaryColor > 0000FF< / listPrimaryColor >
< listSecondaryColor > 00FF00< / listSecondaryColor >
2013-11-12 23:28:15 +00:00
< listFont >
< path > ./../all_themes/font.ttf< / path >
< size > 0.045< / size >
< / listFont >
2013-01-06 20:33:50 +00:00
2013-11-12 23:28:15 +00:00
< descriptionFont >
< path > ./../all_themes/font.ttf< / path >
< size > 0.035< / size >
< / descriptionFont >
2013-01-06 20:33:50 +00:00
2013-11-12 23:28:15 +00:00
< backgroundImage >
2013-01-06 20:33:50 +00:00
< path > ./theme/background.png< / path >
2013-11-12 23:28:15 +00:00
< tile > true< / tile >
< / backgroundImage >
2012-10-01 03:29:55 +00:00
2013-11-12 23:28:15 +00:00
< headerImage >
< path > ./theme/logo.png< / path >
< tile > false< / tile >
< / headerImage >
2012-10-07 22:59:20 +00:00
2013-11-12 23:28:15 +00:00
< scrollSound > ./../all_themes/scrollSound.wav< / scrollSound >
< / theme >
```
2012-10-07 22:59:20 +00:00
2013-11-12 23:28:15 +00:00
Themes must be enclosed in a `<theme>` tag.
2012-10-07 22:59:20 +00:00
2013-11-12 23:28:15 +00:00
All paths automatically expand `./` to the folder containing the theme.xml.
All paths automatically expand `~/` to the home directory ($HOME on Linux, %HOMEPATH% on Windows).
2012-10-10 13:51:48 +00:00
2013-11-12 23:28:15 +00:00
Stuff you can define
====================
2012-10-31 14:46:06 +00:00
Fonts
=====
Fonts are defined like so:
```
2013-11-12 23:28:15 +00:00
< resourceName >
<!-- Path is optional. -->
< path > ./some/path/here.ttf< / path >
<!-- Size is a percentage of screen height. Optional. -->
< size > 0.035< / size >
< / resourceName >
2012-10-31 14:46:06 +00:00
```
2013-11-12 23:28:15 +00:00
`<listFont>` - Default size: 0.045.
`<descriptionFont>` - Default size: 0.035.
2013-03-17 17:16:40 +00:00
2013-11-12 23:28:15 +00:00
Colors
======
2012-10-31 14:46:06 +00:00
2013-11-12 23:28:15 +00:00
Colors are defined in hex, like this:
2012-10-31 14:46:06 +00:00
2013-11-12 23:28:15 +00:00
`<resourceName>00FF00FF</resourceName>`
or
`<resourceName>00FF00</resourceName>`
(without the alpha channel specified - will assume FF)
2012-10-31 14:46:06 +00:00
2013-11-12 23:28:15 +00:00
`<listPrimaryColor>` - Default: 0000FFFF.
`<listSecondaryColor>` - Default: 00FF00FF.
`<listSelectorColor>` - Default: 000000FF.
`<listSelectedColor>` - Default: 00000000.
`<descriptionColor>` - Default: 48474DFF.
2013-09-14 17:32:21 +00:00
2013-11-12 23:28:15 +00:00
Images
======
2012-10-13 18:29:53 +00:00
2013-11-12 23:28:15 +00:00
Images are defined like this:
```
< resourceName >
< path > ./some/path/here.png< / path >
<!-- Can be true or false. -->
< tile > true< / tile >
< / resourceName >
```
Pretty much any image format is supported.
2012-10-13 18:29:53 +00:00
2013-11-12 23:28:15 +00:00
`<backgroundImage>` - No default.
`<headerImage>` - No default.
2013-11-21 20:06:01 +00:00
`<infoBackgroundImage>` - No default.
2012-10-13 20:05:43 +00:00
2013-11-12 23:28:15 +00:00
Sounds
======
2012-10-13 20:05:43 +00:00
2013-11-12 23:28:15 +00:00
Sounds are defined like this:
`<resourceName>./some/path/here.wav</resourceName>`
Only .wav files are supported.
2012-10-13 20:05:43 +00:00
2013-11-12 23:28:15 +00:00
`<scrollSound>` - No default.
`<gameSelectSound>` - No default.
`<backSound>` - No default.
`<menuOpenSound>` - No default.
2012-10-13 18:29:53 +00:00
2013-09-14 17:32:21 +00:00
Nine Patches
============
EmulationStation borrows the concept of "nine patches" from Android (or "9-Slices"). Currently the implementation is very simple and hard-coded to only use 48x48px images (16x16px for each "patch"). Check the `data/resources` directory for some examples (button.png, frame.png).
2012-08-13 18:32:53 +00:00
-Aloshi
http://www.aloshi.com