Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Tile

Represents a single Tile instance.

Hierarchy

  • Tile

Index

Properties

Properties

f

f: number

"Flip bits", a 2-bits integer to represent the mirror transformations of the tile.

  • Bit 0 = X flip
  • Bit 1 = Y flip

Examples:

  • f == 0 -> no flip
  • f == 1 -> X flip only
  • f == 2 -> Y flip only
  • f == 3 -> both flips

px

px: [x: number, y: number]

Pixel coordinates of the tile in the layer.

World position of a tile:

const layer = ...;
for (tile in layer.tiles) {
    const tileWorldX = tile.px[0] + layer.pxTotalOffset.x
    const tileWorldY = tile.px[1] + layer.pxTotalOffset.y
}

src

src: [x: number, y: number]

Pixel coordinates of the tile in the tileset

t

t: number

The Tile ID in the corresponding tileset.

Generated using TypeDoc