"col": The main brick layer of the map.
"markers": The marker layer for defining special objects for later use.
"lnk": The layer defining the topology of room connections.
xxx: Custom layers defined by the user.
Important
lnk is used to define the topology of the room connections, which is a object layer.
Only the first object in the layer is considered.
A valid lnk layer should be:
- name = "lnk"
A valid Boundary should be:
- class = "polygon" (built-in in
YATI, notEdgar.Godot) - property
lnk= "boundary" or name = "Boundary"
A valid Door should be:
- class = "line" (built-in in
YATI, notEdgar.Godot) - property
lnk= "door"
Note
The Door objects is a polyline with multiple segments.
Each segment is considered as the length of the door.
Example: The total height of the opening is 6, the usable height of a single door is 2. The default segments are [0,2], [2,4], [4,6], so the cooperative movement step between the two rooms is 2.
If an additional independent Door is added with overlapping segments [1,3], [3,5], then the full set of usable segments becomes [0,2], [1,3], [2,4], [3,5], [4,6], and the minimal alignment step decreases to 1. This makes the movement unit along that edge smaller, increases the number of alignment positions, and enriches possible generation combinations.
Summary: Adding overlapping segments reduces the minimal step size, enabling finer control and more generation possibilities.
A valid Anchor should be:
- property
lnk= "anchor" or name = "Anchor"
Note
An Anchor marks the pivot point of a room.
During rendering, the position of each TileMapLayer is offset by the anchor of the pivot room.
To enable transformations, add the following meta-data to the lnk layer:
transformations: A string json containing the transformation parameters.- e.g.
[0, 4]
- e.g.
Note
0: Identity
1: Rotate90
2: Rotate180
3: Rotate270
4: MirrorX
5: MirrorY
6: Diagnal13
7: Diagnal24
Most of the time, you would want to re-map / swap the tiles according to the transformation applied to the room.
To achieve this, you can use tile meta-data to define the swapping rules.
Important
These properties must be defined on the Tileset in the Tiled Map Editor, specifically on the individual tiles themselves.
For example, tileswap4 = Color(source_id, atlas_x, atlas_y, alternative_tile) defines the swapping rule for MirrorX (4) transformation.
When a tile is rendered in a room with MirrorX transformation, it will be swapped to the tile defined in the tileswap4 meta-data.
See col in Renderer section for details.
A renderer converts an Edgar.Godot layout into Godot nodes (typically TileMapLayer). It supports tile and room filtering via metadata and emits signals for post‑processing.
The col layer is the brick layer of the map. Obviously, there should be multiple col layers if the map has multiple tilemaps.
To achieve this, you need to set the meta-data tiled_layer on each TileMapLayer node of a renderer, specifying which Tiled layer it corresponds to.
For example, if you have two tilemaps in Tiled named "Ground" and "Decorations", you would create two TileMapLayer nodes under the renderer, each with the tiled_layer meta-data set to "Ground" and "Decorations" respectively.
Note
For simplicity, you can name the TileMapLayer nodes the same as their corresponding Tiled layers. For example, a TileMapLayer node named "col" would have the tiled_layer meta-data set to "col".
post_process(renderer: EdgarRenderer2D, tile_map_layer: TileMapLayer, tiled_layer: String)marker_post_process(renderer: EdgarRenderer2D, tile_map_layer: TileMapLayer, marker: Node, data: Variant)custom_post_process(renderer: EdgarRenderer2D, tile_map_layer: TileMapLayer, layer: Node)clear_tiles(renderer: EdgarRenderer2D, tile_map_layer: TileMapLayer)
You can connect to or await these signals to run custom logic after rendering.
- Script-based (override methods)
- Extend
EdgarRenderer2Dand override:
extends EdgarRenderer2D
func _post_process(tile_map_layer: TileMapLayer, tiled_layer: String) -> void:
# Custom per-layer post-processing
pass
func _marker_post_process(tile_map_layer: TileMapLayer, marker: Node, data: Variant) -> void:
# Custom marker post-processing
pass
func _custom_post_process(tile_map_layer: TileMapLayer, layer: Node) -> void:
pass
func _clear_tiles(tile_map_layer: TileMapLayer) -> void:
# Custom tile clearing behavior
# Default implementation: tile_map_layer.clear()
pass- Alternatively, implement hooks directly on a
TileMapLayer. The renderer will detect and call them:
# On the TileMapLayer script
func _post_process(renderer: EdgarRenderer2D, tiled_layer: String) -> void:
# Adjust this layer after rendering
passNote
Overrides are executed via signals under the hood, so you can still await them even when using the override approach.
When overriding _clear_tiles, call clear(tile_map_layer) in your implementation if you want to emit the signal and allow other handlers to run as well.
- Signal-based (connect handlers)
Note
If you connect to the clear_tiles signal, the default clearing behavior will still run because the default handler is already connected.
To fully override the default behavior without overriding the method, you must disconnect the default connection first:
for conn in renderer.clear_tiles.get_connections():
renderer.clear_tiles.disconnect(conn.callable) # or concrete connection that you want
# Connects to your own handler
renderer.clear_tiles.connect(_my_custom_clear_method)A filter is a set of conditions to determine which tiles or rooms should be rendered in the final map. This is especially useful when you have multiple layers in Tiled but only want to render specific parts in Godot, e.g., multi-layered tilemaps.
To enable a tile filter, add the following meta-data to the target TileMapLayer node of a renderer:
tile_exceptions: AnDictionary[Vector4i, bool]to filter the tiles that you do not want to render.tile_inclusions: AnDictionary[Vector4i, bool]to filter the tiles that you do only want to render.
Note
You can only use either tile_exceptions or tile_inclusions at a time.
If both are provided, only tile_inclusions will be considered.
Important
The key of the dictionaries should be a Vector4i representing the tile's source ID and alternative tile, formatted as (source_id: int, atlas_coord: Vector2i, alternative_tile: int).
To enable a room filter, add the following meta-data to the target TileMapLayer node of a renderer:
room_exceptions: AnDictionary[String, bool]to filter the rooms that you do not want to render.room_inclusions: AnDictionary[String, bool]to filter the rooms that you do only want to render.
Note
You can only use either room_exceptions or room_inclusions at a time.
If both are provided, only room_inclusions will be considered.
To enable an edgar layer filter (filter by room type), add the following meta-data to the target TileMapLayer node of a renderer:
edgar_layer_exceptions: AnDictionary[int, bool]to filter the edgar layers that you do not want to render.edgar_layer_inclusions: AnDictionary[int, bool]to filter the edgar layers that you do only want to render.
Note
You can only use either edgar_layer_exceptions or edgar_layer_inclusions at a time.
If both are provided, only edgar_layer_inclusions will be considered.
This is useful for filtering rooms by their type (e.g., "BossRoom", "TreasureRoom") rather than individual room instances.
See col in Renderer section for details.
This is the base class for all 2D renderers in Edgar.Godot. See the Renderer section for signals, filters, and usage details.
A loadable renderer that supports dynamic loading and unloading of payloads (typically PackedScene) for chunk-based or partition-based rendering.
load_content() -> void: Loads a payload scene into the renderer.unload_content() -> void: Unloads a previously loaded payload by its name.
The root node of payload scene must define a tile_map_layers metadata property as Array[NodePath]. This exposes the renderable references to the renderer, which automatically validates and injects them.
Note
The renderer uses these NodePaths to manage and coordinate tile map layers across loaded payloads.