A paintable terrain: a TileSet terrain name plus its painting options. Add entries to a TerrainPalette or a PlacementCatalog. 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 PlacementEntryMembers
| Name | Kind | Summary |
|---|---|---|
terrain_name | Property | The terrain's name in the TileSet. Must match TileSet.get_terrain_name() exactly. |
target_layer_name | Property | Optional name of the TileMapLayer node to paint on, such as &"Fences". Use it so fences or walls go on their own layer and do not replace the ground under them. The layer must be listed in PlacementLevelContext.maps. Leave empty to paint on the level's target map. Overrides TerrainPalette.default_target_layer_name. |
demolishable | Property | When on, demolish mode can erase this terrain. Leave off for ground such as grass or snow; turn on for removable features such as fences. |
stacks_on_occupied_cells | Property | When on, a 3D paint aimed at a full-height block lands on the first free cell above that column. A thin pad is climbed too, unless a TerrainStackRule3D is on this entry: that rule replaces a thin slab and stacks only on full-height blocks. The block still fills one whole cell. A mesh shorter than the cell leaves an air gap under that block. Objects sit on the mesh top. A block cannot stand on an object. Ground slabs leave this off and paint in place. Read it through builds_on_thin_tiles() and TerrainPlacementService3D.stacked_cell(). |
require_existing_ground | Property | When on, this terrain paints only where a tile already is, or in the cell directly above one. A thin pad counts as that ground. An empty column is refused. Off by default, so the tile can be the base on bare grid. |
builds_on_thin_tiles | Method | |
swatch_color | Property | Optional color shown in the palette when the entry has no icon. Leave transparent to use the terrain color from the TileSet (2D) or the MeshLibrary material (3D). Set it when that color cannot be read, such as for a GridMap item that uses a shader. |
has_swatch_color | Method | |
build_cost | Property | Optional cost refunded when this terrain is demolished. |
supported_terrain_tools | Property | Brush tools allowed for this terrain. Leave empty to allow every tool. Leave out tools that cannot work with this terrain's rules, such as rectangle outline for walls that need neighbors. |
get_display_name | Method | |
resolve_terrain_tools | Method | |
is_valid | Method | |
get_color_from_tileset | Method |