widgets.bind_native

Connects a native widget delegate to an existing receiver UFunction and observes it from Lua.

Syntax

ue.widgets.bind_native(control: UObjectProxy, delegate: string, receiver: UObjectProxy, function_name: string, callback: function) -> integer?, integer? | nil, string

Parameters

ParameterTypeDescription
controlUObjectProxyWidget that owns the delegate.
delegatestringExact delegate property name.
receiverUObjectProxyObject with a compatible receiver UFunction.
function_namestringExact receiver UFunction name.
callbackfunction(receiver, params)Lua observer for the receiver call.

Returns

TypeDescription
integer, integerNative binding ID and Lua subscription ID.
nil, stringDelegate, receiver, or signature validation failed.

Example

local native_id, subscription_id = assert(
    ue.widgets.bind_native(
        button,
        "OnClicked",
        screen,
        "LuaResetClicked",
        function()
            print("clicked")
        end
    )
)

Notes

  • Use for exact native delivery or game-specific delegates.
  • The receiver UFunction must already exist.

On this page