Pointer

Pointer is not creatable, there's only one instance of it. It can only be accessed through its globally exposed variable.

Pointer is a shortcut to Client.Pointer.
Pointer allows to catch user pointer events. Mouse events or touch events depending on the device.

Functions

nil Hide ( )

Virtual game pads appear on touch screens.

Direction keys and gamepad start triggering Client.DirectionDidChange

The pointer is hidden by default.

Pointer:Hide()
nil Show ( )

Pointer callbacks start being triggered on mouse and touch events.

User interface elements such as Buttons become active.

Pointer:Show()

Properties

Triggered when leaving "pointer mode".
Technically, no visual pointer disappears on a touch screen, but it means the UI now stops receiving pointer inputs.
When using a mouse, that function is triggered when the cursor disappears.

Pointer.DidHide = function()

end

Triggered when entering "pointer mode".
Technically, no visual pointer does show on a touch screen, but it means the UI is now receiving pointer inputs.
When using a mouse, that function is triggered when the cursor becomes visible.

Pointer.DidShow = function()

end

Triggered when pressing the pointer. (left click or one finger touch down)

Pointer.Down = function( pointerEvent )
  
end

Triggered when the pointer is dragged (moved while down).

Pointer.Drag = function( pointerEvent )
    print(pointerEvent.DX, pointerEvent.DY)
end

Triggered when the pointer is moved with right mouse button or 2 touch fingers down.

Pointer.Drag2 = function( pointerEvent )
    print(pointerEvent.DX, pointerEvent.DY)
end

Triggered when the pointer is released.

Pointer.Up = function( pointerEvent )

end

Triggered when scrolling with mouse or pinching in/out with 2 fingers.

Pointer.Zoom = function( pointerEvent )

end