-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.js
More file actions
executable file
·45 lines (30 loc) · 1.07 KB
/
input.js
File metadata and controls
executable file
·45 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ig.module(
'impact.input'
).requires(
'impact.gaInput'
)
.defines(function(){ "use strict";
ig.KEY = ga.KEY ;
var getTime = function() { return 1000*ig.Timer.time; };
var screenToWorldCoordinates = function(v) { return (v/ig.system.scale); };
ig.Input = function() {
ga.Input.call( this,ig.system.canvas, screenToWorldCoordinates ,getTime );
return this;
};
ig.Input.prototype = ga.Input.prototype;
ig.Input.prototype.state = ga.Input.prototype.status;
var gaBindTouch = ga.Input.prototype.bindTouch;
ig.Input.bindTouch = function( selector, action )
{
if (arguments.length == 0) { gaBindTouch(); };
var element = ig.$( selector );
var that = this;
element.addEventListener('touchstart', function(ev) {
that._touchStart( ev, action );
}, false);
element.addEventListener('touchend', function(ev) {
that._touchEnd( ev, action );
}, false);
};
ig.Input.bindings = ga.Input.bindings;
});