Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

TileMapLayerProps

What a TileMapLayer takes: its cells and where they stand, the collision settings every collider of its solid tiles takes, and its row name.

Property Type Default value Description
collisionLayer? CollisionLayerHandle undefined The layer this collider stands in, over its body’s.
collisionMask? CollisionMask undefined The layers this collider meets, over its body’s.
material? MaterialOptions undefined -
name? string "TileMapLayer" Its row name in the devtools tree.
plane? "ground" | "side" | Plane2D Plane2D.Ground The plane it lies in, which the scene’s Camera2D must name too: columns run along +x, and rows along +z on the ground or down -y on the side plane.
position? Position [0, 0, 0] Where cell [0, 0]’s top-left corner stands, as Godot’s, Unity’s and Phaser’s tile maps place their first cell at their origin.
sortingLayer? number 0 Which band it draws in, the whole numbers a Sprite’s sortingLayer takes, -4 to 3. A layer of 0 or below draws under every sprite, after the map’s ground; a layer above 0, such as a roof, draws over every sprite and every model.
sortingOrder? number 0 Its order within its band, a whole number from -64 to 63, a sprite’s range, lower first: readTiledMap numbers a band’s layers in Tiled’s order from -64.
tiles TileRows undefined -
tileSet TileSet | readonly TileSet[] undefined The tile set its cells name, or several, which a cell names by its place in the list. Every set of a layer has one tile size.
trigger? boolean undefined A trigger touches nothing and stands where others pass, as Unity’s isTrigger.
visible? boolean true Whether it draws. A hidden layer keeps its colliders, as Tiled’s hidden collision layer does.