Basic GUI API
![[basicgui]example.png](/assets/images/[basicgui]example-67e997943d1cc8e9f68222ebe9a564b2.png)
Basic GUI Objectâ
This section includes properties, functions and events for basic GUIs. Examples at Scripting examples
Constructor - new Gui(options?)â
Options:â
billBoardMode Whether the GUI should follow the user or not billBoardMode = 0 -> No billboard effect billBoardMode = 1 -> Follows the user on the X axis (default) billBoardMode = 2 -> Follows the user on the Y axis
eg: new Gui({billBoardMode:0})
Propertiesâ
ID - gui.idâ
- Returns: string, the GUI's unique id.
- Can be set. eg:
feature.id = 'myvoxId'
Uuid - gui.uuidâ
- Returns: string, the GUI's unique uuid.
feature - gui.featureâ
- Returns: Feature, the parent feature
showing - gui.showingâ
- Returns whether the GUI is shoing or not
listOfControls - gui.listOfControlsâ
- Returns: an array of guiControls.
defaultControl - gui.defaultControlâ
- Returns an example of default control.
Methodsâ
addButton(text=null,positionInGrid=[0,0],id=null) - gui.addButton('My button')â
- Arguments:
- text (optional): a string,
- Id (optional): a string,
- positionInGrid (optional): An array of 2 integers, the first integer being the row number, and the second being the column number.
- Returns: a guiControl of the button type.
addText(text=null,positionInGrid=[0,0],id=null) - gui.addtext('My text')â
- Arguments:
- text (optional): a string,
- positionInGrid (optional): An array of 2 integers, the first integer being the row number, and the second being the column number.
- Returns: a guiControl of the text type.
getControlById(id) - gui.getControlById('buttonId')â
- Arguments: a string
- Returns: a guiControl or Null
getControlByUuid(id) - gui.getControlByUuid('wdwdw-dwd-wd..')â
- Arguments: a string
- Returns: a guiControl or Null
getControlByPosition(array) - gui.getControlByUuid([1,0])â
- Arguments: an array of 2 integer.
- Returns: a guiControl or Null
show() - gui.show()â
- Returns: void
destroy() - gui.destroy()â
- Returns: void
guiControl Objectâ
This section includes properties, functions and events for basic GUIs.
Propertiesâ
gui - guiControl.guiâ
- Returns: a FeatureBasicGui object, the parent GUI
id - guiControl.idâ
- Returns: string, the guiControl's id.
- Can be set. eg:
control.id = 'myId'
Uuid - guiControl.uuidâ
- Returns: string, the guiControl's unique uuid.
type - guiControl.typeâ
- Returns: string, the type of guiControl
At the moment this can only return
buttonortext
text - guiControl.textâ
- Returns: string, the text of the Text or Button control
positionInGrid - guiControl.positionInGridâ
- Returns: an Array of 2 integers, the position of the control in a grid. Default is [0,0]
summary - guiControl.summaryâ
- Returns: an object with the basic information of the control.
- Useful for console.log in the grid
Methodsâ
update() - guiControl.update()â
Update the control.
- Returns void