Technical reference

The KTuberling Handbook
Prev |  | Next

# Chapter 3. Technical reference

KTuberling offers a gentle and rewarding introduction to KDE customization and programming. The application can be extended. For example, without any coding, new vegetable characters can be added by changing the graphics files. By adding appropriate sound files, translators can change the sounds to their native tongue!

If you extend or add to the game please consider sending your additions to the developer Eric Bischoff for inclusion in future releases.

# 3.1. Graphics

The size and shape of the gameboard and the number of objects can be changed. Only two files need to be created: a gameboard and a mask.

Two images are used in KTuberling: "gameboard.xpm" and "masks.xpm". The standard location for these files is the directory $KDE/share/apps/ktuberling/pics/. "gamboard.xpm" holds the gameboard and the objects that the user selects. This is the graphic that the user sees when playing the game.

The second file, "masks.xpm", contains only masks of the objects. The masks are used to delimit the borders of the objects and, in some cases, give the object some transparancy (for example, the spectacles). In the distributed "masks.xpm" the objects are duplicated from "gameboard.xpm". This is an artifact of the original artist's technique. Only the masks, the stencil-like images, in "masks.xpm" are used by the program.

The third file in the directory, "layout.txt". ($KDE/share/apps/ktuberling/pics/layout.txt) contains the position parameters of the objects and the masks. It also assigns the sounds to objects and places the objects in groups. This file is changed to describe the graphic to the program. It contains only decimal integers, separated by whitespace, followed by a comment.

        0   0  240 320          0 Area where objects can be dropped
                     6             Number of texts described here
      241 101  413 115          0 "Eyes" text
      415 123  511 137          1 "Eyebrows" text
      241 179  394 193          2 "Noses" text
      395 179  511 193          3 "Ears" text
      241 259  445 273          4 "Mouths" text
      241 307  511 321          5 "Goodies" text
                        43         Number of objects described here
      242   0  283  32      70   0  111  32      1 Eye #1
      242  34  283  66      70  34  111  66      1 Eye #2
      242  68  283 100      70  68  111 100      1 Eye #3
       :
       :  <---cut--->

  Layout header line.

  This line describes the area of the gameboard where objects are placed (the potato area). The first four numbers are the coordinates of the area: left, top, right, bottom. The fifth number is the index number of the associated sound. The sounds are defined in the source file "categories.h".

  Quantity of group labels

  This, the second line, is the number of group text labels defined in the next section of this file.

  Label positions

  These lines describe the position of the text labeling the groups or categories of objects. The text of the labels can only be changed in the source code ("categories.h"). Only the position of the labels can be changed here.

  Quantity of objects

  This line is the number of objects described in the next section of the file. Adjust this number if you add or remove objects.

  Individual objects

  In this section each of the individual objects are described. The position of the objects in "gameboard.xpm" and the positions of the masks in "masks.xpm". The first four numbers are the coordinates of the object rectangle on the gameboard: left, top, right, bottom. The fifth through eighth are the coordinates of the object's mask, same ordering. The ninth number is the index of the associated sound. Several objects can be associated with the same sound.

Prev | Home | Next
The Menu Items |  | Translation