Skip to main content

Layers and roles

Maps are built from layers stacked on top of each other: ground at the bottom, then paths, trees and decoration, with objects such as spawn points on their own layers. Each layer also has a role that tells the engine what it means, such as Collision for solid ground. This page covers tile and object layers, managing layers in the Tile Map panel, the roles and what each does, and how layers are drawn with the rest of the scene.

The Layers section of the Tile Map panel lists the map's layers from top to bottom, in the order they are drawn over each other. Each row shows:

  • A grip to drag the layer to another place in the stack.
  • The role icon. Click it to change the role.
  • The name, and below it the role and what the layer holds: Collision · 462 tiles, or Object · 31 objects.
  • The eye, to show or hide the layer, and the lock, to stop it from being changed.

The selected layer is the one the tools paint on. Click a row to select it.

Lantern Grove's map: one collision layer and four decoration layers.

Tile layers and object layers​

KindHoldsPainted with
Tile layerOne tile per cell, each with its own rotation and flipThe painting tools
Object layerPoints, polygons and placed tile images, each with a name, a type and propertiesThe Objects tool. See Collision and map objects.

Keep things that change together on their own layer. Painting on a Paths layer above Ground never destroys the ground beneath, and you can hide the paths to check the terrain.

Manage layers​

DoHow
Add a tile layerThe + button (New tile layer). It is named Tiles and placed above the selected layer.
Add an object layerThe pin button (New object layer), named Objects
RenameDouble-click the name, or press F2. Enter confirms, Escape cancels.
ReorderDrag the grip, or use the arrows under the list (Move up, Move down)
Hide or showThe eye. A hidden layer is not drawn in the editor or the game, and cannot be painted.
Lock or unlockThe lock. A locked layer is drawn but cannot be painted.
OpacityThe Opacity slider under the list, from 0 to 100%
Duplicate⋯ › Duplicate. The copy is named after the layer with copy added.
DeleteThe trash button under the list, or ⋯ › Delete. A layer with content asks first.

Every layer change is one undo step, such as Rename layer to "Paths" or Make "Ground" a collision layer. A drag of the opacity slider is one step.

The tools refuse to paint on a hidden or locked layer, and say why: Layer is locked: Unlock "Trees" to edit it.

Roles​

Click a layer's role icon to choose its role:

RoleMeaningWhat the engine does with it
GroundTerrain drawn at the backDraws it. The default for tile layers.
DecorationDetails drawn over the groundDraws it
CollisionNon-empty cells block movementDraws it, makes every non-empty cell solid for physics, and casts shadows from lights that cast them. See Collision and map objects.
TriggerCells or areas that report entering and leavingDraws it. Your game code can read the role to treat the layer's cells as areas.
ObjectPoints, areas and placed imagesThe role of object layers. Their objects become entities when the scene starts.
NavigationWalkability and costs for pathfindingDraws it. Your game code can read the role, for example to build a pathfinding grid.
CustomDefined by a pluginWhatever the plugin does with it

A collision layer is drawn like any other layer. Physics and shadows do not look at visibility or opacity, so for collision you do not want to see, put it on a layer of its own and set the opacity to 0% before you ship. The Collision tool sets up such a layer for you, with red color tiles at 55% opacity so you can see them while you work.

Roles and Hexy​

Hexy has no layer roles, so Talesmith stores a role in the layer's custom property role, which Hexy shows and keeps. It only writes the property when the layer's name does not already suggest the role. When a map is read, layers without a role property get one from their name:

Layer nameRole
Collision, Colliders, Solid, Walls, BlockingCollision
Triggers, ZonesTrigger
Navigation, Nav, Navmesh, Walkable, PathingNavigation
Decoration, Decor, Details, Overlay (tile layers)Decoration
Any other tile layerGround
Any other object layerObject

So a map made in Hexy with a layer called Walls collides in Talesmith without any changes.

How layers are drawn​

Tile layer 0, the bottom one, is drawn on the render layer set in the map entity's Tile Map Renderer, 100 by default, and each layer above it one render layer higher: 101, 102 and so on. Sprites are drawn on render layer 300 by default, so they appear in front of the map.

All layers of one map sit together in that range. For tiles that must cover your characters, such as treetops the player walks behind, paint them in a second map and show it with its own entity at a Render Layer above 300. The scene's named render layers are listed in the scene settings.

Tile objects on object layers become sprites that sort with the other entities by their bottom edge, so a character can walk in front of a tree and behind it.