The KTuberling Handbook

The KTuberling Handbook

The KTuberling Handbook

Eric Bischoff

Paul E. Ahlquist, Jr.

Reviewer: Lauri Watts

Revision 0.03.01

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

KTuberling is a game intended for small children.


Chapter 1. Introduction

Introduction

Chapter 1. Introduction

KTuberling is a game intended for small children. Of course, it may be suitable for adults who have remained young at heart.

It is a ‘potato editor’. That means that you can drag and drop eyes, mouths, mustache, and other parts of face and goodies onto a potato-like guy. Similarly, you have a penguin on which you can drop other stuff.

There is no winner for the game. The only purpose is to make the funniest faces you can.

There is a museum (like a ‘Madame Tusseau’ gallery) where you can find many funny examples of decorated potatoes and penguins. Of course, you can send your own creations to the programmer, Eric Bischoff, who will include them in the museum if he gets some spare time.

KTuberling can also ‘speak’. It will spell out the name of the objects you drag and drop. It will ‘speak’ in your own language, or English if the sounds for your language do not exist. Currently, KTuberling can ‘speak’ Danish, German, English, French, Dutch, Romanian, Slovenian and Swedish.

KDE Logo
Chapter 2. On screen Fundamentals

On screen Fundamentals

Chapter 2. On screen Fundamentals

Mouse Operation

There are two areas in the main window:

  • “Playground” area, on the left side.

  • “Objects” area, on the right side, where you select Objects to place on your playground.

Main Window

Placing an Object

To drag an object, move the mouse pointer to the ‘objects’ area on the right. Click on the object you want to drag, but do not release the mouse button until you have moved the mouse pointer to the location in the ‘playground’ area where you want to drop the object.

Moving an Object

Once dropped in the ‘playground’ area, an object can be moved. Just click on the object to select it for further drag and drop. When you click on it, it goes on top of other objects that were partially hiding it. This trick is useful for getting the glasses and eyes placed correctly.

Removing an Object

To remove an object that has been dropped in the ‘playground’ area, drag it back from the ‘playground’ area to the ‘objects’ area.

The Tool Bar

The Tool Bar

The Tool Bar

Toolbar

The toolbar provides buttons for the commonly used functions.

Table 2.1. Toolbar Buttons

ButtonNameAction
New Resets the “playground” area. This cleans all parts off the playground so a new decoration may be created.
Open Opens an existing tuberling file from the museum or from other folders.
Save ButtonSave Saves your creation to your home folder, or to some other folder like the museum if you wish. The tuberling is saved to a small file where only the position of objects are saved.
Print ButtonPrint Prints your picture (PostScript® format).
Undo ButtonUndoUndoes last operation.
Redo ButtonRedo Re-does last operation.
KDE Logo
The Menu Items

The Menu Items

The Menu Items

Menu Bar

The File Menu

File Menu
File->New (Ctrl+N)

Clears the “playground” area

File->Open (Ctrl+O)

Opens an existing tuberling file from the museum or from somewhere else if you wish.

File->Save (Ctrl+S)

Saves your creation. The tuberling is saved to a small file where only the position of objects are saved.

File->Save as picture...

Creates a graphics file containing a picture of your tuberling. Available file formats are XPM, JPEG, PNG and BMP.

File->Print (Ctrl+P)

Print your tuberling picture using PostScript® format.

File->Quit (Ctrl+Q)

Quit KTuberling.

The Edit Menu

Edit Menu
Edit->Copy (Ctrl+C)

Copy the “playground” area to the clipboard.

Edit->Undo (Ctrl+Z)

Undo the last “object” placement.

Edit->Redo (Ctrl+Shift+Z)

Re-does the last “object” placement. This menu option is active only if you have previously used Undo.

The Options Menu

Options Menu

Options->Sound

Toggles sound on/off. If artsd is not running, this menu item is disabled. You need to have kdemultimedia installed to be able to hear sounds. KTuberling remembers last setting of this option the next time it starts up.

Options->Potato Guy

Switches to potato playground. KTuberling remembers the last chosen playground the next time it starts up.

Options->Penguin

Switches to penguin playground. KTuberling remembers the last chosen playground the next time it starts up.

The Help Menu

Help Menu
Help->Contents... (F1)

Invokes the KDE Help system starting at the KTuberling help pages. (this document).

Help->What's This? (Shift+F1)

Changes the mouse cursor to a combination arrow and question mark. Clicking on items within KTuberling will open a help window (if one exists for the particular item) explaining the item's function.

Help->Report Bug...

Opens the Bug report dialog where you can report a bug or request a “wishlist” feature.

Help->About KTuberling

This will display version and author information.

Help->About KDE

This displays the KDE version and other basic information.

KDE Logo
KDE Logo
Chapter 3. Technical reference

Technical reference

Chapter 3. Technical reference

Eric Bischoff

Revision 0.02.08

KTuberling offers a gentle and rewarding introduction to KDE customization and programming. The application can be extended. For example, without any coding, new playgrounds 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.

For artists

The size and shape of the playground and the number of objects can be changed. New playgrounds can be added. Only two image files need to be created for each playground: a gameboard and a mask. A maximum of 8 playgrounds is allowed, out of which only 2 are currently used.

Four images are used in KTuberling: potato-game.png, potato-mask.png, penguin-game.png and penguin-mask.png. The standard location for these files is the directory $KDEDIR/share/apps/ktuberling/pics/.

The first type of images, *-game.png holds the playground and the objects that the user selects. This is the graphic that the user sees when playing the game.

The second type of images, *-mask.png, 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). It is mandatory to put the objects at the same position in the gameboard file as in the mask file.

In the same directory, a file named layout.xml. ($KDEDIR/share/apps/ktuberling/pics/layout.xml) tells which images to use and links them to menu entries. It also contains the position parameters of the playground and the objects in the gameboard and in the masks. It finally assigns the sounds to objects and places the objects in groups. It follows standard XML syntax (see details below).

Still in the same directory, a file named layout.i18n ($KDEDIR/share/apps/ktuberling/pics/layout.xml) recapitulates the strings in layout.xml that can be translated:

  • The menu entries that allow to choose the gameboards

  • The names of the categories of objects

  • The names of the sound files. This is a programming trick that permits that the translation teams record someone saying the names of objects in their own languages, and to reference the names of these sound files when they exist.

One directory above, a file named ktuberlingui.rc ($KDEDIR/share/apps/ktuberling/ktuberlingui.rc) is a second XML file describing the menus of KTuberling. It should contain one <action> tag per playground. The symbolic name of the action in this file should be identical to the symbolic name of the action in layout.xml.

Translation

Translation

Translation

Besides the usual .po files mechanism for translating program labels and prompts, the sounds can be localized too.

If the various translators can record their voice to a .wav file, they can store that file to the language-specific subdirectory of the sounds directory. The name of the sound file is then translated in the .po file. For example, if destination language is Italian, translators can record their voice in .wav files located in $KDEDIR/share/apps/ktuberling/sounds/it. Then they can translate file names like en/hat.wav to names like it/cappello.wav.

In a future release, KTuberling will use OGG Vorbis rc3 file format for sounds. At that moment, it will be possible to convert the WAV files to OGG Vorbis rc3 through the following command line:

$ oggenc_rc3 -o sound.ogg sound.wav

Information on how to work with the translation mechanisms in KDE is available in The KDE Translation HOWTO.

KDE Logo
For programmers

For programmers

For programmers

KTuberling isn't really difficult to extend for programmers.

C++ classes

TopLevel

Top-level window and basic program management

ToDraw

Description of one of the graphical “objects” to be drawn

.tuberling files structure

A .tuberling file holds all the necessary data to redraw a tuberling. It can be edited with an ordinary text editor.

The first line holds the number of the playground.

On all other lines, there is one graphical object per line, in the order that is used to draw them. Each line contains 5 numbers: the identifier of the object, and the rectangle where it should be drawn (left, top, right, bottom). The numbers are separated by whitespaces.

KDE Logo
Structure of the layout file (layout.xml)

Structure of the layout file (layout.xml)

Structure of the layout file (layout.xml)

The top-level tag is unique and is named <ktuberling>. It contains several <playground> tags, one per playground.

The <playground> tag has two attributes: gameboard and masks. These attributes give the name of the files holding the pictures. The <playground> tag also contains one <menuitem> tag, one <editablearea> tag, several <category> tags, and several <object> tags.

The <menuitem> tag describes the action identifier of the menu item allowing to select position of the area where you can drop objects, and the label of this menu item. This action identifier should be identical to the one in ktuberlingui.rc.

The <editablearea> tag describes the position of the area where you can drop objects, and the sound associated with it.

The <category> tag describes the position and the label of a text describing a group of objects. For example, it can describe the position and the text of the group of “goodies”.

The <object> tag describes the position (in the gameboard and in the masks) of an object, as well as the English sound associated with it.

The lower level tags are not explained here, since their meaning is quite straightforward. If you modify layout.xml, don't forget to modify layout.i18n and ktuberlingui.rc accordingly.

KDE Logo
KDE Logo
Chapter 4. Credits and License

Credits and License

Chapter 4. Credits and License

KTuberling

This game is dedicated to my little daughter Sunniva Bischoff

Thanks to Apple Computer and to the LinuxPPC™ project for having made ports of Linux® to the Mac®. KTuberling would never have existed without that!

This documentation is licensed under the terms of the GNU Free Documentation License.

This program is licensed under the terms of the GNU General Public License.

KDE Logo
Appendix A. Installation

Installation

Appendix A. Installation

How to obtain ktuberling

KTuberling is part of the KDE project http://www.kde.org/.

KTuberling can be found in the kdegames package on ftp://ftp.kde.org/pub/kde/, the main FTP site of the KDE project.

Requirements

Requirements

Requirements

In order to successfully compile KTuberling, you need KDE 3.0. All required libraries as well as KTuberling itself can be found on ftp://ftp.kde.org/pub/kde/.

To be able to hear the sounds, you need to have kdemultimedia installed.

KDE Logo
Compilation and Installation

Compilation and Installation

Compilation and Installation

In order to compile and install KTuberling on your system, type the following in the base directory of the KTuberling distribution:

% ./configure
% make
% make install

Since KTuberling uses autoconf and automake you should have no trouble compiling it. Should you run into problems please report them to the KDE mailing lists.

KDE Logo
KDE Logo
KDE Logo