Creating New Themes

This section's included in case you'd like to make your own themes for Four-in-a-Row. It assumes you're familiar with basic text editing, graphics software and the command line.

3.1. Imatges

Four-in-a-Row's tile sets contain six tiles of equal size, lined up horizontally. From left to right:

  1. Player One's marble as it appears on the game board
  2. Player Two's marble as it appears on the game board
  3. The game board's background
  4. The top row's background
  5. Player One's marble as it appears on the top row
  6. Player Two's marble as it appears on the top row
Figure 1An example tile set

Tiles three and four will be repeated over the game board and top row unless a full window background image is specified in the theme file.

TIP

PNG format is recommended for tile sets. The first, second, fifth and sixth tiles should contain some transparency if you want the background to show through. The third and fourth tiles should be solid, with no transparency, even if you'll be using a full window background image with your theme.

TIP

Tiles can be square or rectangular, and any size you like. Most of the tile sets that come with Four-in-a-Row use square tiles measuring 50 pixels by 50 pixels.

For a full window background image, there's a bit more work to do. Let's say your tiles measure 50 by 50 pixels each. The game's display measures 7 by 7 tiles, including the top row, so the ideal background image for your tile set measures 350 by 350 pixels.

TIP

Four-in-a-Row will automatically scale the background image if it doesn't match the tile set. This means you can make "large" and "small" versions of your theme, both using the same background image, just by having a large and a small version of your tile set.

So, you now have a tile set and perhaps a background image to go with it. The next step is to put them in the right place.

3.2. Putting It Together

Copy your image(s) into the data directory (~/.local/share/gnect).

If you start Four-in-a-Row from the command line, it'll give you clues about any problems it has with your new theme. If it has none, you'll find your new theme listed the Preferences Dialog.

Have fun!