LDtkMapData

@Serializable
data class LDtkMapData(val bgColor: String, val defaultGridSize: Int, val defaultLevelBgColor: String, val defaultLevelHeight: Int, val defaultLevelWidth: Int, val defaultPivotX: Float, val defaultPivotY: Float, val defs: Definitions, val exportTiled: Boolean, val externalLevels: Boolean, val jsonVersion: String, val levelDefinitions: List<LDtkLevelDefinition>, val minifyJSON: Boolean, val nextUid: Int, val pngFilePattern: String? = null, val worldGridHeight: Int? = null, val worldGridWidth: Int? = null, val worldLayout: LDtkWorldLayout? = null, val worlds: List<LDtkWorldData> = emptyList())

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, - and a definition object (that can probably be safely ignored for most users).

Constructors

Link copied to clipboard
fun LDtkMapData(bgColor: String, defaultGridSize: Int, defaultLevelBgColor: String, defaultLevelHeight: Int, defaultLevelWidth: Int, defaultPivotX: Float, defaultPivotY: Float, defs: Definitions, exportTiled: Boolean, externalLevels: Boolean, jsonVersion: String, levelDefinitions: List<LDtkLevelDefinition>, minifyJSON: Boolean, nextUid: Int, pngFilePattern: String? = null, worldGridHeight: Int? = null, worldGridWidth: Int? = null, worldLayout: LDtkWorldLayout? = null, worlds: List<LDtkWorldData> = emptyList())

Properties

Link copied to clipboard

Project background color

Link copied to clipboard

Default grid size for new layers

Link copied to clipboard

Default background color of levels

Link copied to clipboard

Default new level height

Link copied to clipboard

Default new level width

Link copied to clipboard

Default X pivot (0 to 1) for new entities

Link copied to clipboard

Default Y pivot (0 to 1) for new entities

Link copied to clipboard

A structure containing all the definitions of this project

Link copied to clipboard

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

Link copied to clipboard

If TRUE, one file will be saved for the project (incl. all its definitions) and one file in a sub-folder for each level.

Link copied to clipboard

File format version

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Next Unique integer ID available

Link copied to clipboard
val pngFilePattern: String? = null

File naming pattern for exported PNGs

Link copied to clipboard
val worldGridHeight: Int? = null

Height of the world grid in pixels.

Link copied to clipboard
val worldGridWidth: Int? = null

Width of the world grid in pixels.

Link copied to clipboard

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

Link copied to clipboard

This list isn't used yet in LDtk (so for now it's always empty).