Tile

data class Tile(val width: Int, val height: Int, val data: ByteArray)(source)

Represents a single map tile containing image data.

Tiles are typically 256×256 pixel PNG images, but can be any size or format supported by Android's BitmapFactory (PNG, JPEG, WebP, etc.).

The data field contains the raw image bytes (not decoded bitmap). The image will be decoded on demand when the tile is rendered.

Example usage:

// Create a tile from PNG bytes
val tile = Tile(256, 256, pngByteArray)

// Indicate no tile is available
val noTile: Tile? = null

See also

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, data: ByteArray)

Properties

Link copied to clipboard

Raw image data (PNG, JPEG, WebP, etc.)

Link copied to clipboard
val height: Int

Tile height in pixels (typically 256)

Link copied to clipboard
val width: Int

Tile width in pixels (typically 256)

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Two tiles are equal if they have the same dimensions and data. Uses contentEquals for byte array comparison.

Link copied to clipboard
open override fun hashCode(): Int

Hash code based on width, height, and data contents.

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