| 1 | # View Tiled map as TCastleTiledMap in TCastleViewport |
| 2 | |
| 3 | Load and view any Tiled map using `TCastleTiledMap` component in `TCastleViewport`. |
| 4 | |
| 5 | ## Screenshot |
| 6 | |
| 7 |  |
| 8 | |
| 9 | ## Features |
| 10 | |
| 11 | You can |
| 12 | |
| 13 | - open any Tiled map (`*.tmx` file), |
| 14 | |
| 15 | - pan the map (drag with left mouse button pressed, this is working thanks to standard `TCastle2DNavigation`), |
| 16 | |
| 17 | - zoom (use mouse wheel, this is working thanks to standard `TCastle2DNavigation`). |
| 18 | |
| 19 | Our `data` subdirectory contains a number of Tiled maps. You can also go ahead and download [Tiled, free map editor](https://www.mapeditor.org/) to edit these maps or create new ones. |
| 20 | |
| 21 | Note about using `TCastleTiledMap` in a viewport: |
| 22 | |
| 23 | - It works most sensible in orthographic view with camera direction along Z. (This is our default 2D camera.) Otherwise the distance in Z between each layer may be visible. |
| 24 | |
| 25 | Using [Castle Game Engine](https://castle-engine.io/). |
| 26 | |
| 27 | ## Building |
| 28 | |
| 29 | Compile by: |
| 30 | |
| 31 | - [CGE editor](https://castle-engine.io/editor). Just use menu items _"Compile"_ or _"Compile And Run"_. |
| 32 | |
| 33 | - Or use [CGE command-line build tool](https://castle-engine.io/build_tool). Run `castle-engine compile` in this directory. |
| 34 | |
| 35 | - Or use [Lazarus](https://www.lazarus-ide.org/). Open in Lazarus `map_viewer_standalone.lpi` file and compile / run from Lazarus. Make sure to first register [CGE Lazarus packages](https://castle-engine.io/lazarus). |
| 36 | |
| 37 | - Or use [Delphi](https://www.embarcadero.com/products/Delphi). Open in Delphi `map_viewer_standalone.dproj` file and compile / run from Delphi. See [CGE and Delphi](https://castle-engine.io/delphi) documentation for details. |