wnp.Input.TouchManager Class
Manages touch events on mobile devices.
All events are listed below along with their parameters. You can register/unregister your own callbacks using the methods on
and off
.
N.B : Use event.clientX or event.pageX to get the positions, depending on the browser you target.
Events :
touchDown
, button : NumbertouchUp
touchMove
tap
dblTap
longPress
swipe
rotate
Constructor
Item Index
Methods
Methods
off
(
-
eventName
Detaches an event listener from an event type.
Parameters:
-
eventName
StringThe listened event name.
on
(
-
eventName
-
callback
Attaches an event listener to an event type.
setDeadZone
(
-
deadZone
Sets the dead zone value. This value is used when a finger is moving on the screen. If the delta position is lesser than dead zone then the move event is not triggered.
Parameters:
-
deadZone
NumberThe value of the dead zone. Default is 2.0.
start
()
Starts the manager activity.
stop
()
Stops the manager activity.