This complex section isn’t meant to be used by game devs at all, as these rules are
completely resolved internally by the editor before any saving. You should just ignore
this part.
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.
This object is not actually used by LDtk. It ONLY exists to force explicit references to
all types, to make sure QuickType finds them and integrate all of them. Otherwise,
Quicktype will drop types that are not explicitely used.
This section contains all the level data. It can be found in 2 distinct forms, depending
on Project current settings: - If “Separate level files” is disabled (default):
full level data is embedded inside the main Project JSON file, - If “Separate level
files” is enabled: level data is stored in separate standalone .ldtkl files (one
per level). In this case, the main Project JSON file will still contain most level data,
except heavy sections, like the layerInstances array (which will be null). The
externalRelPath string points to the ldtkl file. A ldtkl file is just a JSON file
containing exactly what is described below.
The Tileset definition is the most important part among project definitions. It
contains some extra informations about each integrated tileset. If you only had to parse
one definition section, that would be the one.
An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible
values: Cover, FitInside, Repeat, Stretch, FullSizeCropped,
FullSizeUncropped, NineSlice