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

TileLayerOptions

A tile layer’s cells and where they stand: what TileMapLayer takes, what readTiledMap gives for each of Tiled’s tile layers, and what findTileAt reads.

Property Type Default value Description
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.
visible? boolean true Whether it draws. A hidden layer keeps its colliders, as Tiled’s hidden collision layer does.