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

Properties

Property NameReturn TypeDescriptionTags
jstableAccess the underlying models in the widgetRead-Write
visiblebooleanSet or get the visibility of this widgetRead-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
© 2021 CraytaKit