Themes
Home | Introduction | Installation | Quick start | Troubleshooting | Themes | Script tutorial | Script basics | Script callbacks reference | Script API reference | Known bugs | Frequently Asked Questions

Themes


About themes

What is a theme?

Think of themes as "skins" which can be applied to the game. Technically a theme is a datafile or a directory which contains:

The scripts are *not* contained in the dafafile, so one can use any theme with any set set of rules, since both are indenpendants.

The theme can be chosen in the "Options/Theme" menu. Just move to the theme you want to use with the keyboard arrows and press ENTER.

The "u61" base package contains only one theme, because I try to keep this file as light as possible. However, the "u61-data" contains more themes.

Copyright and artwork

It's very difficult to find artwork which can be GPL'ed. Most of the free resources on the web are available for free as long as one does not make money from them. However this kind of restriction is not compatible with the GPL, so I have created almost everything myself, from scratch. This way *all* the artwork in U61 is available under the terms of the GPL. This means that:

If you want to contribute to U61 by creating new themes, keep in mind that your work must be available under the terms of the GPL. This means that I can not accept themes which use graphics from a proprietary game for instance. So if you want to make a "Diablo 2 theme" you can do it but I won't distribute - and you should not distribute it either since it would be a plain GPL violation, besides being also a copyright infringement of Blizzard's game.

Difference between .dat and .scr themes

As U61 is based on ClanLib, it is able to read the datafiles in 2 different ways:

By default the makefiles in u61-data produce both .dat and .scr versions of all the available themes. Then the install scripts chose to install the default theme as a .dat file and other themes as .scr files, but you are free to change this behavior.

Directory issues

U61 reads datafiles from 2 different directories:


Building new themes

About the makefiles

In the u61-data package, I use an IMHO quite complex makefile system, involving Python scripts which generate makfiles automatically. You might wonder why I did that since with ClanLib's support of .scr files I could have simply copied the source directory into the target install directory? Well, here's the answer:

Therefore, the makefiles in the u61-data package build .scr files from .theme files. The .theme file is the developper file, with references to files in the square or sound directories, and the .scr file is the final file which will be read by U61, and it contains references to files in a directory which is automatically created and contains a copy of all the required files. This way, each theme is stored in a independant directory.

However, if you want to tweak an existing theme, you can simply take the installed .scr and associated directory and start tweaking theme right away without bothering with all this makefile stuff. But keep in mind that if you want your theme to become part of the u61-data package, creating it with the same makefile system I used will make things much easier in the long run.

Getting started

Let's say you want to build a new "foo2" theme from an existing "foo" theme. What you should first to is open the foo.scr file with a text editor, and look what's in it. It is a plain and quite self-explanatory file, so it should not take ages to understand its global structure.

So just copy the existirg foo.scr theme and its associated directory from the builtin theme directory ("/usr/local/share/u61/theme" under Linux or "C:\Program Files\U61\data\builtin\theme" under Windows) to the user theme directory ("~/.u61/theme" under Linux or "C:\Program Files\U61\data\user\theme" under Windows) and when you run U61, you should see the theme foo appear twice in the list of available themes. One is the builtin theme and one is the theme you just copied.

Rename the foo.scr file you have copied to foo2.scr, (only the foo.scr should be renamed for now but not the foo directory, since this freshly copied foo.scr file still has references to a directory which name is foo). Now if you restart u61, foo (the builtin theme) should be available along with foo2 (the one you have just copied/renamed).

You are now ready to tweak foo2.

Naming conventions

All the sections follow some basic naming conventions:

The property section

This section contains integer values which are used to define the size of the theme (640x480, 800x600...) and the position of various items on the screen. All dimensions are given in pixels.

Here is the list of all the values:

The font section

This section contains all the fonts used in the game, plus some special fonts used to display curses and antidotes.

There two kinds of fonts in ClanLib:

Here is the list of all the values:

The sound section

This section contains all the sounds, except the musics.

Here is the list of all the values:

The music section

This section contains all the musics, in .mod, .xm and in a more general manner in any format supported by MikMod.

Here is the list of all the values:

The square section

This section contains all the sprites used for the squares.

You need to provide 16 set of sprites, because there are 2 sizes (small and big) and 8 colors. For instance "small_3" is the set of sprites associated to color 3 used to dislay the squares for network players.

The bitmap files must contain 16 different pictures for each sprite, which will be used to animate the sprite. If you don't want to use the square animation, simply provide a sprite with 16 times the same picture.

Please check ClanLib's documentation to know more about sprites. IMHO a good way to understand how it works is to try and understand how the builtin squares in U61 have been created.

Here is the list of all the values:

The map section

This section contains all the background pictures used for the player's playfield.

Here is the list of all the values:

The back section

This section contains general background pictures.

Here is the list of all the values:

The info section

This section contains the background pictures used for the "info" zone, where the score and other parameters are displayed.

Here is the list of all the values:


This documentation is also available on: www.ufoot.org.
Contact author: ufoot@ufoot.org