Class: TileSet

html.TileSet

Class representing an image-based tile set for use on a tile map.

new html.TileSet ()

Properties:
Name Type Description
gpu bool

(default: false) Whether to store the image data on the GPU. This may not be supported by all environments.

source string

The image source URL.

status string

[readonly] The current status. One of: empty|loading|error|success

tileSize number

(default: 32) The width and height of a single tile.

Extends

Methods

getTile (n)object

Returns the tile for the given tile ID.

Name Type Description
n number

The tile ID.

Returns:
Type Description
object The tile object, or the null tile if the tile does not exist.

setAlias (n, to)

Sets an alias for a tile ID, which will be looked up by getTile instead. This can be used for animating tiles.

Name Type Description
n number

A tile ID.

to number

The tile ID to use instead.

Events

html.TileSet.event:invalidate

Is triggered when the tile set data changed.