Options
All
  • Public
  • Public/Protected
  • All
Menu

A tile map transformed with an affine transformation.

see

getHitboxesAround It gives a fast access to hitboxes for collision handling.

Hierarchy

  • TransformedCollisionTileMap

Index

Constructors

Methods

  • getAllHitboxes(tag: string): Iterable<Polygon>
  • Parameters

    • tag: string

      The tile tag.

    Returns Iterable<Polygon>

    All the hitboxes from the tiles having the right tag.

  • getDimensionX(): number
  • Returns number

    The number of tile columns in the map.

  • getDimensionY(): number
  • Returns number

    The number of tile rows in the map.

  • getHeight(): number
  • Returns number

    The tile map height in pixels.

  • getHitboxes(tag: string, xMin: number, yMin: number, xMax: number, yMax: number): Iterable<Polygon>
  • Parameters

    • tag: string

      The tile tag.

    • xMin: number

      The fist column to include.

    • yMin: number

      The fist row to include.

    • xMax: number

      The last column to include.

    • yMax: number

      The last row to include.

    Returns Iterable<Polygon>

    All the hitboxes from the tiles overlapping the given area where tiles have the right tag.

  • getHitboxesAround(tag: string, left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • see

    {@link gdjs.RuntimeObject.getHitboxesAround}

    Parameters

    • tag: string

      The tile tag.

    • left: number

      The left border of the area in the scene.

    • top: number

      The top border of the area in the scene.

    • right: number

      The right border of the area in the scene.

    • bottom: number

      The left border of the area in the scene.

    Returns Iterable<Polygon>

    At least all the hitboxes from the given area where tiles have the right tag.

  • getTileDefinition(tileId: number): undefined | TileDefinition
  • Parameters

    • tileId: number

      The tile identifier

    Returns undefined | TileDefinition

    The tile definition form the tile set.

  • getTileHeight(): number
  • Returns number

    The tile width in pixels.

  • getTileWidth(): number
  • Returns number

    The tile height in pixels.

  • Returns AffineTransformation

    The transformation from the time map coordinate (in pixels) to the scene coordinate (in pixels).

  • getWidth(): number
  • Returns number

    The tile map width in pixels.

  • pointIsInsideTile(x: number, y: number, tag: string): boolean
  • Check if a point is inside a tile with a given tag.

    It doesn't use the tile hitboxes. It only check the point is inside the tile square.

    Parameters

    • x: number

      The X coordinate of the point to check.

    • y: number

      The Y coordinate of the point to check.

    • tag: string

      The tile tag

    Returns boolean

    true when the point is inside a tile with a given tag.

  • Parameters

    • transformation: AffineTransformation

      the transformation from the time map coordinate (in pixels) to the scene coordinate (in pixels).

    Returns void

Properties

tag: string
workingPoint: FloatPoint = ...

An reusable Point to avoid allocations.

Generated using TypeDoc