weasel API - v0.8.0
    Preparing search index...

    Interface TileGridOptions<TPose>

    interface TileGridOptions<TPose> {
        cols: number;
        gap?: number;
        rows: number;
        snap?: LayoutSnap<TPose>;
        cellToPose?(
            cellRect: { height: number; width: number; x: number; y: number },
            dragged: TPose,
        ): TPose;
    }

    Type Parameters

    • TPose
    Index

    Properties

    Methods

    Properties

    cols: number
    gap?: number

    Gap between cells, in world units. Default 0.

    rows: number

    Methods

    • Optional: map a cell rect + the dragged pose to the new pose. Default writes { x, y, width, height } into the dragged pose (assumes RectPose). Override for point-only poses or other shapes. The dragged argument is the pre-drop pose of the child being placed — use it to preserve fields the cell rect doesn't carry (e.g. rotation, domain metadata).

      Parameters

      • cellRect: { height: number; width: number; x: number; y: number }
      • dragged: TPose

      Returns TPose