Skip to content

Commit e462def

Browse files
committed
Added PlayAnimation action.
1 parent ecbc428 commit e462def

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

v3/src/actions/PlayAnimation.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var PlayAnimation = function (items, key, startFrame)
2+
{
3+
for (var i = 0; i < items.length; i++)
4+
{
5+
items[i].anims.play(key, startFrame);
6+
}
7+
8+
return items;
9+
};
10+
11+
module.exports = PlayAnimation;

v3/src/actions/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = {
1313
PlaceOnLine: require('./PlaceOnLine'),
1414
PlaceOnRectangle: require('./PlaceOnRectangle'),
1515
PlaceOnTriangle: require('./PlaceOnTriangle'),
16+
PlayAnimation: require('./PlayAnimation'),
1617
RandomCircle: require('./RandomCircle'),
1718
RandomEllipse: require('./RandomEllipse'),
1819
RandomLine: require('./RandomLine'),

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: 'd9e724e0-1bee-11e7-84b6-498a4b612112'
2+
build: '1fc4c990-1bf4-11e7-a52f-5f7dcf3f36ad'
33
};
44
module.exports = CHECKSUM;

v3/src/gameobjects/layer/Layer.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ var Layer = new Class({
250250
return this;
251251
},
252252

253+
playAnimation: function (key, startFrame)
254+
{
255+
Actions.PlayAnimation(this.children.entries, key, startFrame);
256+
257+
return this;
258+
},
259+
253260
randomCircle: function (circle)
254261
{
255262
Actions.RandomCircle(this.children.entries, circle);

0 commit comments

Comments
 (0)