Skip to content

Commit

Permalink
cc.sprite renname _ccsg.sprite and file name
Browse files Browse the repository at this point in the history
  • Loading branch information
knoxHuang committed Dec 21, 2015
1 parent c1fb6e3 commit f86cad8
Show file tree
Hide file tree
Showing 108 changed files with 689 additions and 688 deletions.
2 changes: 1 addition & 1 deletion cocos2d/ToMerge/wrappers/progress-timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var ProgressTimerWrapper = cc.Class({
},

createNode: function (node) {
node = node || new cc.ProgressTimer(new cc.Sprite());
node = node || new cc.ProgressTimer(new _ccsg.Sprite());

var sp = node.getSprite();
if (this._texture) {
Expand Down
8 changes: 4 additions & 4 deletions cocos2d/actions/CCAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,12 @@ cc.Speed.create = cc.speed;
* @param {cc.Rect} rect
* @example
* // creates the action with a set boundary
* var sprite = new cc.Sprite("spriteFileName");
* var sprite = new _ccsg.Sprite("spriteFileName");
* var followAction = new cc.Follow(sprite, cc.rect(0, 0, s.width * 2 - 100, s.height));
* this.runAction(followAction);
*
* // creates the action with no boundary set
* var sprite = new cc.Sprite("spriteFileName");
* var sprite = new _ccsg.Sprite("spriteFileName");
* var followAction = new cc.Follow(sprite);
* this.runAction(followAction);
*
Expand Down Expand Up @@ -668,12 +668,12 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
* @example
* // example
* // creates the action with a set boundary
* var sprite = new cc.Sprite("spriteFileName");
* var sprite = new _ccsg.Sprite("spriteFileName");
* var followAction = cc.follow(sprite, cc.rect(0, 0, s.width * 2 - 100, s.height));
* this.runAction(followAction);
*
* // creates the action with no boundary set
* var sprite = new cc.Sprite("spriteFileName");
* var sprite = new _ccsg.Sprite("spriteFileName");
* var followAction = cc.follow(sprite);
* this.runAction(followAction);
*/
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/actions/CCActionInterval.js
Original file line number Diff line number Diff line change
Expand Up @@ -3347,7 +3347,7 @@ cc.Animate = cc.ActionInterval.extend(/** @lends cc.Animate# */{

/**
* Start the action with target.
* @param {cc.Sprite} target
* @param {_ccsg.Sprite} target
*/
startWithTarget:function (target) {
cc.ActionInterval.prototype.startWithTarget.call(this, target);
Expand Down
6 changes: 3 additions & 3 deletions cocos2d/core/base-nodes/CCSGNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cc.s_globalOrderOfArrival = 1;

/**
* <p>ccsg.Node is the root class of all node. Anything that gets drawn or contains things that get drawn is a ccsg.Node.<br/>
* The most popular ccsg.Nodes are: ccsg.Scene, cc.Layer, cc.Sprite, cc.Menu.</p>
* The most popular ccsg.Nodes are: ccsg.Scene, cc.Layer, _ccsg.Sprite, cc.Menu.</p>
*
* <p>The main features of a ccsg.Node are: <br/>
* - They can contain other ccsg.Node nodes (addChild, getChildByTag, removeChild, etc) <br/>
Expand Down Expand Up @@ -1713,8 +1713,8 @@ _ccsg.Node = cc.Class({
* this.addChild(batch);
*
* // create two sprites, spriteA will be added to batchNode, they are using different textures.
* var spriteA = new cc.Sprite(batch->getTexture());
* var spriteB = new cc.Sprite("Icon-72.png");
* var spriteA = new _ccsg.Sprite(batch->getTexture());
* var spriteB = new _ccsg.Sprite("Icon-72.png");
*
* batch.addChild(spriteA);
*
Expand Down
16 changes: 8 additions & 8 deletions cocos2d/core/labelttf/CCLabelTTF.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

/**
* <p>cc.LabelTTF is a subclass of cc.TextureNode that knows how to render text labels with system font or a ttf font file<br/>
* All features from cc.Sprite are valid in cc.LabelTTF<br/>
* All features from _ccsg.Sprite are valid in cc.LabelTTF<br/>
* cc.LabelTTF objects are slow for js-binding on mobile devices.<br/>
* Consider using cc.LabelAtlas or cc.LabelBMFont instead.<br/>
* You can create a cc.LabelTTF from a font name, alignment, dimension and font size or a cc.FontDefinition object.</p>
* @class
* @extends cc.Sprite
* @extends _ccsg.Sprite
*
* @param {String} text
* @param {String|cc.FontDefinition} [fontName="Arial"]
Expand Down Expand Up @@ -63,7 +63,7 @@
* @property {Number} shadowOpacity - The opacity of shadow
* @property {Number} shadowBlur - The blur size of shadow
*/
cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
cc.LabelTTF = _ccsg.Sprite.extend(/** @lends cc.LabelTTF# */{
_dimensions: null,
_hAlignment: cc.TextAlignment.CENTER,
_vAlignment: cc.VerticalTextAlignment.TOP,
Expand Down Expand Up @@ -144,7 +144,7 @@ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
},

ctor: function (text, fontName, fontSize, dimensions, hAlignment, vAlignment) {
cc.Sprite.prototype.ctor.call(this);
_ccsg.Sprite.prototype.ctor.call(this);

this._dimensions = cc.size(0, 0);
this._hAlignment = cc.TextAlignment.LEFT;
Expand Down Expand Up @@ -720,23 +720,23 @@ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
getContentSize: function () {
if (this._needUpdateTexture)
this._renderCmd._updateTTF();
return cc.Sprite.prototype.getContentSize.call(this);
return _ccsg.Sprite.prototype.getContentSize.call(this);
},

_getWidth: function () {
if (this._needUpdateTexture)
this._renderCmd._updateTTF();
return cc.Sprite.prototype._getWidth.call(this);
return _ccsg.Sprite.prototype._getWidth.call(this);
},
_getHeight: function () {
if (this._needUpdateTexture)
this._renderCmd._updateTTF();
return cc.Sprite.prototype._getHeight.call(this);
return _ccsg.Sprite.prototype._getHeight.call(this);
},

setTextureRect: function (rect, rotated, untrimmedSize) {
//set needConvert to false
cc.Sprite.prototype.setTextureRect.call(this, rect, rotated, untrimmedSize, false);
_ccsg.Sprite.prototype.setTextureRect.call(this, rect, rotated, untrimmedSize, false);
},

/**
Expand Down
8 changes: 4 additions & 4 deletions cocos2d/core/labelttf/CCLabelTTFCanvasRenderCmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,22 +443,22 @@ cc.LabelTTF._firsrEnglish = /^[a-zA-Z0-9ÄÖÜäöüßéèçàùêâîôû]/;

(function(){
cc.LabelTTF.CacheCanvasRenderCmd = function (renderable) {
cc.Sprite.CanvasRenderCmd.call(this, renderable);
_ccsg.Sprite.CanvasRenderCmd.call(this, renderable);
cc.LabelTTF.CacheRenderCmd.call(this);
};

var proto = cc.LabelTTF.CacheCanvasRenderCmd.prototype = Object.create(cc.Sprite.CanvasRenderCmd.prototype);
var proto = cc.LabelTTF.CacheCanvasRenderCmd.prototype = Object.create(_ccsg.Sprite.CanvasRenderCmd.prototype);
cc.js.mixin(proto, cc.LabelTTF.CacheRenderCmd.prototype);
proto.constructor = cc.LabelTTF.CacheCanvasRenderCmd;
})();

(function(){
cc.LabelTTF.CanvasRenderCmd = function (renderable) {
cc.Sprite.CanvasRenderCmd.call(this, renderable);
_ccsg.Sprite.CanvasRenderCmd.call(this, renderable);
cc.LabelTTF.RenderCmd.call(this);
};

cc.LabelTTF.CanvasRenderCmd.prototype = Object.create(cc.Sprite.CanvasRenderCmd.prototype);
cc.LabelTTF.CanvasRenderCmd.prototype = Object.create(_ccsg.Sprite.CanvasRenderCmd.prototype);
cc.js.mixin(cc.LabelTTF.CanvasRenderCmd.prototype, cc.LabelTTF.RenderCmd.prototype);

var proto = cc.LabelTTF.CanvasRenderCmd.prototype;
Expand Down
6 changes: 3 additions & 3 deletions cocos2d/core/labelttf/CCLabelTTFWebGLRenderCmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
// ----------------------------------- LabelTTF WebGL render cmd ----------------------------
(function() {
cc.LabelTTF.WebGLRenderCmd = function (renderable) {
cc.Sprite.WebGLRenderCmd.call(this, renderable);
_ccsg.Sprite.WebGLRenderCmd.call(this, renderable);
cc.LabelTTF.CacheRenderCmd.call(this);
this.setShaderProgram(cc.shaderCache.programForKey(cc.LabelTTF._SHADER_PROGRAM));
};
var proto = cc.LabelTTF.WebGLRenderCmd.prototype = Object.create(cc.Sprite.WebGLRenderCmd.prototype);
var proto = cc.LabelTTF.WebGLRenderCmd.prototype = Object.create(_ccsg.Sprite.WebGLRenderCmd.prototype);
cc.js.mixin(proto, cc.LabelTTF.CacheRenderCmd.prototype);
proto.constructor = cc.LabelTTF.WebGLRenderCmd;
proto._updateColor = function () {
this._updateTexture();
cc.Sprite.WebGLRenderCmd.prototype._updateColor.call(this);
_ccsg.Sprite.WebGLRenderCmd.prototype._updateColor.call(this);
}
})();
10 changes: 5 additions & 5 deletions cocos2d/core/platform/CCConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ window["CocosEngine"] = cc.ENGINE_VERSION = "Cocos2d-JS v3.9 Beta";
* The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.<br/>
* <br/>
* Affected nodes: <br/>
* - cc.Sprite / cc.SpriteBatchNode and subclasses: cc.LabelBMFont, cc.TMXTiledMap <br/>
* - _ccsg.Sprite / cc.SpriteBatchNode and subclasses: cc.LabelBMFont, cc.TMXTiledMap <br/>
* - cc.LabelAtlas <br/>
* - cc.QuadParticleSystem <br/>
* - cc.TileMap <br/>
Expand Down Expand Up @@ -82,7 +82,7 @@ cc.DIRECTOR_FPS_INTERVAL = 0.5;

/**
* <p>
* If enabled, the ccsg.Node objects (cc.Sprite, _ccsg.Label,etc) will be able to render in subpixels.<br/>
* If enabled, the ccsg.Node objects (_ccsg.Sprite, _ccsg.Label,etc) will be able to render in subpixels.<br/>
* If disabled, integer pixels will be used.<br/>
* <br/>
* To enable set it to 1. Enabled by default.<br/>
Expand All @@ -95,7 +95,7 @@ cc.COCOSNODE_RENDER_SUBPIXEL = 1;

/**
* <p>
* If enabled, the cc.Sprite objects rendered with cc.SpriteBatchNode will be able to render in subpixels.<br/>
* If enabled, the _ccsg.Sprite objects rendered with cc.SpriteBatchNode will be able to render in subpixels.<br/>
* If disabled, integer pixels will be used.<br/>
* <br/>
* To enable set it to 1. Enabled by default.<br/>
Expand Down Expand Up @@ -220,7 +220,7 @@ cc.USE_LA88_LABELS = 1;

/**
* <p>
* If enabled, all subclasses of cc.Sprite will draw a bounding box<br/>
* If enabled, all subclasses of _ccsg.Sprite will draw a bounding box<br/>
* Useful for debugging purposes only. It is recommend to leave it disabled.<br/>
* <br/>
* To enable set it to a value different than 0. Disabled by default:<br/>
Expand All @@ -235,7 +235,7 @@ cc.SPRITE_DEBUG_DRAW = 0;

/**
* <p>
* If enabled, all subclasses of cc.Sprite that are rendered using an cc.SpriteBatchNode draw a bounding box.<br/>
* If enabled, all subclasses of _ccsg.Sprite that are rendered using an cc.SpriteBatchNode draw a bounding box.<br/>
* Useful for debugging purposes only. It is recommend to leave it disabled.<br/>
* <br/>
* To enable set it to a value different than 0. Disabled by default.
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/scenes/CCLoaderScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ cc.LoaderScene = _ccsg.Scene.extend({
var texture2d = self._texture2d = new cc.Texture2D();
texture2d.initWithElement(img);
texture2d.handleLoadedTexture();
var logo = self._logo = new cc.Sprite(texture2d);
var logo = self._logo = new _ccsg.Sprite(texture2d);
logo.setScale(cc.contentScaleFactor());
logo.x = centerPos.x;
logo.y = centerPos.y;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/sprites/CCAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ cc.AnimationFrame.create = function(spriteFrame,delayUnits,userInfo){

/**
* <p>
* A cc.SpriteFrameAnimation object is used to perform animations on the cc.Sprite objects.<br/>
* A cc.SpriteFrameAnimation object is used to perform animations on the _ccsg.Sprite objects.<br/>
* <br/>
* The cc.SpriteFrameAnimation object contains cc.SpriteFrame objects, and a possible delay between the frames. <br/>
* You can animate a cc.SpriteFrameAnimation object by using the cc.Animate action.
Expand Down
6 changes: 3 additions & 3 deletions cocos2d/core/sprites/CCBakeSprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
/**
* cc.BakeSprite is a type of sprite that will be cached.
* @class
* @extends cc.Sprite
* @extends _ccsg.Sprite
*/
cc.BakeSprite = cc.Sprite.extend(/** @lends cc.BakeSprite# */{
cc.BakeSprite = _ccsg.Sprite.extend(/** @lends cc.BakeSprite# */{
_cacheCanvas: null,
_cacheContext: null,

ctor: function(){
cc.Sprite.prototype.ctor.call(this);
_ccsg.Sprite.prototype.ctor.call(this);
var canvasElement = document.createElement("canvas");
canvasElement.width = canvasElement.height = 10;
this._cacheCanvas = canvasElement;
Expand Down
Loading

0 comments on commit f86cad8

Please sign in to comment.