Fr:Créer un thème

From X-Moto
Revision as of 13:54, 27 August 2010 by Computerhelp (talk | contribs)
Jump to: navigation, search

Català - Español

Introduction

Depuis X-Moto 0.2.0, il est possible de créer de nouveaux thèmes et d'ajouter de nouveaux sprites/textures/audio façilement. Vous pouvez recréer tous les graphismes du jeu.

Un thème est composé d'un fichier xml et des fichiers d'image et audio. Le fichier xml donne des informations au sujet des thèmes et donne le nom du fichier à utiliser pour chaque élément décrit

Pictures must be squares and their sizes must be a power of 2 (64x64, 128x128, 256x256)
Pictures larger than 50Ko will not be accepted
Pictures must be png or jpg
Pictures must be GPL
Audio files must be ogg or wav files

Créer un nouveau thème

To create a theme, you should start by copying an existing one. If you update your themes in the game, you will found some theme files in the dir Themes in ~/.xmoto (UNIX) or in your home dir in the .xmoto directory (Windows). A theme file looks like this :

<?xml version="1.0" encoding="utf8" ?>
<xmoto_theme name="Classic">
<sprite type="BikerPart" name="PlayerBikerBody"  file="Body1.png" />
<sprite type="BikerPart" name="PlayerBikerFront" file="Front1.png" />
...
<music name="menu1" file="menu.ogg" />
<sound name="Headcrash" file="Headcrash.ogg" />
...
</xmoto_theme>
  • First, copy an existing theme as a new file
  • Open the theme and change the theme name by a new one (replace "Classic" by "My Theme")

Congratulation ! You made your first theme which is simply a copy of an existing one. Now, you can try to modify or add new entries.

Currently, it's not possible to send your new themes via the website ; use the message tab and give your email to contact us if you want to make your theme downloadable by other players.

Entrées du thème

A theme entry is a line that explains to the game where an image for a given sprite can be found. A sprite has a type (BikerPart, Texture, Entity, Effect, Font, Misc, UI); for each type, there may be parameters. Moreover, a sprite has a name and some values to define the path of the picture.

Some sprite names are defined in the game, for example, "PlayerBikerBody" is the name of the sprite of the biker body, but a new sprite can also be defined as textures or entities.

Sprites are found in the Textures dir on a subdirectory depending on the sprite type :

Sprite type Directory
BikerPart Textures/Riders
Texture Textures/Textures
Entity Textures/Sprites (or Textures/Sprites/Anims if it's an animation)
Effect Textures/Effects
Font Textures/Fonts
Misc Textures/Misc
UI Textures/UI

You can also modify music and sound elements and place new audio files into the Textures/Musics and Textures/Sounds directories.

Existing sprites are available at http://xmoto.tuxfamily.org/index.php?page=all_sprites

Modifier une entrée de thème

Just modify the parameters (if you want) and the file parameter : give the name of your new file.

Ajouter une entrée de thème

Copy and paste an existing entry of same sprite type. Change the name parameter, and give a file parameter.

Testez votre thème

Note that with X-Moto 0.3.0, you will have to press F5 in the main menu to make X-Moto recognize the updated theme! Or you could just press F10 to switch to the test theme mode.

TestTheme.jpg