Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm parsing Tiled maps (.tmx) for my game, and even after reading the documentation, I don't understand what the difference is between the attributes tilewidth and tileheight of the map element versus the attributes of the same name in the tileset element. They are often the same; an example where they differ is the map _isometric_grass_and_water.tmx_ from Tiled's examples folder:

<map version="1.0" orientation="isometric" width="25" height="25" tilewidth="64" tileheight="32">
<tileset firstgid="1" name="isometric_grass_and_water" tilewidth="64" tileheight="64">

Also, there's this child element of tileset whose purpose I don't understand:

    <tileoffset x="0" y="16"/>

Do those distinct values exist for isometric maps? If anyone could shed some light on this, my hurty brain'd be very thankful.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The map is a grid, where the spacing of the grid is specified as the map.tilewidth and map.tileheight.

Now tiles can be bigger (also smalller, but that doesn't make much sense) than the grid spacing. If the map has a tilesize of 64x64 for example there could be tiles with a size of 128x128 or 64x128. This is useful when you want to overlap the tiles. If no offset is specified these will be drawn from the bottom left corner, this is fine for rectangular tilemaps, but for isometric tiles you are often required to apply a offset.

share|improve this answer
    
Thank you for this concise explanation! –  waldrumpus Aug 27 '12 at 7:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.