Skip to content

Commit

Permalink
Merge pull request #52 from knoxHuang/master
Browse files Browse the repository at this point in the history
 cc.AnimationComponent Renamed cc.Animation
  • Loading branch information
jareguo committed Dec 16, 2015
2 parents 7598176 + 334011d commit 740c77b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cocos2d/core/components/CCAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ function equalClips (clip1, clip2) {
}

/**
* @class AnimationComponent
* @class Animation
* @extends CCComponent
*/
var AnimationComponent = cc.Class({
name: 'cc.AnimationComponent',
var Animation = cc.Class({
name: 'cc.Animation',
extends: require('./CCComponent'),

editor: CC_EDITOR && {
Expand Down Expand Up @@ -439,4 +439,4 @@ var AnimationComponent = cc.Class({
});


cc.AnimationComponent = module.exports = AnimationComponent;
cc.Animation = module.exports = Animation;
2 changes: 2 additions & 0 deletions jsb_polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ cc.Label.Overflow = cc.Enum({
RESIZE: 2
});

cc.spriteFrameAnimationCache = cc.animationCache;
cc.SpriteFrameAnimation = cc.Animation;

// Assets
cc.js.setClassName('cc.SpriteFrame', cc.SpriteFrame);
Expand Down
4 changes: 2 additions & 2 deletions test/qunit/unit/test-animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ test('initClipData', function () {

test('Animation Component', function () {
var entity = new cc.Node();
var animation = entity.addComponent(cc.AnimationComponent);
var animation = entity.addComponent(cc.Animation);

entity.x = 400;

Expand Down Expand Up @@ -503,7 +503,7 @@ test('Animation Component', function () {

test('CCAnimation._updateClip', function () {
var entity = new cc.Node();
var animation = entity.addComponent(cc.AnimationComponent);
var animation = entity.addComponent(cc.Animation);

entity.x = 400;

Expand Down

0 comments on commit 740c77b

Please sign in to comment.