textmode.js / Textmodifier / loadTileset
Method: loadTileset()
ts
loadTileset(tilesetSource, setActive?): Promise<TextmodeTileset>;Load a tileset and optionally set it as the base layer's active glyph source.
Accepts either tileset load options or an existing TextmodeTileset instance to use as a reusable source.
If setActive is true (default), the tileset is set as the base layer's glyph source. If setActive is false, the tileset is loaded/initialized and returned without modifying the layer.
The returned tileset can be reused on other layers via TextmodeLayer.loadTileset, which creates a layer-local fork rather than sharing a mutable instance by reference.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
tilesetSource | | TextmodeTilesetOptions | TextmodeTileset | undefined | Tileset options or reusable TextmodeTileset instance. |
setActive | boolean | true | Whether to activate the tileset on the base layer. Defaults to true. |
Returns
Promise<TextmodeTileset>
The loaded TextmodeTileset.