GuiInterface
A userdata object representing a GUI interface.
A gui interface is an adapter between a script and a GUI.
Can only be used on the client.
Functions:
- addGridItem
- addGridItemsFromFile
- addListItem
- addToPickupDisplay
- clearGrid
- clearList
- close
- createDropDown
- createGridFromJson
- createHorizontalSlider
- createVerticalSlider
- destroy
- isActive
- open
- playEffect
- playGridEffect
- setButtonCallback
- setButtonState
- setColor
- setContainer
- setContainers
- setData
- setFadeRange
- setFocus
- setGridButtonCallback
- setGridItem
- setGridItemChangedCallback
- setGridMouseFocusCallback
- setGridSize
- setHost
- setHost
- setIconImage
- setImage
- setItemIcon
- setListSelectionCallback
- setMaxRenderDistance
- setMeshPreview
- setOnCloseCallback
- setRequireLineOfSight
- setSelectedDropDownItem
- setSelectedListItem
- setSliderCallback
- setSliderData
- setSliderPosition
- setSliderRange
- setSliderRangeLimit
- setText
- setTextAcceptedCallback
- setTextChangedCallback
- setVisible
- setWorldPosition
- stopEffect
- stopGridEffect
- trackQuest
- untrackQuest
Operations:
Operation | Description |
---|---|
GuiInterface == GuiInterface | Checks if two instances of GuiInterface refer to the same GuiInterface. |
addGridItem(gui, gridName, item)
Client only
Adds an item to a grid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
table | item | The item |
addGridItemsFromFile(gui, gridName, jsonPath, additionalData)
Client only
Adds items to a grid from json
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
string | jsonPath | Json file path |
table | additionalData | Additional data to the json (Optional) |
addListItem(gui, listName, itemName, data)
Client only
Appends an item to a list
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | listName | The name of the list |
string | itemName | The name of the item |
table | data | Table of data to store |
addToPickupDisplay(gui, uuid, amount)
Client only
Adds an item to the item pickup display
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The players survival hud interface |
[uuid] | uuid | The item uuid |
number | amount | Quantity of items picked up |
clearGrid(gui, gridName)
Client only
Clears a grid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid to clear |
clearList(gui, listName)
Client only
Clears a list
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | listName | The name of the list |
close(gui)
Client only
Close a gui interface
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface to close |
createDropDown(gui, widgetName, functionName, options)
Client only
Creates a dropdown at the specified widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
string | functionName | The name of the function |
table | options | The options in the dropdown menu |
createGridFromJson(gui, gridName, index)
Client only
Creats a grid from a table/json
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
table | index | Grid data table { type=string, layout=string, itemWidth=integer, itemHeight=integer, itemCount=integer } |
createHorizontalSlider(gui, widgetName, range, value, functionName, numbered=false, inverted=false)
Client only
Creates a slider at the specified widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
number | range | The range of the slider |
number | value | The start value on the slider |
string | functionName | Slider change callback function name |
boolean | numbered=false | Enable numbered steps (Defaults to false) |
boolean | inverted=false | Invert slider direction |
createVerticalSlider(gui, widgetName, range, value, functionName)
Client only
Creates a slider at the specified widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
number | range | The range of the slider |
number | value | The start value on the slider |
string | functionName | Slider change callback function name |
destroy(gui)
Client only
Destroy a gui interface
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The interface to destroy |
isActive(gui)
Client only
Checks if a gui interface is active
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
Returns:
Type | Description |
---|---|
boolean | True if gui is active |
open(gui)
Client only
Open a gui interface
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface to open |
playEffect(gui, widgetName, effectName, restart=true)
Client only
Plays an effect at a widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
string | effectName | The name of the effect |
boolean | restart=true | If the effect should restart if its already playing |
playGridEffect(gui, gridName, index, effectName, restart=true)
Client only
Plays an effect at widget inside a grid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
integer | index | The index in the grid |
string | effectName | The name of the effect |
boolean | restart=true | If the effect should restart if its already palying |
setButtonCallback(gui, buttonName, callback)
Client only
Sets a button callback to be called when the button is pressed
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | buttonName | The button name |
string | callback | Function to be called when button is pressed |
setButtonState(gui, buttonName, state)
Client only
Sets the button state
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | buttonName | The name of the button |
boolean | state | The state of the button |
setColor(gui, widgetName, Color)
Client only
Sets the color of a widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
Color | Color | The color |
setContainer(gui, gridName, container)
Client only
Sets a container to a grid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
Container | container | The container |
setContainers(gui, gridName, containers)
Client only
Sets multiple containers to a grid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
table | containers | Table of containers. {Container, ..} |
setData(gui, widgetName, data)
Client only
Sets data to a widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
table | data | The data |
setFadeRange(gui, range)
Client only
Sets the fade range for a world gui
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
number | range | The fade range |
setFocus(gui, widgetName)
Client only
Sets a widget to recieve key focus
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget that needs focus |
setGridButtonCallback(gui, buttonName, callback)
Client only
Sets a callback to be called when a button inside a grid is pressed
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | buttonName | The button name |
string | callback | Function to be called when button is pressed |
setGridItem(gui, gridName, index, item)
Client only
Sets an item in a grid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
integer | index | The item index |
table | item | The item |
setGridItemChangedCallback(gui, gridName, callback)
Client only
Sets a callback to be called when a grid item is changed
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The grid name |
string | callback | Function to be called when button is pressed |
setGridMouseFocusCallback(gui, buttonName, callback)
Client only
Sets a callback to be called when a grid widget gets mouse focus
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | buttonName | The button name |
string | callback | Function to be called when button is pressed |
setGridSize(gui, gridName, index)
Client only
Sets the size of a grid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
integer | index | The size |
setHost(gui, widgetName, character, joint=nil)
Client only
Sets a Character as host for a world gui
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
Character | character | The character to host the gui |
string | joint=nil | The joint (Optional) |
setHost(gui, widgetName, shape, joint=nil)
Client only
Sets a Shape as host for a world gui
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
Shape | shape | The shape to host the gui |
string | joint=nil | The joint (Optional) |
setIconImage(gui, itembox, uuid)
Client only
Sets the icon image to a shape from an uuid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | itembox | The name of the itembox |
Uuid | uuid | The item uuid |
setImage(gui, imagebox, image)
Client only
Sets the image of an imagebox
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | imagebox | The name of the imagebox widget |
string | image | The name or path of the image |
setItemIcon(gui, imagebox, itemResource, itemGroup, itemName)
Client only
Sets the resource, group and item name on an imagebox widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | imagebox | The name of the imagebox |
string | itemResource | The item resource |
string | itemGroup | The item group |
string | itemName | The item name |
setListSelectionCallback(gui, listName, callback)
Client only
Sets a callback to be called when a list selection is changed
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | listName | The list name |
string | callback | Function to be called when list is selected |
setMaxRenderDistance(gui, distance)
Client only
Sets the maximum render distance for a world gui
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
number | distance | The max render distance |
setMeshPreview(gui, widgetName, uuid)
Client only
Sets a mesh preview to display an item from uuid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
Uuid | uuid | The item uuid to display |
setOnCloseCallback(gui, callback)
Client only
Sets a callback to be called when the gui is closed
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | callback | Function to be called when gui is closed |
setRequireLineOfSight(gui, required)
Client only
Sets if a world gui requires line of sight to be shown
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
boolean | required | True if gui requires line of sight to render |
setSelectedDropDownItem()
Client only
setSelectedListItem(gui, listName, itemName)
Client only
Selects an item in a list
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | listName | The name of the list |
string | itemName | The name of the item |
setSliderCallback(gui, sliderName, callback)
Client only
Sets a callback to be called when the slider is moved
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | sliderName | The button name |
string | callback | Function to be called when slider is moved |
setSliderData(gui, sliderName, range, position)
Client only
Sets the position and range of a slider
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | sliderName | The name of the slider |
unsigned | range | The slider range |
unsigned | position | The slider position |
setSliderPosition(gui, sliderName, position)
Client only
Sets the position of a slider
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | sliderName | The name of the slider |
integer | position | The slider position |
setSliderRange(gui, sliderName, range)
Client only
Sets the slider range of a slider.
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | sliderName | The name of the slider |
integer | range | The slider range |
setSliderRangeLimit(gui, sliderName, limit)
Client only
Sets the range limit of a slider
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | sliderName | The name of the slider |
integer | limit | The slider range limit |
setText(gui, textbox, text)
Client only
Sets the text caption of a textbox widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | textbox | The name of the textbox widget |
string | text | The text |
setTextAcceptedCallback(gui, editBoxName, callback)
Client only
Sets a callback to be called when the text change is accepted
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | editBoxName | The edit box name |
string | callback | Function to be called when text is committed |
setTextChangedCallback(gui, editBoxName, callback)
Client only
Sets a callback to be called when the text is changed
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | editBoxName | The edit box name |
string | callback | Function to be called when text is edited |
setVisible(gui, widgetName, visible)
Client only
Sets a widget to be visible or not
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
boolean | visible | True if visible |
setWorldPosition(gui, widgetName, world=nil)
Client only
Sets the world position for a world gui
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
World | world=nil | The world, defaults to same as the script |
stopEffect(gui, widgetName, effectName, immediate=nil)
Client only
Stops an effect playing at a widget
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | widgetName | The name of the widget |
string | effectName | The name of the effect |
boolean | immediate=nil | When true, the effect stops immediately (Defaults to false) |
stopGridEffect(gui, gridName, index, effectName)
Client only
Stopts an effect playing inside a grid
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The Gui interface |
string | gridName | The name of the grid |
integer | index | The index in the grid |
string | effectName | The name of the effect |
trackQuest(gui, name, title, mainQuest, questTasks)
Client only
Adds a quest to the quest tracker
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The QuestGui interface |
string | name | The name of quest |
string | title | The quest title to be displayed in the tracker |
boolean | mainQuest | If the quest is a main quest (Displayed on top in the tracker) |
table | questTasks | The table of quest tasks to display in the log Task{ name = string, text = string, count = number, target = number, complete = boolean } |
untrackQuest(gui, questName)
Client only
Removes a quest from the quest tracker
/
Parameters:
Type | Name | Description |
---|---|---|
GuiInterface | gui | The QuestGui interface |
string | questName | The name of quest |