Skip to content
PointerEvent

UI / PointerEvent

PointerEvent Class

Classes that transmit mobile touch, mouse, and keyboard information when clicking or sliding

Table of contents

Accessors

isTouchEvent(): boolean other
Determine if it is a touch event
lastScreenSpacePosition(): Vector2 other
Get the last screen position of this event
mouseWheelDelta(): number other
Get the distance the mouse wheel slides
pointerIndex(): number other
Return the unique identifier index of the event
screenSpacePosition(): Vector2 other
Get the triggered screen position
touchPadIndex(): number other
Get touch event index
userIndex(): number other
Get the Player's index triggered by the event

Methods

isMouseButtonDown(MouseButton: Keys): boolean other
Determine whether it is a mouse button event
toInputEvent(): InputEvent other
Convert to InputEvent

Default Construction

Accessors

isTouchEvent

get isTouchEvent(): boolean other

Determine if it is a touch event

Returns

booleanReturn whether it is a touch event

lastScreenSpacePosition

get lastScreenSpacePosition(): Vector2 other

Get the last screen position of this event

Returns

Vector2Return to the last screen position of this event

mouseWheelDelta

get mouseWheelDelta(): number other

Get the distance the mouse wheel slides

Returns

numberReturn to the sliding distance of the mouse wheel

pointerIndex

get pointerIndex(): number other

Return the unique identifier index of the event

Returns

numberReturn the unique identifier index of the event

screenSpacePosition

get screenSpacePosition(): Vector2 other

Get the triggered screen position

Returns

Vector2Return to the triggered screen position

touchPadIndex

get touchPadIndex(): number other

Get touch event index

Returns

numberReturn the index of the touch event

userIndex

get userIndex(): number other

Get the Player's index triggered by the event

Returns

numberReturn event triggers Player's index

Methods

isMouseButtonDown

isMouseButtonDown(MouseButton): boolean other

Determine whether it is a mouse button event

Parameters

MouseButton KeysUsage: Key events

Returns

booleanReturns whether it is a mouse key event

toInputEvent

toInputEvent(): InputEvent other

Convert to InputEvent

Returns

InputEventReturn InputEvent after conversion