Show / Hide Table of Contents

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 Source

AppBuildId

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
| Improve this Doc View Source

BackupLimit

Number of backup files to keep, if the backupOnSave is TRUE

Type Description
System.Int32
| Improve this Doc View Source

BackupOnSave

If TRUE, an extra copy of the project will be created in a sub folder, when saving.

Type Description
System.Boolean
| Improve this Doc View Source

BackupRelPath

Target relative path to store backup files

Type Description
System.String
| Improve this Doc View Source

BgColor

Project background color

Type Description
System.String
| Improve this Doc View Source

CustomCommands

An array of command lines that can be ran manually by the user

Type Description
LdtkCustomCommand[]
| Improve this Doc View Source

DefaultEntityHeight

Default height for new entities

Type Description
System.Int32
| Improve this Doc View Source

DefaultEntityWidth

Default width for new entities

Type Description
System.Int32
| Improve this Doc View Source

DefaultGridSize

Default grid size for new layers

Type Description
System.Int32
| Improve this Doc View Source

DefaultLevelBgColor

Default background color of levels

Type Description
System.String
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

DefaultPivotX

Default X pivot (0 to 1) for new entities

Type Description
System.Single
| Improve this Doc View Source

DefaultPivotY

Default Y pivot (0 to 1) for new entities

Type Description
System.Single
| Improve this Doc View Source

Defs

A structure containing all the definitions of this project

Type Description
Definitions
| Improve this Doc View Source

DummyWorldIid

If the project isn't in MultiWorlds mode, this is the IID of the internal "dummy" World.

Type Description
System.String
| Improve this Doc View Source

ExportLevelBg

If TRUE, the exported PNGs will include the level background (color or image).

Type Description
System.Boolean
| Improve this Doc View Source

ExportPng

WARNING: this deprecated value is no longer exported since version 0.9.3 Replaced by: imageExportMode

Type Description
System.Nullable<System.Boolean>
| Improve this Doc View Source

ExportTiled

If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file (default is FALSE)

Type Description
System.Boolean
| Improve this Doc View Source

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
| Improve this Doc View Source

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[]
| Improve this Doc View Source

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
| Improve this Doc View Source

IdentifierStyle

Naming convention for Identifiers (first-letter uppercase, full uppercase etc.) Possible values: Capitalize, Uppercase, Lowercase, Free

Type Description
LDtkUnity.IdentifierStyle
| Improve this Doc View Source

Iid

Unique project identifier

Type Description
System.String
| Improve this Doc View Source

ImageExportMode

"Image export" option when saving project. Possible values: None, OneImagePerLayer, OneImagePerLevel, LayersAndLevels

Type Description
LDtkUnity.ImageExportMode
| Improve this Doc View Source

JsonVersion

File format version

Type Description
System.String
| Improve this Doc View Source

LevelNamePattern

The default naming convention for level identifiers.

Type Description
System.String
| Improve this Doc View Source

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[]
| Improve this Doc View Source

MinifyJson

If TRUE, the Json is partially minified (no indentation, nor line breaks, default is FALSE)

Type Description
System.Boolean
| Improve this Doc View Source

NextUid

Next Unique integer ID available

Type Description
System.Int32
| Improve this Doc View Source

PngFilePattern

File naming pattern for exported PNGs

Type Description
System.String
| Improve this Doc View Source

SimplifiedExport

If TRUE, a very simplified will be generated on saving, for quicker and easier engine integration.

Type Description
System.Boolean
| Improve this Doc View Source

Toc

All instances of entities that have their exportToToc flag enabled are listed in this array.

Type Description
LdtkTableOfContentEntry[]
| Improve this Doc View Source

TutorialDesc

This optional description is used by LDtk Samples to show up some informations and instructions.

Type Description
System.String
| Improve this Doc View Source

UnityBgColor

Type Description
UnityEngine.Color

Project background color

| Improve this Doc View Source

UnityDefaultEntitySize

Type Description
UnityEngine.Vector2Int

Default size for new entities

| Improve this Doc View Source

UnityDefaultLevelBgColor

Type Description
UnityEngine.Color

Default background color of levels

| Improve this Doc View Source

UnityDefaultLevelSize

Type Description
UnityEngine.Vector2Int

Default new level size

| Improve this Doc View Source

UnityDefaultPivot

Type Description
UnityEngine.Vector2

Default pivot (0 to 1) for new entities

| Improve this Doc View Source

UnityWorldGridSize

Type Description
UnityEngine.Vector2Int

Size of the world grid in pixels.

| Improve this Doc View Source

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

| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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 Source

FromJson(Byte[])

Parameters
Type Name Description
System.Byte[] json
Returns
Type Description
LdtkJson
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX