TileCoordinate

class TileCoordinate(val x: Int, val y: Int)

Discrete 2D tile grid coordinate.

Identifies a single cell in an isometric tile grid by its integer column and row. Distinct from Point (continuous 3D world space) and Point2D (continuous 2D screen space).

Negative coordinates are valid — grids are not required to start at (0, 0).

Parameters

x

Column index (increases right-and-down on screen)

y

Row index (increases left-and-down on screen)

Constructors

Link copied to clipboard
constructor(x: Int, y: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val x: Int
Link copied to clipboard
val y: Int

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun isWithin(width: Int, height: Int): Boolean

Returns true if this coordinate falls within a grid of width columns and height rows anchored at (0, 0).

Link copied to clipboard
operator fun minus(other: TileCoordinate): TileCoordinate

Returns the coordinate offset by the negation of other.

Link copied to clipboard
operator fun plus(other: TileCoordinate): TileCoordinate

Returns the coordinate offset by other.

Link copied to clipboard
fun toPoint(tileSize: Double = 1.0, elevation: Double = 0.0): Point

Converts this tile coordinate to a continuous world Point at the grid's (0,0) corner of this cell.

Link copied to clipboard
open override fun toString(): String