Class: GestureEvent

olympe.ui.events. GestureEvent

Class representing a Gesture event.


new GestureEvent(delta, deltaTime, distance, angle, scale, velocity, rotation, center, isFirst, isFinal, eventTimeStamp)

Creates an instance of GestureEvent.

Parameters:
Name Type Description
delta olympe.df.Vector2 | Array.<number>
deltaTime olympe.df.ONumber
distance olympe.df.ONumber
angle olympe.df.ONumber
scale olympe.df.ONumber
velocity olympe.df.Vector2 | Array.<number>
rotation olympe.df.ONumber
center olympe.df.ONumber
isFirst olympe.df.OBoolean
isFinal olympe.df.OBoolean
eventTimeStamp olympe.df.ODateTime

Extends

Members


delta :olympe.df.Vector2

Type:

velocity :olympe.df.Vector2

Type:

Methods


getAngle()

Gets the angle

Returns:

Angle moved

Type
olympe.df.PONumber

getCenter()

Gets the position of the center of a multi-touch gesture, or the position of the pointer in case of single touch.

Returns:

Center position for multi-touch, or just the single pointer

Type
olympe.df.PONumber

getDelta()

Gets the delta, or difference, between the current position of the gesture and the starting position.

Returns:

(x,y) values for the delta

Type
olympe.df.PVector2

getDeltaTime()

Gets the time delta, or difference, in milliseconds, between now and the start of the gesture.

Returns:

Total time in ms since the first input

Type
olympe.df.PONumber

getDistance()

Gets the current distance from the starting position of the gesture.

Returns:

Distance moved

Type
olympe.df.PONumber

getEventTimestamp()

Gets the time stamp for that event, that is the date and time of its creation.

Inherited From:
Overrides:
Returns:

the creation date and time for this event

Type
olympe.df.PODateTime

getRotation()

Returns:

Rotation (in deg) that has been done when multi-touch. 0 on a single touch

Type
olympe.df.PONumber

getScale()

Gets the current scaling value, in case of a pinch gesture. Returns a constant value of 1 for other gestures.

Returns:

Scaling that has been done when multi-touch. 1 on a single touch

Type
olympe.df.PONumber

getVelocity()

Gets the current velocity, in pixels per milliseconds, of the gesture.

Returns:

Velocity on the XY axis, in px/ms

Type
olympe.df.PVector2

isFinal()

Checks whether this is the last event of a gesture.

Returns:

true when the final (last) input

Type
olympe.df.POBoolean

isFirst()

Checks whether this is the first event of a gesture.

Returns:

true when the first input

Type
olympe.df.POBoolean