Starting from version GooTool 0.9.4, GooTool contains a feature to enable translators to automatically generate in-game images using text from the translation wiki. It's not the most user-friendly thing in the world but it should be useful.
To enable this feature, you must first enable Translator Mode from the Advanced menu.
It requires an input directory in which you put l10n_images.xml along with the source graphics. A zip file containing a sample XML file plus source images is available here.
The translations are automatically downloaded from the wiki every time you click Test or Build, so you can see your wiki changes in real-time.
In test mode, you can choose a background colour to test transparency. You can also turn on debugging. This annotates the image as follows:
- Orange items show the positioning as defined in the XML file.
- Red items show the positioning after any rotation has been applied.
- X markers show fixed positioning anchors.
- Boxes show fit-to-box boundaries.
Test mode does NOT write any images to disk. It only opens a preview window.
In output mode, it will output all the files to the specified directory. NB I do not recommend doing this directly into your World of Goo installation!
Adding new images
You can easily extend it to add more translatable images using the XML file format described below. First make a PNG file of the source image minus all text (Kyle has uploaded source PSD files that will help with many of them). Then add a description of them to the XML file using the format below. If you add definitions for more images, please send me the blank images plus the XML snipped, so I can add them to this master zip file!
When drawing outlined text you should draw the outline first (since it's hollow and the outline stroke goes both inside and outside of the shape outline) and then draw the regular text on top of it in the fill color.
XML file format
The root element is
i18n and contains a list of images to generate in the form of
process-image nodes have a
source, specifying the input PNG in your input directory, and a
dest, specifying the output filename including path but excluding
.png (since the tool will add
.de.png etc. depending on the language).
process-image then contains a list of
Layers can contain other draw/layer instructions, but are processed independently before being written into the target image. The purpose for this is to let you apply a filter to the contents of the layer, without applying that filter to the entire image. If you don't need filters, don't bother with the extra overhead of layers.
The only currently available filter is
gaussian-blur, which blurs the layer that has been created at that point.
draw contains a positioning instruction (either
fit-to-box) and then a number of actual drawing instructions. The only currently available drawing instruction is
text. You can have multiple drawing instructions inside the
draw element, which causes them all to inherit the same positioning.
All coordinates are given relative to the source image, where 0,0 is top left. Note that positioning is done before rotation is applied, so use the debug mode to test boxes.
In the table below, "?" means 0 or 1, "*" means 0 to many, "+" means 1 to many, and no symbol means exactly one.
The best way to understand all this is just to look in the sample l10n_images.xml in the zip above.
|process-image||One particular image to generate||source, dest, draw*, layer*|
|source||The input file||(text)|
|dest||The stem of the output filename||(text)|
|layer||A layer containing other drawing instructions and filters.||draw*, gaussian-blur?|
|gaussian-blur||Applies a Gaussian blur filter to the current layer||
|draw||Something to draw||(fixed-position or fit-to-box), text*|
|fixed-position||Specifies to draw at a fixed position||
|fit-to-box||Specifies to resize drawing to fit within the specified bounding box.||
True: Grow or shrink to fit the box. False: Only shrink if necessary, never grow.
|string||The ID of the string to draw (e.g. IMG_RESULTS_CONTINUE)
If the string has newlines (pipe |), you can reference specific lines using 
e.g. IMG_IMPALESTICKY_HINT (index starts from 1)
|font||The font to draw using||
|color||The color to draw in, in HTML format e.g.
|rotation||An optional rotation value in degrees. Negative is anticlockwise.||(text)|
|arch||Causes the text to arch, as used for chapter intro images. Uses a simple half-sine wave to arch for now..||