Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • Level

Index

Properties

__bgColor

__bgColor: string

Background color of the level (same as "bgColor", except the default value is automatically used here if its value is "null")

__bgPos

__bgPos: null | LevelBackgroundPosition

Position informations of the background image, if there is one.

__neighbours

__neighbours: NeighbourLevel[]

An array listing all other levels touching this one on the world map. In "linear" world layouts, this array is populated with previous/next levels in array, and "dir" depends on the linear horizontal/vertical layout.

bgColor

bgColor: null | string

Background color of the level. If "null", the project "defaultLevelBgColor" should be used.

bgPivotX

bgPivotX: number

Background image X pivot (0-1)

bgPivotY

bgPivotY: number

Background image Y pivot (0-1)

bgPos

bgPos: null | Contain | Cover | CoverDirty | Unscaled

An enum defining the way the background image (if any) is positioned on the level.

See "__bgPos" for resulting position info.

Possible values: "Unscaled", "Contain", "Cover", "CoverDirty"

bgRelPath

bgRelPath: null | string

The optional relative path to the level background image.

externalRelPath

externalRelPath: null | string

This value is not null if the project option "Save levels separately" is enabled.

In this case, this relative path points to the level Json file.

identifier

identifier: string

Unique string identifier

Optional layerInstances

layerInstances: undefined | LayerInstance[]

An array containing all Layer instances.

IMPORTANT: if the project option "Save levels separately" is enabled, this field will be "null".

This array is sorted in display order: the 1st layer is the top-most and the last is behind.

pxHei

pxHei: number

Height of the level in pixels

pxWid

pxWid: number

Width of the level in pixels

uid

uid: number

Unique Int identifier

worldX

worldX: number

World X coordinate in pixels

worldY

worldY: number

World Y coordinate in pixels

Generated using TypeDoc