Home Reference Source Test
public class | source

Rotate

Extends:

Gesture → Rotate

A Rotate is defined as two inputs moving about a circle, maintaining a relatively equal radius.

Constructor Summary

Public Constructor
public

Constructor function for the Rotate class.

Member Summary

Public Members
public

The type of the Gesture.

Method Summary

Public Methods
public

move(inputs: Array, state: Object): Object

move() - Event hook for the move of a gesture.

Inherited Summary

From class Gesture
public

The unique identifier for each gesture determined at bind time by the state object.

public

The generic string type of gesture ('expand'|'pan'|'pinch'|'rotate'|'swipe'|'tap').

public

end(inputs: Array): null | Object

end() - Event hook for the move of a gesture

public

Return the id of the event.

public

getType() - Returns the generic type of the gesture

public

move(inputs: Array, state: Object): null | Object

move() - Event hook for the move of a gesture

public

setId(id: String)

Set the id of the gesture to be called during an event

public

setType(type: String)

Set the type of the gesture to be called during an event

public

start(inputs: Array): null | Object

start() - Event hook for the start of a gesture

public

update(object: *)

Updates internal properties with new ones, only if the properties exist.

Public Constructors

public constructor source

Constructor function for the Rotate class.

Override:

Gesture#constructor

Public Members

public type: String source

The type of the Gesture.

Override:

Gesture#type

Public Methods

public move(inputs: Array, state: Object): Object source

move() - Event hook for the move of a gesture. Obtains the midpoint of two the two inputs and calculates the projection of the right most input along a unit circle to obtain an angle. This angle is compared to the previously calculated angle to output the change of distance, and is compared to the initial angle to output the distance from the initial angle to the current angle.

Override:

Gesture#move

Params:

NameTypeAttributeDescription
inputs Array

The array of Inputs on the screen

state Object

The state object of the current listener.

Return:

Object

obj.distanceFromLast - The change of angle between the last position and the current position.