API Documentation

for 0.0.1
Show:

ButtonGroup Class

ButtonGroup organize an array of Buttons with different layout patterns. Make it easier to build menu.

Constructor

ButtonGroup

(
  • params
)

Parameters:

  • params Object

    Parameters object.

    • row Number

      for grid based layout, the maximum nb of rows

    • columns Number

      for grid based layout, the maximum nb of columns

    • mode String

      layout mode. One of grid, honeycomb

    • buttons Array

      The list of buttons to layout.

Example:

//TODO

Item Index

Methods

organize

(
  • mode
)
private

Generic organize method to switch between various layout modes

Parameters:

  • mode String

    grid, HoneyComb (for HoneyComb layout)

organizeGrid

(
  • columns
)
Array private

Organize the buttons to place in the grid. Each button is associated to an index.

Parameters:

  • columns Number

Returns:

Array:

indices List of objects like this: {index:i,position: new Vector3(), isTop: false, isBottom: false, isLeft: false, isRight: false}, that will help to compute positions and Mesh deformations

positionGrid

(
  • indices
)
private

Compute position and set position flags for each button

Parameters:

  • indices Array

    given from organizeGrid