Phaser API Documentation

  Version: 
<static> WorldToTileY(worldY, snapToFloor, camera, layer)

Description:

Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the layer's position, scale and scroll.

Parameters:

name type description
worldY number

The y coordinate to be converted, in pixels, not tiles.

snapToFloor boolean

Whether or not to round the tile coordinate down to the nearest integer.

camera Phaser.Cameras.Scene2D.Camera

The Camera to use when calculating the tile index from the world values.

layer Phaser.Tilemaps.LayerData

The Tilemap Layer to act upon.

Returns:
Description:

The Y location in tile units.

Type:
  • number
Since: 3.0.0