widgets.watch

Observes an exact reflected widget property.

Syntax

ue.widgets.watch(widget: UObjectProxy, property: string, callback: function, options?: table) -> integer?, string?

Parameters

ParameterTypeDescription
widgetUObjectProxyWidget to observe.
propertystringExact reflected property name.
callbackfunction(value, old_value, widget, id, name)Called when the value changes.
options.immediateboolean?Deliver current state on the next tick.

Returns

TypeDescription
integerWatch ID.
nil, stringProperty could not be read.

Example

local id = assert(ue.widgets.watch(
    widget,
    "Visibility",
    function(value, old_value)
        print(old_value, value)
    end
))

Notes

  • Requires a persistent session.

On this page