PNGCodec

From OpenTTD
Jump to: navigation, search

PNGCodec is a small application to add meta-data to PNG files. This is needed for 32bpp, as each image needs an x_offs and a y_offs. This program makes adding them very simple. Be advised that editing your PNG in any editing program afterwards usually results in the loss of this meta-data.

Usage

Run PNGCodec and you get a help list. For correct workings of 32bpp in OpenTTD you need to set x_offs and y_offs. All other tags are ignored.

About x_offs, y_offs

When OpenTTD draws a sprite, it does this at the top-center of the tile. Most images do not want to have their top-left corner (0,0) there, so you need to indicate the offset from the top-center of the tile to your top-left corner. For instance, a normal flat landscape tile has an x_offs of -31, indicating that the tile should be drawn 31 pixels more to the left then the top-center of the tile.

External links

Personal tools