Skip to content

Commit 458d50d

Browse files
committed
Added Drag Events
1 parent d753c53 commit 458d50d

5 files changed

Lines changed: 76 additions & 1 deletion

File tree

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: 'f0ace370-6bbe-11e7-bc0b-07efe44856f0'
2+
build: 'a0dd6670-6c05-11e7-b85b-a1c8155e4882'
33
};
44
module.exports = CHECKSUM;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var Class = require('../../utils/Class');
2+
var Event = require('../../events/Event');
3+
4+
var DragEndEvent = new Class({
5+
6+
Extends: Event,
7+
8+
initialize:
9+
10+
function DragEndEvent (pointer, gameObject)
11+
{
12+
Event.call(this, 'DRAG_END_EVENT');
13+
14+
this.pointer = pointer;
15+
this.gameObject = gameObject;
16+
this.input = gameObject.input;
17+
18+
this.x = gameObject.input.localX;
19+
this.y = gameObject.input.localY;
20+
}
21+
22+
});
23+
24+
module.exports = DragEndEvent;

v3/src/input/events/DragEvent.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var Class = require('../../utils/Class');
2+
var Event = require('../../events/Event');
3+
4+
var DragEvent = new Class({
5+
6+
Extends: Event,
7+
8+
initialize:
9+
10+
function DragEvent (pointer, gameObject)
11+
{
12+
Event.call(this, 'DRAG_EVENT');
13+
14+
this.pointer = pointer;
15+
this.gameObject = gameObject;
16+
this.input = gameObject.input;
17+
18+
this.x = gameObject.input.localX;
19+
this.y = gameObject.input.localY;
20+
}
21+
22+
});
23+
24+
module.exports = DragEvent;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var Class = require('../../utils/Class');
2+
var Event = require('../../events/Event');
3+
4+
var DragStartEvent = new Class({
5+
6+
Extends: Event,
7+
8+
initialize:
9+
10+
function DragStartEvent (pointer, gameObject)
11+
{
12+
Event.call(this, 'DRAG_START_EVENT');
13+
14+
this.pointer = pointer;
15+
this.gameObject = gameObject;
16+
this.input = gameObject.input;
17+
18+
this.x = gameObject.input.localX;
19+
this.y = gameObject.input.localY;
20+
}
21+
22+
});
23+
24+
module.exports = DragStartEvent;

v3/src/input/events/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
module.exports = {
44

55
DOWN: require('./PointerDownEvent'),
6+
DRAG: require('./DragEvent'),
7+
DRAG_END: require('./DragEndEvent'),
8+
DRAG_START: require('./DragStartEvent'),
69
OUT: require('./PointerOutEvent'),
710
OVER: require('./PointerOverEvent'),
811
UP: require('./PointerUpEvent')

0 commit comments

Comments
 (0)