nape-js API
    Preparing search index...

    Interface TilemapOptions

    Configuration options for buildTilemapBody / meshTilemap.

    interface TilemapOptions {
        body?: Body;
        bodyType?: BodyType;
        cbTypes?: CbType[];
        filter?: InteractionFilter;
        material?: Material;
        merge?: TilemapMergeMode;
        position?: Vec2;
        solid?: TilemapSolidPredicate;
        tileSize: number | TilemapTileSize;
    }
    Index

    Properties

    body?: Body

    Append shapes to this existing body instead of creating a new one. Useful for chunked maps where many tilemap layers share one body, or when adding a collision mesh to a body that already exists.

    bodyType?: BodyType

    Body type — defaults to BodyType.STATIC. Ignored when body is provided.

    cbTypes?: CbType[]

    CbTypes added to every generated shape.

    InteractionFilter applied to every generated shape.

    material?: Material

    Material applied to every generated shape.

    Merge strategy — defaults to "greedy".

    position?: Vec2

    Body position (top-left corner of the map in world space). Default (0, 0).

    Predicate deciding which cells are solid. Default treats any non-zero value as solid.

    tileSize: number | TilemapTileSize

    Tile size in pixels — either a square size or { w, h } for non-square tiles.