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:
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!
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 renderx
position is always the isometric position on the most-left tile: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 newGameObject
and sets it toinactive
(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!