Definitions

@Serializable
data class Definitions(val entities: List<LDtkEntityDefinition>, val enums: List<LDtkEnumDefinition>, val externalEnums: List<LDtkEnumDefinition>, val layers: List<LDtkLayerDefinition>, val levelFields: List<LDtkFieldDefinition>, val tilesets: List<LDtkTilesetDefinition>)

A structure containing all the definitions of this project

If you're writing your own LDtk importer, you should probably just ignore most stuff in the defs section, as it contains data that are mostly important to the editor. To keep you away from the defs section and avoid some unnecessary JSON parsing, important data from definitions is often duplicated in fields prefixed with a double underscore (eg. __identifier or __type). The 2 only definition types you might need here are Tilesets and Enums.

Constructors

Link copied to clipboard

Properties

Link copied to clipboard

All entities, including their custom fields

Link copied to clipboard
Link copied to clipboard

Note: external enums are exactly the same as enums, except they have a relPath to point to an external source file.

Link copied to clipboard
Link copied to clipboard

An array containing all custom fields available to all levels.

Link copied to clipboard