Component · twoD
Tilemap
Canonical text source for a tilemap. Binary chunks are derived cache products.
Fields
atlas
option<asset>Atlas asset reference; never a native descriptor.
default null
normalAtlas
option<asset>Optional normal atlas matching the source regions.
default null
layout
GridLayoutGrid, pointy hex or diamond layout.
default "grid"
One ofgridhexisometric
cellSize
vec2World dimensions of a cell's bounding box in metres.
default [1,1]
definitions
map<TileDefinition>Tile number text to definitions; zero is reserved for empty cells.
default {}
layers
keyed<TileLayer>Stable layers. Their array order never determines painter order.
default []
rules
list<TileRule>Ordered auto-tiling rules.
default []
Usage
Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.
Add it
ara do component.add -p entity=name:Crate -p component=Tilemap --why "Add Tilemap"Set a field
ara do property.set -p entity=name:Crate -p path=Tilemap.atlas -p value=null --why "Tune Tilemap"In a scene document
{
"Tilemap": {
"atlas": null
}
}From C#
/// <summary>Use two-metre cells for a large tilemap.</summary>
public static void UseTilemap(Entity entity, in Tick tick)
{
ref var component = ref World.Get<Tilemap>(entity);
component.CellSize = new Vector2(2, 2);
}From C#
Scripts read and write it with Get<Tilemap>(); see the Tilemap struct.