Show / Hide Table of Contents

Namespace LDtkUnity

Classes

AutoLayerRuleDefinition

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.

AutoLayerRuleGroup

Definitions

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.

A structure containing all the definitions of this project

EntityDefinition

Json Definition Data

EntityInstance

Json Instance Data

EnumDefinition

Json Definition Data

EnumValueDefinition

Json Definition Data

FieldDefinition

This section is mostly only intended for the LDtk editor app itself. You can safely ignore it.

FieldInstance

Json Instance Data

GridPoint

This object is just a grid-based coordinate used in Field values.

IntGridValueDefinition

IntGrid value definition

IntGridValueGroupDefinition

IntGrid value group definition

LayerDefinition

Json Definition Data

LayerInstance

Json Instance Data

LDtkArtifactAssets

Stores the autogenerated sprites for level backgrounds.

LDtkArtifactAssetsTileset

Stores the autogenerated tiles/sprites for tilesets.

LDtkComponentEntity

This component can be used to get certain LDtk information of an entity instance. Accessible from entity GameObjects.

LDtkComponentLayer

This component can be used to get certain LDtk information of a layer instance. Accessible from layer GameObjects.

LDtkComponentLayerIntGridValues

Use for checking IntGrid values. The coordinates are usable for it's respective tilemaps. Accessible from IntGrid layer GameObjects.

LDtkComponentLayerParallax

Mimics the parallax implementation from LDtk. If you want something more customized than this, make a custom implementation of parallax. But this should be able to suit most needs.

LDtkComponentLayerTilesetTiles

LDtkComponentLevel

This component can be used to get certain LDtk information of a level. Accessible from level GameObjects.

LDtkComponentProject

A component available in the import result's root GameObject. Reference this to access the json data.

LDtkComponentWorld

This component can be used to get certain LDtk information of a world.

LdtkCustomCommand

LDtkDefinitionObjectAutoLayerRule

LDtkDefinitionObjectAutoLayerRuleGroup

LDtkDefinitionObjectCommand

LDtkDefinitionObjectEntity

LDtkDefinitionObjectEnum

LDtkDefinitionObjectEnumValue

LDtkDefinitionObjectField

LDtkDefinitionObjectIntGridValue

LDtkDefinitionObjectIntGridValueGroup

LDtkDefinitionObjectLayer

LDtkDefinitionObjectTileset

LDtkFields

This is a component that stores the field instances for entities/levels, Conveniently converted for use in Unity.

LDtkIid

This component contains a unique identifier, usable for referencing in runtime.

LDtkIidBank

Responsible for holding onto LDtk iid references so that they are easily accessible by instance classes.

LDtkIidComponentBank

Unlike LDtkIidBank, this contains components in the scene, and used for referencing in runtime.
This is also fully accessible during the import process. Note: If there are duplicated instances of a GameObject with an iid component, it may result in inconsistent references.

LDtkIntGridTile

The tile used for IntGridValues in LDtk. Not AutoLayers and Tile layers.
Inherit from this for more custom functionality if required.

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).

LDtkKeyFormatUtil

A utility class used in conjunction with LDtkArtifactAssets to get certain assets by name.

LDtkLevelFile

The imported level file. (.ldtkl)
Available when saving levels as separate files in LDtk. Reference this to access the json data.

LDtkNeighbour

LDtkProjectFile

The imported project file, available in the the import result. Reference this to access the json data.

LDtkReferenceToAnEntityInstance

This object describes the "location" of an Entity instance in the project worlds.

LdtkTableOfContentEntry

LDtkTableOfContents

The table of contents is generated when any entities are included in it from LDtk. Use it to quickly refer to a certain entity type in a level.

LDtkTableOfContentsEntry

LDtkTableOfContentsEntryData

LDtkTilesetDefinitionWrapper

A wrapper on the TilesetDefinition that contains some additional data in order to independently import certain tiles related to this tileset definition. We're making this because it's harder to generate an asset and additionally set it's importer's bonus metadata in the same pass. So we're writing our own text instead to provide that data.

LDtkTilesetFile

The imported level file. (.ldtkt)
This is generated by the importer. Reference this to access the json data.

LDtkTilesetTile

The tile used for AutoLayers and Tile layers in LDtk. It can have collision shapes configured from the tileset file's sprite editor.

LdtkTocInstanceData

LDtkUidBank

Responsible for holding onto LDtk definitions so that they are easily accessible by instance classes.

Level

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.

LevelBackgroundPosition

Level background image position info

NeighbourLevel

Nearby level info

ReferenceToAnEntityInstance

This object describes the "location" of an Entity instance in the project worlds.

IID information of this instance

TileInstance

This structure represents a single tile from a given Tileset.

TilesetDefinition

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.

TilesetRectangle

This object represents a custom sub rectangle in a Tileset image.

World

IMPORTANT: this type is available as a preview. You can rely on it to update your importers, for when it will be officially available. A World contains multiple levels, and it has its own layout settings.

Structs

LDtkTilesetDefinitionWrapper.TilesetRect

Interfaces

ILDtkImported

Base interface for the import interfaces. Don't inherit from this directly.

ILDtkImportedEntity

Applicable for entity prefabs only.
Use this interface on a entity's prefab components to access the entity instance's data during the import process.

ILDtkImportedFields

Applicable for both entity prefabs and the level prefab.
Use this interface on entity/level components to access the field instances of the entity/level.

ILDtkImportedLayer

Applicable for entity prefabs only.
Use this interface on an entity's prefab components to access the layer of this entity instance during the import process.

ILDtkImportedLevel

Applicable for the level prefab only.
Use this interface on a level's prefab components to access the level's data during the import process.

ILDtkImportedSortingOrder

Applicable for entity prefabs only.
This passes in an int that represents the sorting order to set.
The sorting order value is automatically determined by the layer generation.
Use this interface for setting a renderer's sorting order if applicable. ex. Renderer, SpriteRenderer, SortingGroup, etc.

Enums

EditorLinkStyle

Possible values: ZigZag, StraightArrow, CurvedArrow, ArrowsLine, DashedLine

When

Possible values: Manual, AfterLoad, BeforeSave, AfterSave

In This Article
Back to top Generated by DocFX