Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PlanarGridLayout

Lay out actors in a grid along the root actor's local XY plane. Assign actors to the grid with addCell, and apply updates with applyLayout.

Hierarchy

  • PlanarGridLayout

Index

Constructors

constructor

  • Initialize a new grid layout.

    Parameters

    • anchor: Actor

      The grid's anchor actor, the point to which the grid is aligned.

    • Default value gridAlignment: BoxAlignment = BoxAlignment.MiddleCenter

      How the grid should be aligned to its anchor, where BoxAlignment.TopLeft will place the grid above and to the left of the anchor, and the lower right corner will touch the anchor.

    • Default value defaultCellAlignment: BoxAlignment = BoxAlignment.MiddleCenter

      How cells should be aligned by default.

    Returns PlanarGridLayout

Properties

defaultCellAlignment

defaultCellAlignment: BoxAlignment

How cells should be aligned by default.

gridAlignment

gridAlignment: BoxAlignment

How the grid should be aligned to its anchor, where BoxAlignment.TopLeft will place the grid above and to the left of the anchor, and the lower right corner will touch the anchor.

Methods

addCell

applyLayout

  • applyLayout(animateDuration?: number, animateCurve?: [number, number, number, number]): void
  • Recompute the positions of all actors in the grid.

    Parameters

    • Default value animateDuration: number = 0
    • Default value animateCurve: [number, number, number, number] = AnimationEaseCurves.EaseOutQuadratic

    Returns void

getColumnCount

  • getColumnCount(): number

getColumnWidth

  • getColumnWidth(i: number): number

getColumnWidths

  • getColumnWidths(): number[]

getGridHeight

  • getGridHeight(): number

getGridWidth

  • getGridWidth(): number

getRowCount

  • getRowCount(): number

getRowHeight

  • getRowHeight(i: number): number

getRowHeights

  • getRowHeights(): number[]