melonJS
    Preparing search index...

    Interface LDtkObjectSettings

    what an entity's class is given: the entity as placed in LDtk

    interface LDtkObjectSettings {
        anchorPoint: { x: number; y: number };
        class: string;
        color?: string;
        fields: Record<string, unknown>;
        height: number;
        id: string;
        iid: string;
        image?: unknown;
        layer: string;
        level: string;
        name: string;
        pivot: { x: number; y: number };
        px: { x: number; y: number };
        region?: unknown;
        tags: string[];
        tileRect?: ObjectTile;
        type: string;
        width: number;
        x: number;
        y: number;
        z: number;
        [field: string]: unknown;
    }

    Indexable

    • [field: string]: unknown
    Index
    anchorPoint: { x: number; y: number }

    a box is placed by its top left corner

    class: string

    the same identifier

    color?: string

    the color LDtk shows the entity in, as #rrggbb

    fields: Record<string, unknown>

    the entity's custom fields, by name (also copied onto the settings, where the name is free)

    height: number

    the height of the entity's box, in pixels

    id: string

    the entity's unique id in LDtk

    iid: string

    the entity's unique id in LDtk

    image?: unknown

    With a tile: a texture atlas over its tileset's image, which with region is what a Sprite is made from, so a class extending Sprite can hand the settings to its constructor. Without one, a field named image is found here, as any field is.

    layer: string

    the identifier of the layer the entity is in

    level: string

    the identifier of the level the entity is in

    name: string

    the entity's identifier in LDtk: what a class is registered under

    pivot: { x: number; y: number }

    where the entity's pivot is in its box, each from 0 to 1

    px: { x: number; y: number }

    where the entity's pivot is: the point LDtk places it by

    region?: unknown

    with a tile: the name of its region in image

    tags: string[]

    the entity's tags in LDtk

    tileRect?: ObjectTile

    the tile LDtk draws the entity with, if its tileset has an image

    type: string

    the same identifier

    width: number

    the width of the entity's box, in pixels

    x: number

    the left edge of the entity's box, in the container the level was added to

    y: number

    the top edge of the entity's box

    z: number

    the draw order of the entity's layer