Repository

ButtonGroup

Extends:

Component → ButtonGroup

Constructor Summary

Public Constructor
public

ButtonGroup organize an array of Buttons with different layout patterns.

Member Summary

Public Members
public
public
public
public

mode: *

public
public
public

root: *

public
public

Method Summary

Public Methods
public

compute the size of this button group by calculation

public

positionHoneyComb(indices: *, offsetType: *)

public
public
Private Methods
private

Generic organize method to switch between various layout modes

private

Organize the buttons to place in the grid.

private

positionGrid(indices: Array)

Compute position and set position flags for each button

Inherited Summary

From class Component
public
public
public

events: *

public

id: *

public

name: *

private

_nexts: *[]

private
public
public

chain(component: Component)

Adds a component to this chained component array

public

Returns the array of attached children components

public

off()

Deactivate the component

public

on()

Activate the component A call to this method calls the setup method if it has not been run yet

public

Run code after the update of all components is run This empty method is usually overriden to perform post-update actions for the component It is called periodically by an internal Mobilizing mechanism

public

preLoad the component This empty method is usually overriden to perform preLoad actions for the component.

public

Run code before the update of all components is run This empty method is usually overriden to perform pre-update actions for the component It is called once per component by an internal Mobilizing mechanism

public

prepare the component This empty method is usually overriden to perform preparation actions for the component, from external process as a server.

public

Set's up the component This empty method is usually overriden to perform setup actions for the component This is where all the initialization (such as adding event listeners)should be done It is called automatically by an internal Mobilizing mechanism and should thus not be called directly

public

Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism

Public Constructors

public constructor(params: Object) source

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

Override:

Component#constructor

Params:

NameTypeAttributeDescription
paramsObject

Parameters object.

params.rowNumber

for grid based layout, the maximum nb of rows

params.columnsNumber

for grid based layout, the maximum nb of columns

params.modeString

layout mode. One of grid, honeycomb

params.buttonsArray

The list of buttons to layout.

Example:

    //TODO

Public Members

public buttons: * source

public columns: * source

public height: number source

public mode: * source

public offsetType: * source

public orderedIndices: *[] source

public root: * source

public transform: * source

public width: number source

Public Methods

public computeSize() source

compute the size of this button group by calculation

public positionHoneyComb(indices: *, offsetType: *) source

Params:

NameTypeAttributeDescription
indices*
offsetType*

public renderGrid() source

public renderHoneyComb() source

Private Methods

private organize(mode: String) source

Generic organize method to switch between various layout modes

Params:

NameTypeAttributeDescription
modeString

grid, HoneyComb (for HoneyComb layout)

private organizeGrid(columns: Number): Array source

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

Params:

NameTypeAttributeDescription
columnsNumber

Return:

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

private positionGrid(indices: Array) source

Compute position and set position flags for each button

Params:

NameTypeAttributeDescription
indicesArray

given from organizeGrid