diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000000..253a2aead2 --- /dev/null +++ b/circle.yml @@ -0,0 +1,8 @@ +machine: + node: + version: 5.1.1 + +dependencies: + pre: + - npm install -g gulp + - npm install gulp-qunit diff --git a/cocos2d/core/CCDirector.js b/cocos2d/core/CCDirector.js index dbf69a2bc8..c5f75b1163 100644 --- a/cocos2d/core/CCDirector.js +++ b/cocos2d/core/CCDirector.js @@ -533,6 +533,7 @@ cc.Director = Class.extend(/** @lends cc.Director# */{ // Activate if (scene instanceof cc.Scene) { scene._activate(); + this.emit(cc.Director.EVENT_AFTER_SCENE_LAUNCH, scene); } }, @@ -1071,6 +1072,12 @@ cc.Director.EVENT_PROJECTION_CHANGED = "director_projection_changed"; */ cc.Director.EVENT_BEFORE_SCENE_LAUNCH = "director_before_scene_launch"; +/** + * @event EVENT_AFTER_SCENE_LAUNCH + * @param {cc.Scene} newScene + */ +cc.Director.EVENT_AFTER_SCENE_LAUNCH = "director_after_scene_launch"; + /** * The event after update of cc.Director * @constant diff --git a/cocos2d/core/components/CCSprite.js b/cocos2d/core/components/CCSprite.js index bfccda855a..14e6ff926e 100644 --- a/cocos2d/core/components/CCSprite.js +++ b/cocos2d/core/components/CCSprite.js @@ -344,6 +344,15 @@ var Sprite = cc.Class({ onLoad: function () { this._super(); + this.node.on('size-changed', this._resized, this); + }, + + onDestroy: function () { + this._super(); + this.node.off('size-changed', this._resized, this); + }, + + _validateSizeMode: function() { //do processing if (-1 === this._sizeMode) { //FIXME:_useOriginalSize is deprecated, since v0.8, it need to be deleted @@ -354,12 +363,6 @@ var Sprite = cc.Class({ } this._isTrimmedMode = true; } - this.node.on('size-changed', this._resized, this); - }, - - onDestroy: function () { - this._super(); - this.node.off('size-changed', this._resized, this); }, _applyAtlas: CC_EDITOR && function (spriteFrame) { @@ -444,6 +447,8 @@ var Sprite = cc.Class({ sgNode.setVisible(false); } + this._validateSizeMode(); + this._applySpriteFrame(null); // should keep the size of the sg node the same as entity, @@ -452,6 +457,7 @@ var Sprite = cc.Class({ this._applySpriteSize(); sgNode.setRenderingType(this._type); + sgNode.enableTrimmedContentSize(this._isTrimmedMode); }, _resized: function () { diff --git a/package.json b/package.json index 7e62a8fc72..b0ca062afa 100644 --- a/package.json +++ b/package.json @@ -14,21 +14,23 @@ "browserify": "11.2.0", "chalk": "1.1.0", "del": "1.2.0", + "event-stream": "3.3.1", "fire-fs": "0.2.1", - "gulp": "3.8.11", - "gulp-cached": "1.0.1", + "gulp": "3.9.0", + "gulp-cached": "1.1.0", "gulp-concat": "2.6.0", "gulp-fb": "0.5.0", "gulp-header": "1.2.2", - "gulp-jshint": "1.11.0", + "gulp-jshint": "1.11.2", "gulp-mirror": "0.4.0", "gulp-plumber": "0.6.6", "gulp-rename": "1.2.2", + "gulp-shell": "0.4.1", "gulp-sourcemaps": "1.5.2", "gulp-uglify": "1.2.0", - "gulp-util": "3.0.5", - "jshint-stylish": "2.0.0", - "require-dir": "0.1.0", + "gulp-util": "3.0.6", + "jshint-stylish": "2.0.1", + "require-dir": "0.3.0", "vinyl": "1.1.0", "vinyl-buffer": "1.0.0", "vinyl-source-stream": "1.0.0"