braingdx icon indicating copy to clipboard operation
braingdx copied to clipboard

Isometric TiledMap integration 🗺

Open bitbrain opened this issue 8 years ago • 1 comments

As explained in https://github.com/libgdx/libgdx/wiki/Tile-maps we need Isometric tmx integration. braingdx already integrates with Orthogonal tiled maps.

The new renderer implementation

Instead of rendering every layer onto each other, we gonna create n textures, which are rendered per diagonal row. This also works for uneven sizes since we're extending the texture (in an extreme case) to a total width. The render x position is always the isometric position on the most-left tile:

rendering

NOTE: This renderer does not care about roofs etc for now. It simply backs a single texture per diagonal row!

This renderer furthermore re-uses textures if they're exactly the same. It calculates a string according to its contents to use it as a row-id. If a row would require the exact same texture, use the existing texture instead. Also this renderer creates for every row a new GameObject and sets it to inactive (so it doesn't get considered as an actual gameplay object`. Assign renderers for every game object.

NOTE: the texture backing must consider offsets as well. It should back textures according to contents on a cell including offsets!

bitbrain avatar May 24 '17 13:05 bitbrain

@gterminator this will be the new isometric TiledMap rendering we'll be using in future. It allows us to have proper rendering including z-indexing. 👍

bitbrain avatar Jun 01 '17 09:06 bitbrain