Swipe
Extends:
A swipe is defined as input(s) moving in the same direction in an relatively increasing velocity and leaving the screen at some point before it drops below it's escape velocity.
Constructor Summary
Public Constructor | ||
public |
constructor(options: Object) Constructor function for the Swipe class. |
Member Summary
Public Members | ||
public |
The minimum velocity the input has to be at to emit a swipe. |
|
public |
(EXPERIMENTAL) The maximum amount of move events to keep track of for a swipe. |
|
public |
The maximum resting time a point has between it's last move and current move events. |
|
public |
The number of inputs to trigger a Swipe can be variable, and the maximum number being a factor of the browser. |
|
public |
(EXPERIMENTAL) A value of time in milliseconds to distort between events. |
|
public |
The type of the Gesture |
Method Summary
Public Methods | ||
public |
Determines if the input's history validates a swipe motion. Determines if it did not come to a complete stop (maxRestTime), and if it had enough of a velocity to be considered (ESCAPE_VELOCITY). |
|
public |
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() - 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() - Event hook for the move of a gesture |
|
public |
Set the id of the gesture to be called during an event |
|
public |
Set the type of the gesture to be called during an event |
|
public |
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(options: Object) source
Constructor function for the Swipe class.
Override:
Gesture#constructorParams:
Name | Type | Attribute | Description |
options | Object |
|
The options object. |
options.numInputs | Number |
|
The number of inputs to trigger a Swipe can be variable, and the maximum number being a factor of the browser. move and current move events. |
options.maxRestTime | Number |
|
The maximum resting time a point has between it's last |
options.escapeVelocity | Number |
|
The minimum velocity the input has to be at to emit a swipe. |
options.timeDistortion | Number |
|
(EXPERIMENTAL) A value of time in milliseconds to distort between events. |
options.maxProgressStack | Number |
|
(EXPERIMENTAL)The maximum amount of move events to keep track of for a swipe. |
Public Members
public escapeVelocity: number source
The minimum velocity the input has to be at to emit a swipe. This is useful for determining the difference between a swipe and a pan gesture.
public maxProgressStack: number source
(EXPERIMENTAL) The maximum amount of move events to keep track of for a swipe. This helps give a more accurate estimate of the user's velocity.
public maxRestTime: Number source
The maximum resting time a point has between it's last move and current move events.
public numInputs: Number source
The number of inputs to trigger a Swipe can be variable, and the maximum number being a factor of the browser.
public timeDistortion: number source
(EXPERIMENTAL) A value of time in milliseconds to distort between events. Browsers do not accurately measure time with the Date constructor in milliseconds, so consecutive events sometimes display the same timestamp but different x/y coordinates. This will distort a previous time in such cases by the timeDistortion's value.
Public Methods
public end(inputs: Array): null | Object source
Determines if the input's history validates a swipe motion. Determines if it did not come to a complete stop (maxRestTime), and if it had enough of a velocity to be considered (ESCAPE_VELOCITY).
Override:
Gesture#endParams:
Name | Type | Attribute | Description |
inputs | Array | The array of Inputs on the screen |
public move(inputs: Array, state: Object): null source
Event hook for the move of a gesture. Captures an input's x/y coordinates and the time of it's event on a stack.