The Tilemap Bar allows tilemaps in the Tilemap object to be edited from within the layout view. It provides a toolbar with various tools and options, and a view of the current tileset image.
To add a tilemap and start editing it, follow these steps:
- Add a Tilemap object to the layout and make sure it is selected
- Choose the Pencil or Rectangle tool from the Tilemap bar's toolbar
- Select a tile in the tileset showing in the Tilemap bar
- Click inside the Tilemap object to start drawing the selected tile
You can hold shift and right-click a tile to pick that tile to draw with. You can also hold shift and drag the right mouse button over a range of tiles, and the tilemap bar will also select that range of tiles as a patch you can stamp out.
To stop editing the tilemap's tiles and return to normal layout editing, click the mouse cursor on the Tilemap bar's toolbar to restore normal layout view selection. This also allows you to move and resize the entire tilemap object.
If you have multiple tilemap objects, only the selected tilemap is edited. It is often useful to layer tilemap objects directly on top of each other, in which case the tilemap to edit can be most easily selected using the Z Order Bar or hiding/locking layers with the Layers Bar.
If you are dealing with small tiles, you can also right-click on the tilemap and select a zoom level from the menu.
The Tilemap bar's toolbar has the following options:
- Normal layout view selection
- Stop editing tiles and select the Tilemap object like any other object.
- Pencil tile tool
- Draw tiles with the mouse. You can also select an area of tiles by dragging across several tiles in the displayed tileset, and then use this tool to stamp that region of tiles in to the tilemap.
- Rectangle tile tool
- Draw a rectangular area of tiles by clicking and dragging in the tilemap object. You can also select a 3x3 area of tiles in the displayed tileset, and the tool will automatically nine-patch the tiles. This also works for drawing single rows or columns with smaller selections such as 1x3 or 3x1, where the first and last tile are the first and last in the selection, and the rest are the middle tile repeated. Larger selections can also be used, such as 4x4, and the middle tiles will be alternated along the rectangle.
- Erase tile tool
- Erase tiles from the tilemap so they appear as transparent space. Larger areas can be erased by selecting a larger area of tiles in the tileset. A shortcut for erasing single tiles is to right-click while another tool is selected.
- Edit tile collision polygon
- With a single tile in the tileset selected, click this button to edit that tile's collision polygon. Alternatively double-click a tile in the tileset. When testing for collisions with the tilemap object, the collision polygon will be used wherever that tile appears in the tilemap. If a collision polygon has set (and it is not the default bounding box), the collision polygon will be outlined in red while hovering the mouse over that tile in the Tilemap bar.
- Flip placing tile horizontally
- When using the Pencil tool, tiles will be placed flipped horizontally. Alternatively use the X keyboard shortcut. If an area of tiles is selected in the tileset, the entire patch is also flipped.
- Flip placing tile vertically
- When using the Pencil tool, tiles will be placed flipped vertically. Alternatively use the Y keyboard shortcut. If an area of tiles is selected in the tileset, the entire patch is also flipped.
- Rotate placing tile anticlockwise/clockwise
- When using the Pencil tool, click to keep rotating the tiles to be placed. Alternatively use the Z keyboard shortcut. If an area of tiles is selected in the tileset, the entire patch is also rotated.
- Import TMX
- Import a .tmx tilemap as used by Tiled. All the tiles in the object are replaced with tile data from the TMX file. In Construct 2 a Tilemap object represents a single layer of tiles, so if the TMX file has multiple layers you will be asked which layer to import. To import all layers, create a different tilemap object for each layer and import them separately. Optionally the tileset image can also be replaced with the image from the TMX file.
- Export TMX
- Export the current tiles and tileset image in to a .tmx file as used by Tiled. Note that Construct 2 does not support all of Tiled's features, so importing then exporting a TMX may lose some data, such as terrain definitions. Also since in Construct 2 a Tilemap object represents a single layer of tiles, the exported TMX file will also only ever have one layer.
The Tilemap object
For more information on how to use tilemaps, see the manual entry on the Tilemap object.