CursorEventData
The type that represents data exposed by cursor event callbacks.
Methods3
function CursorEventData:GetUIPos() -> (x number, y number)
Returns the cursor position when the event took place originating from the bottom-left corner of the canvas.
Returns
xnumberThe cursor x position.
ynumberThe cursor y position.
function CursorEventData:GetPressUIPos() -> (x number, y number)
Returns the cursor position when the mouse was pressed originating from the bottom-left corner of the canvas.
Returns
xnumberThe cursor x position.
ynumberThe cursor y position.
function CursorEventData:GetUIPosDelta() -> (x number, y number)
Returns the distance the cursor moved between the start and end of the event.
Returns
xnumberThe cursor x position change.
ynumberThe cursor y position change.
Fields2
CursorEventData.dragging : boolean
[Read] Whether currently dragging.
CursorEventData.touchId : number
[Read] The touch interaction type. -1 for cursor clicks, 0-4 for touch gestures on mobile devices.