Skip to main content

neon_crisp / Modules / utils/buttonManager / GuiButtonManager

Class: GuiButtonManager

utils/buttonManager.GuiButtonManager

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new GuiButtonManager(): GuiButtonManager

Returns​

GuiButtonManager

Defined in​

utils/buttonManager.ts:11

Properties​

buttons​

• buttons: { cb: () => void ; node: node }[]

Defined in​

utils/buttonManager.ts:10

Methods​

handleClicks​

▸ handleClicks(action_id, action): boolean

the main loop to call your buttons when called should be added to on_input

Parameters​

NameType
action_idhash
actionAction

Returns​

boolean

Example

buttonManager.handleClicks(action_id, action)

Defined in​

utils/buttonManager.ts:50


manageButton​

▸ manageButton(node, cb): void

Add a button you want to manager to the class

Parameters​

NameType
nodenode
cb() => void

Returns​

void

Example

const buttonManager = new GuiButtonManager()
const button = gui.get_node("roll")
buttonManager.manageButton(handPrefab, () => this.gameState.roll())

Defined in​

utils/buttonManager.ts:41


remove​

▸ remove(node): void

Remove a button from the manager

Parameters​

NameType
nodenode

Returns​

void

Example

const buttonManager = new GuiButtonManager()
const button = gui.get_node("roll")
buttonManager.remove(handPrefab)

Defined in​

utils/buttonManager.ts:25