Layers¶
At its simplest, layers can be retrieved from a Tilemap by invoking:
getLayer<ObjectGroup>("myObjectGroupLayer");
getLayer<ImageLayer>("myImageLayer");
getLayer<TileLayer>("myTileLayer");
getLayer<Group>("myGroupLayer");
These methods will either return the requested layer type or null if it does not exist.
Layer properties¶
The following Tiled properties are supported:
Visible
Opacity
Tint color
Horizontal offset
Vertical offset
Parallax factor
Custom properties
Tiles properties¶
Tiles can have custom properties accessible at
tile.properties
.Tiles can have a custom
type
(orclass
starting in Tiled v1.9) accessible attile.type
.
Other features¶
Other advanced features are not yet supported, but you can easily read the objects and other features of the TMX and add custom behavior (eg regions for triggers and walking areas, custom animated objects).
Full Example¶
You can check a working example here.
The content on this page is licensed under the CC BY 4.0 License,
and code samples under the MIT License.