TileData class

Pre-computed tile data for a single tile.

This is computed once when the map loads and cached for efficient extraction to the render world.

Constructors

TileData({required int gid, required int x, required int y, required int tilesetIndex, required int localId, bool flipHorizontal = false, bool flipVertical = false, bool flipDiagonal = false, bool animated = false})
const

Properties

animated → bool
Whether this tile has an animation.
final
flipDiagonal → bool
Whether to flip diagonally (rotate 90 degrees).
final
flipFlags → int
Computes flip flags as a packed integer.
no setter
flipHorizontal → bool
Whether to flip horizontally.
final
flipVertical → bool
Whether to flip vertically.
final
gid → int
Global tile ID (with flip flags removed).
final
hashCode → int
The hash code for this object.
no setterinherited
localId → int
Local tile ID within the tileset.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tilesetIndex → int
Index of the tileset this tile belongs to.
final
x → int
Grid X position.
final
y → int
Grid Y position.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromGid(int rawGid, int x, int y, int tilesetIndex, int firstGid, {bool animated = false}) → TileData
Creates TileData from a raw GID with flip flags.