Widget | CraytaKit
Skip to main content

Widget

Functions

Function NameReturn TypeDescriptionTags
Show()NoneShow the widgetNone
Hide()NoneHide the widgetNone
CallFunction(string functionName, ...)NoneCall the names functioned on the widgetNone
GetProperties()PropertiesAlternative to properties, this gets the bag of values produced from the property editor for this script on this Entity. The properties are defined by the static Properties table on the table returned by the Lua script.None

Properties

Property NameReturn TypeDescriptionTags
jstableAccess the underlying models in the widgetRead-Write
visiblebooleanSet or get the visibility of this widgetRead-Write
propertiesPropertiesGet the widget propertiesRead-Write
requiresCursorbooleanWhether or not the widget requires a cursorRead-Write
ordernumberThe order the widget should be drawn relative to other widgetsRead-Write

Overrides

Override NameReturn TypeDescriptionTags
indexobjectGet widget dataNone
new_indexobjectSet widget datanone

Examples

CallFunction

CallFunction lets you call frontend functions directly from your lua scripts. Doing so requires the function to be registered with the engine.

engine.on("SayHello", name => {
console.log(`Hello, ${name}!`);
})
function ExampleScript:SayHello()
self:GetEntity().helloWidget:CallFunction("SayHello", "Jane") -- The client will log "Hello, Jane!"
end
© 2024 CraytaKit