Skip to content

PixelTileSet

Extends TileSet. Read from the plugin's source on every build.

A TileSet that is a tileset document, kept in step with it.

Its atlas source 0 is the document’s sheet as a PixelSpriteTexture, cut at the sheet’s grid, with a tile per PixelTile the document declares: each tile’s collision on physics layer 0, its custom data on a layer per key, its terrain and peering bits on a terrain set per mode. Draw on the sheet and the tiles redraw; declare a tile, give it a polygon or a value, and the set has it on the next idle frame. Nothing is exported.

The set saves no tiles of its own. The document holds every one of them, so a scene holding this set stores document and the layers’ own settings, a collision mask or a terrain’s colour, and loading it rebuilds the tiles from the document. A tile added in Godot’s TileSet editor on a cell the document does not declare is kept by every rebuild, until the scene is loaded again, and a change there to a tile the document declares is gone at the next rebuild; either pushes one warning per set naming the Tiles editor.

Properties

document

@export var document: PixelTilesDocument

The tileset document this set is built from.

Methods

rebuild

func rebuild() -> void

Lays the document’s tiles onto the set. Public because a caller that has changed a document behind its signals can ask for it.

sheet_texture

func sheet_texture() -> PixelSpriteTexture

The texture the atlas draws, the sheet composited.

Signals

document_changed

signal document_changed

The rebuild has landed: after rebuild, or after the rebuild a change to the document queued.

Constants

ATLAS_ID

const ATLAS_ID := 0

The id of the one atlas source the set builds, the sheet: a cell laid with set_cell names it, as PixelTileMapLayer.place_tile does.

JamChip, by GlitterSnack. MIT licence. Built from the source on every merge. Its artwork and screenshots are made with JamChip.