neon_crisp / Modules / utils/buttonManager / GuiButtonManager
Class: GuiButtonManager
utils/buttonManager.GuiButtonManager
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new GuiButtonManager(): GuiButtonManager
Returns
Defined in
Properties
buttons
• buttons: { cb: () => void ; node: node }[]
Defined in
Methods
handleClicks
▸ handleClicks(action_id, action): boolean
the main loop to call your buttons when called should be added to on_input
Parameters
| Name | Type |
|---|---|
action_id | hash |
action | Action |
Returns
boolean
Example
buttonManager.handleClicks(action_id, action)
Defined in
manageButton
▸ manageButton(node, cb): void
Add a button you want to manager to the class
Parameters
| Name | Type |
|---|---|
node | node |
cb | () => void |
Returns
void
Example
const buttonManager = new GuiButtonManager()
const button = gui.get_node("roll")
buttonManager.manageButton(handPrefab, () => this.gameState.roll())
Defined in
remove
▸ remove(node): void
Remove a button from the manager
Parameters
| Name | Type |
|---|---|
node | node |
Returns
void
Example
const buttonManager = new GuiButtonManager()
const button = gui.get_node("roll")
buttonManager.remove(handPrefab)