-
Notifications
You must be signed in to change notification settings - Fork 41
Tile Set Definitions
Tile set definitions are stored in the mods/[mod-name]/tilesetdefs/ folder.
There are four types of lines which look like this:
# cave/mines tile set
img=tileset_cave.png
transparency=255,0,255
tile=16,0,0,64,32,32,16
Comments begin with a # symbol. These should be on a line by themselves.
img refers to a tile set image. All the tiles for a single tile set are packed into one image. A tilesetdef file should only have one img entry. The path of this file is assumed to be mods/[mod-name]/images/tilesets/
transparency notifies the engine that this RGB color is the transparency color key. If omitted, the engine assumes by default that the tile set has alpha transparency (or no transparency).
tile specifies where one tile is on the image. The data is as follows:
tile=[index],[left_x],[top_y],[width],[height],[offset_x],[offset_y]
- index is the unique (to this tile set) integer index for this tile. This index is used in map layers (background and object). Indexes from 1 through 1023 are allowed (0 is reserved for "empty").
- (left_x,top_y) are the top-left coordinates of the tile.
- (width,height) are the dimensions of the tile.
- (offset_x,offset_y) describes the drawing offset of the tile, relative to (left_x,top_y). These can be negative. The offset point of the tile matches the exact center point of the grid square. E.g. in a typical 64x32 isometric tile, the offset is 32,16.
Tile sets are specified in the headers of map files. Example:
tileset=tileset_cave.txt
At some point we'll introduce animated tiles. For each tile index we'll have a way to specify multiple tile-image locations on the image, along with the animation speed.