Miliastra Wonderland Lua API

ClientUICursorEventAreaControl

The type that represents an instance of a CursorEventArea component. Contains functions for managing cursor event listeners.

Methods5

function ClientUICursorEventAreaControl:AddCursorEventListener(eventType: EnumItem.CursorEventType, callback: fun(eventData: CursorEventData) -> nil)

Registers a cursor event listener to the Client Control.

See:

Parameters
eventTypeEnumItem.CursorEventType

The cursor event type to listen for.

callbackfun(eventData: CursorEventData) -> nil

The callback function, which exposes data about the cursor event.

function ClientUICursorEventAreaControl:RemoveCursorEventListener(eventType: EnumItem.CursorEventType, callback: fun(eventData: CursorEventData) -> nil)

Removes the specified cursor event listener from the Client Control.

See:

Parameters
eventTypeEnumItem.CursorEventType

The event type to remove the callback from.

callbackfun(eventData: CursorEventData) -> nil

The callback function to remove.

function ClientUICursorEventAreaControl:RemoveCursorEventListeners(eventType: EnumItem.CursorEventType)

Removes all cursor event listeners for the specified event type from the Client Control.

See:

Parameters
eventTypeEnumItem.CursorEventType

The event type to clear listeners from.

function ClientUICursorEventAreaControl:RemoveAllCursorEventListeners()

Removes all cursor event listeners from the Client Control.

function ClientUICursorEventAreaControl:SimulateCursorClick()

Simulates the CursorDown, CursorUp, and CursorClick events in sequence.

Fields1

ClientUICursorEventAreaControl.raycastTarget : boolean

[Read/Write] Whether the Cursor Event Area can receive cursor interaction events.