Repository

Touch

Extends:

* → Touch

Touch give an interface to access the multitouch events of the device. It holds a list of currently active touches and various ways to access their coordinates.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

Gives the number of touch currently active

public
public
public
public
public
public

true if the active touch on screen > 1, false otherwise

public
public
public
public
public
public
public
public

target: *

public
public
public
public

touches: {}

Private Members
private

_time: *

Method Summary

Public Methods
public

get(index: Number:Int): TouchObject

returns a TouchObject

public

getDelta(index: Number:Int | Object:Touch): Object

Returns an object {x:Number, y:Number} that represents the coordinate of the touch delta, that is the numerical difference between the previous state in time and the actual one.

public

getDeltaX(index: Number:Int | Object:Touch): *

Returns a Number that represents the coordinate of the touch delta, that is the numerical difference between the previous state in time and the actual one.

public

getDeltaY(index: Number:Int | Object:Touch): *

Returns a Number that represents the coordinate of the touch delta, that is the numerical difference between the previous state in time and the actual one.

public

getOffset(index: Number:Int | Object:Touch): Object

Returns an object {x:Number, y:Number} that represents the coordinate of the touch offset, that is the numerical difference between the start point of the touch and the actual one.

public

getOffsetX(index: Number:Int | Object:Touch): Number

Returns a Number that represents the x coordinate of the touch offset, that is the numerical difference between the start point of the touch and the actual one.

public

getOffsetY(index: Number:Int | Object:Touch): Number

Returns a Number that represents the y coordinate of the touch offset, that is the numerical difference between the start point of the touch and the actual one.

public

Returns a Number that represents the pinch touch move, that is the numerical difference between the start point of 2 touches and the actual one.

public

getX(index: Number:Int): Number:Int

returns the x coordinate of the touch given as paramater

public

getY(index: Number:Int): Number:Int

returns the y coordinate of the touch given as paramater

public

off()

public

on()

public

Initialization method

public
Private Methods
private

onTouchEnd(event: *)

onTouchEnd listener

private

onTouchMove(event: *)

onTouchMove listener

private

onTouchStart(event: *)

onTouchStart listener Manage a new touch and organize it in the main touch list Input.touches

Public Constructors

public constructor(params: Object) source

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.targetDOMElement

The DOM element that will be used to attach touch events on

Public Members

public count: number source

Gives the number of touch currently active

Properties:

NameTypeAttributeDescription
countNumber

public oldTapTime: number source

public pinch: number source

public pinchActive: boolean source

public pinchStart: number source

public pinchTouches: *[] source

public pressed: boolean source

true if the active touch on screen > 1, false otherwise

Properties:

NameTypeAttributeDescription
pressedBoolean

public swipeCurrentTime: * source

public swipeMaxTime: number source

public swipeMinDist: number source

public swipeStartTime: * source

public swipeTime: * source

public taps: number source

public tapsMaxInterval: number source

public target: * source

public touchDown: boolean source

public touchState: * source

public touchUp: boolean source

public touches: {} source

Private Members

private _time: * source

Public Methods

public get(index: Number:Int): TouchObject source

returns a TouchObject

Params:

NameTypeAttributeDescription
indexNumber:Int

the index of the touchObject to get

Return:

TouchObject

public getDelta(index: Number:Int | Object:Touch): Object source

Returns an object {x:Number, y:Number} that represents the coordinate of the touch delta, that is the numerical difference between the previous state in time and the actual one.

Params:

NameTypeAttributeDescription
indexNumber:Int | Object:Touch

the index of the touch to get coordinates from, or the touch object

Return:

Object

{x:Number, y:Number}, the x & y coordinates of the touch delta;

public getDeltaX(index: Number:Int | Object:Touch): * source

Returns a Number that represents the coordinate of the touch delta, that is the numerical difference between the previous state in time and the actual one.

Params:

NameTypeAttributeDescription
indexNumber:Int | Object:Touch

the index of the touch to get x coordinate from, or the touch object

Return:

*

{Number:Int}, the x coordinates of the touch delta;

public getDeltaY(index: Number:Int | Object:Touch): * source

Returns a Number that represents the coordinate of the touch delta, that is the numerical difference between the previous state in time and the actual one.

Params:

NameTypeAttributeDescription
indexNumber:Int | Object:Touch

the index of the touch to get y coordinate from, or the touch object

Return:

*

{Number:Int}, the y coordinates of the touch delta;

public getOffset(index: Number:Int | Object:Touch): Object source

Returns an object {x:Number, y:Number} that represents the coordinate of the touch offset, that is the numerical difference between the start point of the touch and the actual one.

Params:

NameTypeAttributeDescription
indexNumber:Int | Object:Touch

the index of the touch to get offset coordinate from, or the touch object

Return:

Object

{x:Number, y:Number}, the x & y coordinates of the touch offset;

public getOffsetX(index: Number:Int | Object:Touch): Number source

Returns a Number that represents the x coordinate of the touch offset, that is the numerical difference between the start point of the touch and the actual one.

Params:

NameTypeAttributeDescription
indexNumber:Int | Object:Touch

the index of the touch to get x offset coordinate from, or the touch object

Return:

Number

the x coordinates of the touch offset;

public getOffsetY(index: Number:Int | Object:Touch): Number source

Returns a Number that represents the y coordinate of the touch offset, that is the numerical difference between the start point of the touch and the actual one.

Params:

NameTypeAttributeDescription
indexNumber:Int | Object:Touch

the index of the touch to get y offset coordinate from, or the touch object

Return:

Number

the y coordinates of the touch offset;

public getPinch(): Number source

Returns a Number that represents the pinch touch move, that is the numerical difference between the start point of 2 touches and the actual one.

Return:

Number

the pinch delta value;

public getX(index: Number:Int): Number:Int source

returns the x coordinate of the touch given as paramater

Params:

NameTypeAttributeDescription
indexNumber:Int

the index of the touch to get x coordinate from

Return:

Number:Int

x coordinate of the touch if active, -1 if not active

public getY(index: Number:Int): Number:Int source

returns the y coordinate of the touch given as paramater

Params:

NameTypeAttributeDescription
indexNumber:Int

the index of the touch to get y coordinate from

Return:

Number:Int

y coordinate of the touch if active, -1 if not active

public off() source

public on() source

public setup() source

Initialization method

public update() source

Private Methods

private onTouchEnd(event: *) source

onTouchEnd listener

Manage a touch removal and organize it in the main touch list Input.touches

Params:

NameTypeAttributeDescription
event*

private onTouchMove(event: *) source

onTouchMove listener

Manage a touch move and organize it in the main touch list Input.touches

Params:

NameTypeAttributeDescription
event*

private onTouchStart(event: *) source

onTouchStart listener Manage a new touch and organize it in the main touch list Input.touches

Params:

NameTypeAttributeDescription
event*