Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Tilemap
Phaser.Physics.Arcade.Tilemap

Methods

<static> ProcessTileCallbacks(tile, sprite)
Focus
Focus

Description:

A function to process the collision callbacks between a single tile and an Arcade Physics enabled Game Object.

Parameters:

name type description
tile Phaser.Tilemaps.Tile

The Tile to process.

sprite Phaser.GameObjects.Sprite

The Game Object to process with the Tile.

Returns:
Description:

The result of the callback, true for further processing, or false to skip this pair.

Type:
  • boolean
Examples:
Focus
Focus
<static> ProcessTileSeparationX(body, x)
Focus
Focus

Description:

Internal function to process the separation of a physics body from a tile.

Parameters:

name type description
body Phaser.Physics.Arcade.Body

The Body object to separate.

x number

The x separation amount.

Examples:
Focus
Focus
<static> ProcessTileSeparationY(body, y)
Focus
Focus

Description:

Internal function to process the separation of a physics body from a tile.

Parameters:

name type description
body Phaser.Physics.Arcade.Body

The Body object to separate.

y number

The y separation amount.

Examples:
Focus
Focus
<static> SeparateTile(i, body, tile, tileWorldRect, tilemapLayer, tileBias, isLayer)
Focus
Focus

Description:

The core separation function to separate a physics body and a tile.

Parameters:

name type description
i number

The index of the tile within the map data.

body Phaser.Physics.Arcade.Body

The Body object to separate.

tile Phaser.Tilemaps.Tile

The tile to collide against.

tileWorldRect Phaser.Geom.Rectangle

A rectangle-like object defining the dimensions of the tile.

tilemapLayer Phaser.Tilemaps.TilemapLayer

The tilemapLayer to collide against.

tileBias number

The tile bias value. Populated by the World.TILE_BIAS constant.

isLayer boolean

Is this check coming from a TilemapLayer or an array of tiles?

Returns:
Description:

true if the body was separated, otherwise false.

Type:
  • boolean
Examples:
Since: 3.0.0
Focus
Focus
<static> TileCheckX(body, tile, tileLeft, tileRight, tileBias, isLayer)
Focus
Focus

Description:

Check the body against the given tile on the X axis. Used internally by the SeparateTile function.

Parameters:

name type description
body Phaser.Physics.Arcade.Body

The Body object to separate.

tile Phaser.Tilemaps.Tile

The tile to check.

tileLeft number

The left position of the tile within the tile world.

tileRight number

The right position of the tile within the tile world.

tileBias number

The tile bias value. Populated by the World.TILE_BIAS constant.

isLayer boolean

Is this check coming from a TilemapLayer or an array of tiles?

Returns:
Description:

The amount of separation that occurred.

Type:
  • number
Examples:
Since: 3.0.0
Focus
Focus
<static> TileCheckY(body, tile, tileTop, tileBottom, tileBias, isLayer)
Focus
Focus

Description:

Check the body against the given tile on the Y axis. Used internally by the SeparateTile function.

Parameters:

name type description
body Phaser.Physics.Arcade.Body

The Body object to separate.

tile Phaser.Tilemaps.Tile

The tile to check.

tileTop number

The top position of the tile within the tile world.

tileBottom number

The bottom position of the tile within the tile world.

tileBias number

The tile bias value. Populated by the World.TILE_BIAS constant.

isLayer boolean

Is this check coming from a TilemapLayer or an array of tiles?

Returns:
Description:

The amount of separation that occurred.

Type:
  • number
Examples:
Since: 3.0.0
Focus
Focus
<static> TileIntersectsBody(tileWorldRect, body)
Focus
Focus

Description:

Checks for intersection between the given tile rectangle-like object and an Arcade Physics body.

Parameters:

name type description
tileWorldRect Object

A rectangle object that defines the tile placement in the world.

body Phaser.Physics.Arcade.Body

The body to check for intersection against.

Returns:
Description:

Returns true of the tile intersects with the body, otherwise false.

Type:
  • boolean
Examples:
Focus
Focus