Class LdtkJson
This file is a JSON schema of files created by LDtk level editor (https://ldtk.io).
This is the root of any Project JSON file. It contains: - the project settings, - an array of levels, - a group of definitions (that can probably be safely ignored for most users).
Properties
| Improve this Doc View SourceAppBuildId
LDtk application build identifier.
This is only used to identify the LDtk version
that generated this particular project file, which can be useful for specific bug fixing.
Note that the build identifier is just the date of the release, so it's not unique to
each user (one single global ID per LDtk public release), and as a result, completely
anonymous.
| Type | Description |
|---|---|
| System.Single |
BackupLimit
Number of backup files to keep, if the backupOnSave is TRUE
| Type | Description |
|---|---|
| System.Int32 |
BackupOnSave
If TRUE, an extra copy of the project will be created in a sub folder, when saving.
| Type | Description |
|---|---|
| System.Boolean |
BackupRelPath
Target relative path to store backup files
| Type | Description |
|---|---|
| System.String |
BgColor
Project background color
| Type | Description |
|---|---|
| System.String |
CustomCommands
An array of command lines that can be ran manually by the user
| Type | Description |
|---|---|
| LdtkCustomCommand[] |
DefaultEntityHeight
Default height for new entities
| Type | Description |
|---|---|
| System.Int32 |
DefaultEntityWidth
Default width for new entities
| Type | Description |
|---|---|
| System.Int32 |
DefaultGridSize
Default grid size for new layers
| Type | Description |
|---|---|
| System.Int32 |
DefaultLevelBgColor
Default background color of levels
| Type | Description |
|---|---|
| System.String |
DefaultLevelHeight
WARNING: this field will move to the worlds array after the "multi-worlds" update.
It will then be null. You can enable the Multi-worlds advanced project option to enable
the change immediately.
Default new level height
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
DefaultLevelWidth
WARNING: this field will move to the worlds array after the "multi-worlds" update.
It will then be null. You can enable the Multi-worlds advanced project option to enable
the change immediately.
Default new level width
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
DefaultPivotX
Default X pivot (0 to 1) for new entities
| Type | Description |
|---|---|
| System.Single |
DefaultPivotY
Default Y pivot (0 to 1) for new entities
| Type | Description |
|---|---|
| System.Single |
Defs
A structure containing all the definitions of this project
| Type | Description |
|---|---|
| Definitions |
DummyWorldIid
If the project isn't in MultiWorlds mode, this is the IID of the internal "dummy" World.
| Type | Description |
|---|---|
| System.String |
ExportLevelBg
If TRUE, the exported PNGs will include the level background (color or image).
| Type | Description |
|---|---|
| System.Boolean |
ExportPng
WARNING: this deprecated value is no longer exported since version 0.9.3 Replaced
by: imageExportMode
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
ExportTiled
If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file (default is FALSE)
| Type | Description |
|---|---|
| System.Boolean |
ExternalLevels
If TRUE, one file will be saved for the project (incl. all its definitions) and one file in a sub-folder for each level.
| Type | Description |
|---|---|
| System.Boolean |
Flags
An array containing various advanced flags (ie. options or other states). Possible
values: DiscardPreCsvIntGrid, ExportOldTableOfContentData,
ExportPreCsvIntGridFormat, IgnoreBackupSuggest, PrependIndexToLevelFileNames,
MultiWorlds, UseMultilinesType
| Type | Description |
|---|---|
| LDtkUnity.Flag[] |
ForcedRefs
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.
| Type | Description |
|---|---|
| LDtkUnity.ForcedRefs |
IdentifierStyle
Naming convention for Identifiers (first-letter uppercase, full uppercase etc.) Possible
values: Capitalize, Uppercase, Lowercase, Free
| Type | Description |
|---|---|
| LDtkUnity.IdentifierStyle |
Iid
Unique project identifier
| Type | Description |
|---|---|
| System.String |
ImageExportMode
"Image export" option when saving project. Possible values: None, OneImagePerLayer,
OneImagePerLevel, LayersAndLevels
| Type | Description |
|---|---|
| LDtkUnity.ImageExportMode |
JsonVersion
File format version
| Type | Description |
|---|---|
| System.String |
LevelNamePattern
The default naming convention for level identifiers.
| Type | Description |
|---|---|
| System.String |
Levels
All levels. The order of this array is only relevant in LinearHorizontal and
linearVertical world layouts (see worldLayout value).
Otherwise, you should
refer to the worldX,worldY coordinates of each Level.
| Type | Description |
|---|---|
| Level[] |
MinifyJson
If TRUE, the Json is partially minified (no indentation, nor line breaks, default is FALSE)
| Type | Description |
|---|---|
| System.Boolean |
NextUid
Next Unique integer ID available
| Type | Description |
|---|---|
| System.Int32 |
PngFilePattern
File naming pattern for exported PNGs
| Type | Description |
|---|---|
| System.String |
SimplifiedExport
If TRUE, a very simplified will be generated on saving, for quicker and easier engine integration.
| Type | Description |
|---|---|
| System.Boolean |
Toc
All instances of entities that have their exportToToc flag enabled are listed in this
array.
| Type | Description |
|---|---|
| LdtkTableOfContentEntry[] |
TutorialDesc
This optional description is used by LDtk Samples to show up some informations and instructions.
| Type | Description |
|---|---|
| System.String |
UnityBgColor
| Type | Description |
|---|---|
| UnityEngine.Color | Project background color |
UnityDefaultEntitySize
| Type | Description |
|---|---|
| UnityEngine.Vector2Int | Default size for new entities |
UnityDefaultLevelBgColor
| Type | Description |
|---|---|
| UnityEngine.Color | Default background color of levels |
UnityDefaultLevelSize
| Type | Description |
|---|---|
| UnityEngine.Vector2Int | Default new level size |
UnityDefaultPivot
| Type | Description |
|---|---|
| UnityEngine.Vector2 | Default pivot (0 to 1) for new entities |
UnityWorldGridSize
| Type | Description |
|---|---|
| UnityEngine.Vector2Int | Size of the world grid in pixels. |
UnityWorlds
| Type | Description |
|---|---|
| World[] | Get the worlds, while accounting for the soon-to-be deprecated levels array in this json root if the old level array was populated instead. How worlds are formulated: https://github.com/deepnight/ldtk/wiki/%5B0.10.0%5D-Multi-worlds |
WorldGridHeight
WARNING: this field will move to the worlds array after the "multi-worlds" update.
It will then be null. You can enable the Multi-worlds advanced project option to enable
the change immediately.
Height of the world grid in pixels.
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
WorldGridWidth
WARNING: this field will move to the worlds array after the "multi-worlds" update.
It will then be null. You can enable the Multi-worlds advanced project option to enable
the change immediately.
Width of the world grid in pixels.
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
WorldLayout
WARNING: this field will move to the worlds array after the "multi-worlds" update.
It will then be null. You can enable the Multi-worlds advanced project option to enable
the change immediately.
An enum that describes how levels are organized in
this project (ie. linearly or in a 2D space). Possible values: <null>, Free,
GridVania, LinearHorizontal, LinearVertical
| Type | Description |
|---|---|
| System.Nullable<LDtkUnity.WorldLayout> |
Worlds
This array will be empty, unless you enable the Multi-Worlds in the project advanced
settings.
- in current version, a LDtk project file can only contain a single
world with multiple levels in it. In this case, levels and world layout related settings
are stored in the root of the JSON.
- with "Multi-worlds" enabled, there will be a
worlds array in root, each world containing levels and layout settings. Basically, it's
pretty much only about moving the levels array to the worlds array, along with world
layout related values (eg. worldGridWidth etc).
If you want to start
supporting this future update easily, please refer to this documentation:
https://github.com/deepnight/ldtk/issues/231
| Type | Description |
|---|---|
| World[] |
Methods
| Improve this Doc View SourceFromJson(Byte[])
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | json |
Returns
| Type | Description |
|---|---|
| LdtkJson |