Phaser API Documentation

  Version: 
worldToTileY(worldY, [snapToFloor], [camera])

Description:

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

Parameters:

name type arguments description
worldY number

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

snapToFloor boolean <optional>

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

camera Phaser.Cameras.Scene2D.Camera <optional>

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

Returns:
Description:

The tile Y coordinate based on the world value.

Type:
  • number
Since: 3.50.0