LdtkData
Entity →
ceramic.LdtkData (Class)
Root class representing an LDtk project data structure.
This is the main entry point for working with LDtk level data in Ceramic.
It contains all the project definitions, worlds, and levels from an LDtk file.
The data structure is optimized for performance on static targets and provides
easy access to all LDtk entities, layers, and tilesets.
See: https://ldtk.io/ for more information about LDtk
Instance Members
File format version
Unique project identifier
Project background color
A structure containing all the definitions of this project
If true
, one file will be saved for the project (incl. all its definitions) and one file in a sub-folder for each level.
All instances of entities that have their exportToToc flag enabled are listed by def identifier here.
All worlds of this LDtk project
The related asset (if any)
Gets a world by its identifier.
Name |
Type |
Description |
identifier |
String |
The world identifier to search for |
Returns |
Description |
LdtkWorld |
The matching LdtkWorld, or null if not found |
Gets a world by its unique instance identifier (IID).
Name |
Type |
Description |
iid |
String |
The world IID to search for |
Returns |
Description |
LdtkWorld |
The matching LdtkWorld, or null if not found |
ldtk
tocEntry(identifier: String): LdtkTocEntry
Creates a new LdtkData instance from JSON data.
Name |
Type |
Default |
Description |
json |
haxe.DynamicAccess<Dynamic> |
(optional) |
The parsed LDtk project JSON data |
loadExternalLevelData |
Function |
(optional) |
Optional callback to load external level data when using multi-file projects |
loadLevelCeramicTilemap |
Function |
(optional) |
Optional callback to load Ceramic tilemap for a level |
Private Members
ldtk
loadExternalLevelData(relPath: String, callback: Function): Void
Used to load external level data
Name |
Type |
relPath |
String |
callback |
Function |
When loading external levels, we also need
a funtion to load the Ceramic tilemap from it.
This is it.
Name |
Parameters |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |