Skip to content

Class

TilePlacementEntry

Generated GDScript class reference for GridPlacement.TilePlacementEntry.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Placement entry for terrain/tile painting into a [TileMapLayer]. Associates a terrain name with optional placement rules and UI metadata. This is the canonical name replacing the internal-only [code]TilePlacementEntry[/code] (which was never released — no consumer migration needed). Usage: var entry := TilePlacementEntry.new() entry.terrain_name = "dungeon_floor" entry.icon = preload("res://art/icon.png")

Source: addons/grid_placement/placement/terrain/terrain_entry.gd

Syntax

class TilePlacementEntry extends PlacementEntry

Members

NameKindSummary
terrain_namePropertyInherits [member PlacementEntry.placement_rules] typed as [Array][PlacementRule]. [TilePaintRule]s stored here are valid [PlacementRule]s; use [code]rule is TilePaintRule[/code] or [code]rule as TilePaintRule[/code] to access tile-specific methods. The terrain name that must match [method TileSet.get_terrain_name]. This is the single source of truth for terrain identification.
target_layer_namePropertyOptional TileMapLayer node name this terrain paints onto (e.g. &"Fences"). When set, the host routes paints/demolishes for this terrain to the layer with this name in [member GridTargetingState.maps] instead of the default [member GridTargetingState.target_map], so feature terrains like fences or walls never destroy the ground beneath them. Empty = paint on the default target map (back-compat for ground terrains).
demolishablePropertyEnables DEMOLISH mode to erase this terrain entirely. Keep false for normal ground terrains like grass/snow; set true for removable terrain features such as fence tiles.
swatch_colorPropertyOptional swatch color for palette rows that have no icon. Leave unset (transparent) to let the palette derive a color from the terrain source (TileSet terrain color in 2D, MeshLibrary material in 3D), which is only possible when that source carries a plain material color. Set it when the terrain's look lives somewhere the palette cannot read — for example a shader-backed GridMap item — so the palette row shows the terrain's real color instead of the neutral placeholder.
has_swatch_colorMethod
build_costPropertyOptional BuildCost refunded on terrain demolish.
supported_terrain_toolsPropertyBrush tools this terrain supports. Empty (default) keeps the full dimensional set; a non-empty list restricts the brush bar (and brush sync) to exactly these tools. Terrains whose rules cannot paint a shape (e.g. adjacency-ruled walls vs rectangle outline) omit it here.
get_display_nameMethod
resolve_terrain_toolsMethod
is_validMethod
get_color_from_tilesetMethod