Tile class
Below is Tiled's documentation about how this structure is represented on XML files:
<tile>
- id: The local tile ID within its tileset.
- type: The type of the tile. Refers to an object type and is used by tile objects. (optional) (since 1.0)
- terrain: Defines the terrain type of each corner of the tile, given as comma-separated indexes in the terrain types array in the order top-left, top-right, bottom-left, bottom-right. Leaving out a value means that corner has no terrain. (optional)
- probability: A percentage indicating the probability that this tile is chosen when it competes with others while editing with the terrain tool. (defaults to 0)
Can contain at most one: <properties>
, <image>
(since 0.9),
<objectgroup>
, <animation>
.
Constructors
-
Tile.new({required int localId, String? type, double probability = 0, List<
int?> terrain = const [], TiledImage? image, Rectangle<num> ? imageRect, Layer? objectGroup, List<Frame> animation = const [], CustomProperties properties = CustomProperties.empty}) - Tile.parse(Parser parser)
Properties
-
animation
↔ List<
Frame> -
getter/setter pair
- class_ → String?
-
The "Class" property, a.k.a "Type" prior to Tiled 1.9.
Will be same as type.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- image ↔ TiledImage?
-
getter/setter pair
-
imageRect
↔ Rectangle<
num> ? -
getter/setter pair
- isEmpty → bool
-
no setter
- localId ↔ int
-
getter/setter pair
- objectGroup ↔ Layer?
-
getter/setter pair
- probability ↔ double
-
getter/setter pair
- properties ↔ CustomProperties
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
terrain
↔ List<
int?> -
List of indexes of the terrain.
getter/setter pair
- type ↔ String?
-
getter/setter pair
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