melonJS
    Preparing search index...

    Class LDtkLevel

    A level of an LDtk project, as the level director holds it: level.getCurrentLevel() once it is loaded. It is loaded by its id, the project's name and the level's identifier: level.load("world:Level_0").

    Hierarchy

    • LDtkMap
      • LDtkLevel
    Index
    backgroundcolor: string

    the level's background color, as #rrggbb

    cols: number = 0

    its width in cells of the project's default grid

    container: Container | undefined

    the container it was added to, while it is loaded

    fields: Record<string, unknown>

    the level's custom fields, by name

    format: "ldtk"

    the format's name, as registered with the level director

    height: number = 0

    its height, in pixels

    identifier: string

    the level's identifier in LDtk

    the level, and where it stands in its world

    layers: Renderable[] = []

    its tile layers, once it is loaded: TileLayer and PlacedTileLayer

    name: string

    the id it is loaded by: level.load(name)

    orientation: "orthogonal"

    the grid is square

    project: LDtkProject

    the project the level or the world belongs to

    rows: number = 0

    its height in cells of the project's default grid

    stayed: Map<string, Renderable> = ...

    the persistent entities that stayed when their level was taken out, by their unique id in LDtk

    tileheight: number

    the size of a cell of the project's default grid, in pixels

    tilewidth: number

    the size of a cell of the project's default grid, in pixels

    width: number = 0

    its width, in pixels

    x: number = 0

    its left edge in the container it is added to, in pixels: 0 for a level, LDtk's world coordinate for a world

    y: number = 0

    its top edge in the container it is added to, in pixels

    • add the level or the world to the container, as a Tiled map is

      Parameters

      • container: Container

        the container

      • options: LDtkLoadOptions

        LDtk's load options

      • backgroundColor: string

        the color behind it

      • add: () => void

        adds its layers, bodies and entities

      Returns void