The name of the tileset in the map data.
The first tile index this tileset contains.
OptionaltileWidth: numberWidth of each tile (in pixels). Default 32.
OptionaltileHeight: numberHeight of each tile (in pixels). Default 32.
OptionaltileMargin: numberThe margin around all tiles in the sheet (in pixels). Default 0.
OptionaltileSpacing: numberThe spacing between each tile in the sheet (in pixels). Default 0.
OptionaltileProperties: objectCustom properties defined per tile in the Tileset. These typically are custom properties created in Tiled when editing a tileset. Default {}.
OptionaltileData: objectData stored per tile. These typically are created in Tiled when editing a tileset, e.g. from Tiled's tile collision editor or terrain editor. Default {}.
OptionaltileOffset: objectTile texture drawing offset. Default {x: 0, y: 0}.
The number of frames above which a tile is considered to have many animation frames. This is used to optimize rendering. If a tile has fewer frames than this, frames are searched using a linear search. If a tile has more, frames are searched using a binary search.
ReadonlycolumnsThe number of tile columns in the tileset.
The starting index of the first tile index this Tileset contains.
ReadonlyglThe gl texture used by the WebGL renderer.
ReadonlyimageThe cached image that contains the individual tiles. Use setImage to set.
ReadonlymaxThe maximum length of any animation in this tileset, in frames.
This is used internally to optimize rendering.
It is updated when createAnimationDataTexture is called.
The name of the Tileset.
ReadonlyrowsThe number of tile rows in the the tileset.
ReadonlytexThe look-up table to specific tile image texture coordinates (UV in pixels). Each element contains the coordinates for a tile in an object of the form {x, y}.
Tileset-specific data per tile that are typically defined in the Tiled editor, e.g. within the Tileset collision editor. This is where collision objects and terrain are stored.
ReadonlytileThe height of each tile (in pixels). Use setTileSize to change.
ReadonlytileThe margin around the tiles in the sheet (in pixels). Use setSpacing to change.
Controls the drawing offset from the tile origin. Defaults to 0x0, no offset.
Tileset-specific properties per tile that are typically defined in the Tiled editor in the Tileset editor.
ReadonlytileThe spacing between each the tile in the sheet (in pixels). Use setSpacing to change.
ReadonlytileThe width of each tile (in pixels). Use setTileSize to change.
ReadonlytotalThe total number of tiles in the tileset.
Returns true if and only if this Tileset contains the given tile index.
The unique id of the tile across all tilesets in the map.
Creates a new WebGLTexture for the tileset's animation data.
The renderer to use.
Returns the ID of the tile to use, given a base tile and time, according to the tile's animation properties.
If the tile is not animated, this method returns the base tile ID.
The unique id of the tile across all tilesets in the map.
The current time in milliseconds.
Get or create the map from tile index to animation data index.
This is used by TilemapGPULayer to animate tiles.
The renderer to use.
Get or create the texture containing the animation data for this tileset.
This is used by TilemapGPULayer to animate tiles.
The renderer to use.
Get a tile's collision group that is stored in the Tileset. Returns null if tile index is not contained in this Tileset. This is typically defined within Tiled's tileset collision editor.
The unique id of the tile across all tilesets in the map.
Get a tile's data that is stored in the Tileset. Returns null if tile index is not contained in this Tileset. This is typically defined in Tiled and will contain both Tileset collision info and terrain mapping.
The unique id of the tile across all tilesets in the map.
Get a tiles properties that are stored in the Tileset. Returns null if tile index is not contained in this Tileset. This is typically defined in Tiled under the Tileset editor.
The unique id of the tile across all tilesets in the map.
Returns the texture coordinates (UV in pixels) in the Tileset image for the given tile index. Returns null if tile index is not contained in this Tileset.
The unique id of the tile across all tilesets in the map.
Sets the tile margin and spacing and updates the tile data (rows, columns, etc.).
Optionalmargin: numberThe margin around the tiles in the sheet (in pixels).
Optionalspacing: numberThe spacing between the tiles in the sheet (in pixels).
Sets the tile width & height and updates the tile data (rows, columns, etc.).
OptionaltileWidth: numberThe width of a tile in pixels.
OptionaltileHeight: numberThe height of a tile in pixels.
Updates tile texture coordinates and tileset data.
The (expected) width of the image to slice.
The (expected) height of the image to slice.
OptionaloffsetX: numberThe x offset in the source texture where the tileset starts. Default 0.
OptionaloffsetY: numberThe y offset in the source texture where the tileset starts. Default 0.
A Tileset is a combination of a single image containing the tiles and a container for data about each tile.