New component to place Tiled map in a viewport

Following the Tiled improvements and optimizations done in January, it was most natural to introduce a dedicated class TCastleTiledMap that represents a Tiled map in a viewport. It descends from TCastleTransform and thus can be moved, rotated, scaled (in 2D or 3D), just like anything else in the viewport.

The usage demo, along with many sample maps, is in examples/tiled/map_viewer_in_viewport.

Most important Tiled-specific API:

The full documentation is in Tiled map manual page.

Many thanks go to Freedomax for implementing animations on Tiled maps and providing a lot of Tiled fixes (seams fix, ForceTilesetSpacing, proper Z-order of tiles in all situations, relative URL fix…) and examples!

2 Likes

Thanks for this nice thing :relieved:
Small question: .tmx file is necessary for work of this new components?
I can’t simply add new “uses”, change my CastleImageTransform to CastleTiledMap and run game, how i see. Program can’t understand my old Url’s with .pdf images.
For now I sets parameters of minimap in special navigation unit from code.

Hm, I do not understand the bit about PDF images :slight_smile: , though I guess you mean PNG :slight_smile:

The Tiled map, as documented on Tiled maps | Manual | Castle Game Engine , requires designing maps in Tiled ( https://www.mapeditor.org/ ). So TCastleTiledMap.URL has to be a TMX file.

This is not (yet) our own (in CGE editor) tile map editor, e.g. like Godot, if this is what you’re looking for. Though I’m thinking about it, and talking with Andrzej Kilijański :slight_smile: But the current TCastleTiledMap focused on just having good internal structure to represent the map, with layers, with proper order etc. I guess at some point we will want to reuse parts of this rendering to render “own” tile map, editable in CGE editor from scratch. But not yet :slight_smile:

Sure, I think this mistake is because I read too much .pdf in recent times :sweat_smile: