Skip to content

Commit 2c9be48

Browse files
committed
Add Animation Event + handler.
1 parent 47c4df6 commit 2c9be48

5 files changed

Lines changed: 23 additions & 1 deletion

File tree

v3/src/animation/manager/components/AddAnimation.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var Event = require('../events/');
2+
13
var AddAnimation = function (key, animation)
24
{
35
if (this.anims.has(key))
@@ -10,6 +12,8 @@ var AddAnimation = function (key, animation)
1012

1113
this.anims.set(key, animation);
1214

15+
this.events.dispatch(new Event.ADD_ANIMATION_EVENT(key, animation));
16+
1317
return this;
1418
};
1519

v3/src/animation/manager/components/CreateFrameAnimation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
var Event = require('../events/');
12
var Animation = require('../../frame/Animation');
23

34
var CreateFrameAnimation = function (config)
@@ -14,6 +15,8 @@ var CreateFrameAnimation = function (config)
1415

1516
this.anims.set(key, anim);
1617

18+
this.events.dispatch(new Event.ADD_ANIMATION_EVENT(key, anim));
19+
1720
return anim;
1821
};
1922

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var Event = require('../../../events/Event');
2+
3+
var AddAnimationEvent = function (key, animation)
4+
{
5+
Event.call(this, 'ADD_ANIMATION_EVENT');
6+
7+
this.key = key;
8+
this.animation = animation;
9+
};
10+
11+
AddAnimationEvent.prototype = Object.create(Event.prototype);
12+
AddAnimationEvent.prototype.constructor = AddAnimationEvent;
13+
14+
module.exports = AddAnimationEvent;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2+
ADD_ANIMATION_EVENT: require('./AddAnimationEvent'),
23
REMOVE_ANIMATION_EVENT: require('./RemoveAnimationEvent')
34
};

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: '3e738b80-2f48-11e7-aac0-63674b1afef9'
2+
build: '6335b900-2f4a-11e7-954b-fb839fe8392a'
33
};
44
module.exports = CHECKSUM;

0 commit comments

Comments
 (0)