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:

Operations:

OperationDescription
GuiInterface == GuiInterfaceChecks if two instances of GuiInterface refer to the same GuiInterface.

addGridItem(gui, gridName, item)

Client only

Adds an item to a grid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
tableitemThe item

addGridItemsFromFile(gui, gridName, jsonPath, additionalData)

Client only

Adds items to a grid from json

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
stringjsonPathJson file path
tableadditionalDataAdditional data to the json (Optional)

addListItem(gui, listName, itemName, data)

Client only

Appends an item to a list

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringlistNameThe name of the list
stringitemNameThe name of the item
tabledataTable of data to store

clearGrid(gui, gridName)

Client only

Clears a grid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid to clear

clearList(gui, listName)

Client only

Clears a list

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringlistNameThe name of the list

close(gui)

Client only

Close a gui interface

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface to close

createDropDown(gui, widgetName, functionName, options)

Client only

Creates a dropdown at the specified widget

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
stringfunctionNameThe name of the function
tableoptionsThe options in the dropdown menu

createGridFromJson(gui, gridName, index)

Client only

Creats a grid from a table/json

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
tableindexGrid data table { type=string, layout=string, itemWidth=integer, itemHeight=integer, itemCount=integer }

createHorizontalSlider(gui, widgetName, range, value, functionName, numbered=false)

Client only

Creates a slider at the specified widget

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
numberrangeThe range of the slider
numbervalueThe start value on the slider
stringfunctionNameSlider change callback function name
booleannumbered=falseEnable numbered steps (Defaults to false)

createVerticalSlider(gui, widgetName, range, value, functionName)

Client only

Creates a slider at the specified widget

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
numberrangeThe range of the slider
numbervalueThe start value on the slider
stringfunctionNameSlider change callback function name

destroy(gui)

Client only

Destroy a gui interface

Parameters:

TypeNameDescription
GuiInterfaceguiThe interface to destroy

isActive(gui)

Client only

Checks if a gui interface is active

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface

Returns:

TypeDescription
booleanTrue if gui is active

open(gui)

Client only

Open a gui interface

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface to open

playEffect(gui, widgetName, effectName, restart=true)

Client only

Plays an effect at a widget

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
stringeffectNameThe name of the effect
booleanrestart=trueIf the effect should restart if its already palying

playGridEffect(gui, gridName, index, effectName, restart=true)

Client only

Plays an effect at widget inside a grid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
integerindexThe index in the grid
stringeffectNameThe name of the effect
booleanrestart=trueIf 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:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringbuttonNameThe button name
stringcallbackFunction to be called when button is pressed

setButtonState(gui, buttonName, state)

Client only

Sets the button state

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringbuttonNameThe name of the button
booleanstateThe state of the button

setColor(gui, widgetName, Color)

Client only

Sets the color of a widget

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
ColorColorThe color

setContainer(gui, gridName, container)

Client only

Sets a container to a grid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
ContainercontainerThe container

setContainers(gui, gridName, containers)

Client only

Sets multiple containers to a grid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
tablecontainersTable of containers. {Container, ..}

setData(gui, widgetName, data)

Client only

Sets data to a widget

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
tabledataThe data

setFadeRange(gui, range)

Client only

Sets the fade range for a world gui

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
numberrangeThe fade range

setFocus(gui, widgetName)

Client only

Sets a widget to recieve key focus

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe 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:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringbuttonNameThe button name
stringcallbackFunction to be called when button is pressed

setGridItem(gui, gridName, index, item)

Client only

Sets an item in a grid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
integerindexThe item index
tableitemThe item

setGridItemChangedCallback(gui, gridName, callback)

Client only

Sets a callback to be called when a grid item is changed

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe grid name
stringcallbackFunction 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:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringbuttonNameThe button name
stringcallbackFunction to be called when button is pressed

setGridSize(gui, gridName, index)

Client only

Sets the size of a grid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
integerindexThe size

setHost(gui, widgetName, character, joint=nil)

Client only

Sets a Character as host for a world gui

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
CharactercharacterThe character to host the gui
stringjoint=nilThe joint (Optional)

setHost(gui, widgetName, shape, joint=nil)

Client only

Sets a Shape as host for a world gui

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
ShapeshapeThe shape to host the gui
stringjoint=nilThe joint (Optional)

setIconImage(gui, itembox, uuid)

Client only

Sets the icon image to a shape from an uuid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringitemboxThe name of the itembox
UuiduuidThe item uuid

setImage(gui, imagebox, image)

Client only

Sets the image of an imagebox

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringimageboxThe name of the imagebox widget
stringimageThe 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:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringimageboxThe name of the imagebox
stringitemResourceThe item resource
stringitemGroupThe item group
stringitemNameThe item name

setListSelectionCallback(gui, listName, callback)

Client only

Sets a callback to be called when a list selection is changed

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringlistNameThe list name
stringcallbackFunction to be called when list is selected

setMaxRenderDistance(gui, distance)

Client only

Sets the maximum render distance for a world gui

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
numberdistanceThe max render distance

setMeshPreview(gui, widgetName, uuid)

Client only

Sets a mesh preview to display an item from uuid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
UuiduuidThe item uuid to display

setOnCloseCallback(gui, callback)

Client only

Sets a callback to be called when the gui is closed

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringcallbackFunction 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:

TypeNameDescription
GuiInterfaceguiThe Gui interface
booleanrequiredTrue if gui requires line of sight to render

setSelectedDropDownItem()

Client only


setSelectedListItem(gui, listName, itemName)

Client only

Selects an item in a list

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringlistNameThe name of the list
stringitemNameThe name of the item

setSliderCallback(gui, sliderName, callback)

Client only

Sets a callback to be called when the slider is moved

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringsliderNameThe button name
stringcallbackFunction to be called when slider is moved

setSliderData(gui, sliderName, range, position)

Client only

Sets the position and range of a slider

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringsliderNameThe name of the slider
unsignedrangeThe slider range
unsignedpositionThe slider position

setSliderPosition(gui, sliderName, position)

Client only

Sets the position of a slider

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringsliderNameThe name of the slider
integerpositionThe slider position

setSliderRange(gui, sliderName, range)

Client only

Sets the slider range of a slider.

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringsliderNameThe name of the slider
integerrangeThe slider range

setSliderRangeLimit(gui, sliderName, limit)

Client only

Sets the range limit of a slider

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringsliderNameThe name of the slider
integerlimitThe slider range limit

setText(gui, textbox, text)

Client only

Sets the text caption of a textbox widget

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringtextboxThe name of the textbox widget
stringtextThe text

setTextAcceptedCallback(gui, editBoxName, callback)

Client only

Sets a callback to be called when the text change is accepted

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringeditBoxNameThe edit box name
stringcallbackFunction 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:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringeditBoxNameThe edit box name
stringcallbackFunction to be called when text is edited

setVisible(gui, widgetName, visible)

Client only

Sets a widget to be visible or not

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
booleanvisibleTrue if visible

setWorldPosition(gui, widgetName, world=nil)

Client only

Sets the world position for a world gui

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
Worldworld=nilThe world, defaults to same as the script

stopEffect(gui, widgetName, effectName, immediate=nil)

Client only

Stops an effect playing at a widget

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringwidgetNameThe name of the widget
stringeffectNameThe name of the effect
booleanimmediate=nilWhen true, the effect stops immediately (Defaults to false)

stopGridEffect(gui, gridName, index, effectName)

Client only

Stopts an effect playing inside a grid

Parameters:

TypeNameDescription
GuiInterfaceguiThe Gui interface
stringgridNameThe name of the grid
integerindexThe index in the grid
stringeffectNameThe name of the effect

trackQuest(gui, name, title, mainQuest, questTasks)

Client only

Adds a quest to the quest tracker

Parameters:

TypeNameDescription
GuiInterfaceguiThe QuestGui interface
stringnameThe name of quest
stringtitleThe quest title to be displayed in the tracker
booleanmainQuestIf the quest is a main quest (Displayed on top in the tracker)
tablequestTasksThe 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:

TypeNameDescription
GuiInterfaceguiThe QuestGui interface
stringquestNameThe name of quest