Interface TileLayer<E>

Tile layer.

interface TileLayer<E> {
    chunks?: Chunk<EncodingDataType<E>>[];
    class?: string;
    compression?: Compression;
    data?: EncodingDataType<E>;
    encoding?: E;
    height: number;
    id: number;
    locked?: boolean;
    name: string;
    offsetx?: number;
    offsety?: number;
    opacity: number;
    parallaxx?: number;
    parallaxy?: number;
    properties?: AnyProperty[];
    startx?: number;
    starty?: number;
    tintcolor?: string;
    type: "tilelayer";
    visible: boolean;
    width: number;
    x: number;
    y: number;
}

Type Parameters

Hierarchy (view full)

Properties

chunks?: Chunk<EncodingDataType<E>>[]

Array of chunks. Only set for tile layers in infinite maps.

class?: string

The class of the layer.

compression?: Compression

Compression method for base64 encoded data and chunks. Only set when base64 encoding is set.

Array of unsigned integers (GIDs) or base64-encoded data.

encoding?: E

The data encoding. When set to CSV or undefined then data and data in chunks are unsigned integers. When set to BASE64 then data is base64 encoded and optionally compressed by the compression method defined in compression.

height: number

Row count. Same as map height for fixed-size maps.

id: number

Incremental ID. Unique across all layers.

locked?: boolean

Whether layer is locked in the editor. Default is false.

name: string

The layer's name.

offsetx?: number

Optional horizontal layer offset in pixels. Default is 0.

offsety?: number

Optional vertical layer offset in pixels. Default is 0.

opacity: number

Layer opacity between 0 and 1.

parallaxx?: number

Horizontal parallax factor. Default is 1.

parallaxy?: number

Vertical parallax factor. Default is 1.

properties?: AnyProperty[]

Array of properties. Empty if not set.

startx?: number

X coordinate where layer content stats. Only set to infinite maps.

starty?: number

Y coordinate where layer content stats. Only set to infinite maps.

tintcolor?: string

Optional tint color that is multiplied with any graphics drawn by this layer or any child layer.

type: "tilelayer"

The layer type.

visible: boolean

Whether layer is shown or hidden in editor.

width: number

Column count. Same as map width for fixed-size maps.

x: number

Horizontal layer offset in tiles. Always 0.

y: number

Vertical layer offset in tiles. Always 0.

Generated using TypeDoc