From 9fbaee07cca92a8f3f1fd4f82127d63cb47d1b8d Mon Sep 17 00:00:00 2001
From: Nan Wang
Date: Fri, 18 Mar 2016 16:43:47 +0800
Subject: [PATCH 1/3] fixed api types.
---
cocos2d/actions/CCActionInterval.js | 6 +++---
cocos2d/audio/CCAudio.js | 6 +++---
cocos2d/core/base-nodes/CCAtlasNode.js | 12 ++++++------
cocos2d/core/base-nodes/CCSGNode.js | 2 +-
cocos2d/core/value-types/CCSize.js | 2 +-
cocos2d/tilemap/CCSGTMXLayer.js | 14 +++++++-------
6 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/cocos2d/actions/CCActionInterval.js b/cocos2d/actions/CCActionInterval.js
index 59c2761741..12a3327062 100644
--- a/cocos2d/actions/CCActionInterval.js
+++ b/cocos2d/actions/CCActionInterval.js
@@ -119,12 +119,12 @@ cc.ActionInterval = cc.FiniteTimeAction.extend({
/**
* Implementation of ease motion.
- *
+ * @method easing
+ * @param {Object} easeObj
+ * @returns {ActionInterval}
* @example
* //example
* action.easeing(cc.easeIn(3.0));
- * @param {Object} easeObj
- * @returns {ActionInterval}
*/
easing: function (easeObj) {
if (this._easeList)
diff --git a/cocos2d/audio/CCAudio.js b/cocos2d/audio/CCAudio.js
index 93aa19b775..fb990d3496 100644
--- a/cocos2d/audio/CCAudio.js
+++ b/cocos2d/audio/CCAudio.js
@@ -599,7 +599,7 @@ JS.mixin(cc.Audio.prototype, {
/**
* Pause playing sound effect.
* @method pauseEffect
- * @param {Number} cc.Audio The return value of function playEffect.
+ * @param {Number} audio - The return value of function playEffect.
* @example
* //example
* cc.audioEngine.pauseEffect(audioID);
@@ -632,7 +632,7 @@ JS.mixin(cc.Audio.prototype, {
/**
* Resume playing sound effect.
* @method resumeEffect
- * @param {Number} cc.Audio The return value of function playEffect.
+ * @param {Number} audioID - The return value of function playEffect.
* @audioID
* //example
* cc.audioEngine.resumeEffect(audioID);
@@ -662,7 +662,7 @@ JS.mixin(cc.Audio.prototype, {
/**
* Stop playing sound effect.
* @method stopEffect
- * @param {Number} cc.Audio The return value of function playEffect.
+ * @param {Number} audioID - The return value of function playEffect.
* @example
* //example
* cc.audioEngine.stopEffect(audioID);
diff --git a/cocos2d/core/base-nodes/CCAtlasNode.js b/cocos2d/core/base-nodes/CCAtlasNode.js
index 1f1582fbab..a1fc727ab8 100644
--- a/cocos2d/core/base-nodes/CCAtlasNode.js
+++ b/cocos2d/core/base-nodes/CCAtlasNode.js
@@ -45,8 +45,8 @@ var EventTarget = cc.EventTarget;
* @example
* var node = new cc.AtlasNode("pathOfTile", 16, 16, 1);
*
- * @property {cc.Texture2D} texture - Current used texture
- * @property {cc.TextureAtlas} textureAtlas - Texture atlas for cc.AtlasNode
+ * @property {Texture2D} texture - Current used texture
+ * @property {TextureAtlas} textureAtlas - Texture atlas for cc.AtlasNode
* @property {Number} quadsToDraw - Number of quads to draw
*/
cc.AtlasNode = _ccsg.Node.extend(/** @lends cc.AtlasNode# */{
@@ -215,7 +215,7 @@ cc.AtlasNode = _ccsg.Node.extend(/** @lends cc.AtlasNode# */{
/**
* Initializes an CCAtlasNode with an atlas texture, the width, the height of each tile and the quantity of tiles to render
* @function
- * @param {cc.Texture2D} texture The atlas texture
+ * @param {Texture2D} texture The atlas texture
* @param {Number} tileWidth The width of each tile
* @param {Number} tileHeight The height of each tile
* @param {Number} itemsToRender The quantity of tiles to be rendered
@@ -228,7 +228,7 @@ cc.AtlasNode = _ccsg.Node.extend(/** @lends cc.AtlasNode# */{
/**
* Set node's color
* @function
- * @param {cc.Color} color Color object created with cc.color(r, g, b).
+ * @param {Color} color Color object created with cc.color(r, g, b).
*/
setColor: function(color){
this._renderCmd.setColor(color);
@@ -246,7 +246,7 @@ cc.AtlasNode = _ccsg.Node.extend(/** @lends cc.AtlasNode# */{
/**
* Get the current texture
* @function
- * @return {cc.Texture2D}
+ * @return {Texture2D}
*/
getTexture: function(){
return this._texture;
@@ -255,7 +255,7 @@ cc.AtlasNode = _ccsg.Node.extend(/** @lends cc.AtlasNode# */{
/**
* Replace the current texture with a new one
* @function
- * @param {cc.Texture2D} texture The new texture
+ * @param {Texture2D} texture The new texture
*/
setTexture: function(texture){
this._texture = texture;
diff --git a/cocos2d/core/base-nodes/CCSGNode.js b/cocos2d/core/base-nodes/CCSGNode.js
index abc4f99a70..a0a5e1e288 100644
--- a/cocos2d/core/base-nodes/CCSGNode.js
+++ b/cocos2d/core/base-nodes/CCSGNode.js
@@ -807,7 +807,7 @@ _ccsg.Node = cc.Class({
* The contentSize remains the same no matter the node is scaled or rotated.
* All nodes has a size. Layer and Scene has the same size of the screen by default.
* @function
- * @return {cc.Size} The untransformed size of the node.
+ * @return {Size} The untransformed size of the node.
*/
getContentSize: function () {
return cc.size(this._contentSize);
diff --git a/cocos2d/core/value-types/CCSize.js b/cocos2d/core/value-types/CCSize.js
index fb659872de..62e0e1e351 100644
--- a/cocos2d/core/value-types/CCSize.js
+++ b/cocos2d/core/value-types/CCSize.js
@@ -29,7 +29,7 @@ var JS = require('../platform/js');
/**
* cc.Size is the class for size object, please do not use its constructor to create sizes, use cc.size() alias function instead.
* It will be deprecated soon, please use cc.Vec2 instead
- * @class Size
+ * @class cc.Size
* @param {Number} width
* @param {Number} height
* @see cc.size
diff --git a/cocos2d/tilemap/CCSGTMXLayer.js b/cocos2d/tilemap/CCSGTMXLayer.js
index 7ce040ede2..71f120092b 100644
--- a/cocos2d/tilemap/CCSGTMXLayer.js
+++ b/cocos2d/tilemap/CCSGTMXLayer.js
@@ -108,7 +108,7 @@ _ccsg.TMXLayer = cc.SpriteBatchNode.extend(/** @lends _ccsg.TMXLayer# */{
/**
* Sets the untransformed size of the TMXLayer.
* @override
- * @param {cc.Size|Number} size The untransformed size of the TMXLayer or The untransformed size's width of the TMXLayer.
+ * @param {Size|Number} size The untransformed size of the TMXLayer or The untransformed size's width of the TMXLayer.
* @param {Number} [height] The untransformed size's height of the TMXLayer.
*/
setContentSize:function (size, height) {
@@ -119,7 +119,7 @@ _ccsg.TMXLayer = cc.SpriteBatchNode.extend(/** @lends _ccsg.TMXLayer# */{
/**
* Return texture of cc.SpriteBatchNode
* @function
- * @return {cc.Texture2D}
+ * @return {Texture2D}
*/
getTexture: function(){
return this._renderCmd.getTexture();
@@ -127,7 +127,7 @@ _ccsg.TMXLayer = cc.SpriteBatchNode.extend(/** @lends _ccsg.TMXLayer# */{
/**
* Gets layer size.
- * @return {cc.Size}
+ * @return {Size}
*/
getLayerSize:function () {
return cc.size(this._layerSize.width, this._layerSize.height);
@@ -135,7 +135,7 @@ _ccsg.TMXLayer = cc.SpriteBatchNode.extend(/** @lends _ccsg.TMXLayer# */{
/**
* Set layer size
- * @param {cc.Size} Var
+ * @param {Size} Var
*/
setLayerSize:function (Var) {
this._layerSize.width = Var.width;
@@ -157,7 +157,7 @@ _ccsg.TMXLayer = cc.SpriteBatchNode.extend(/** @lends _ccsg.TMXLayer# */{
/**
* Size of the map's tile (could be different from the tile's size)
- * @return {cc.Size}
+ * @return {Size}
*/
getMapTileSize:function () {
return cc.size(this._mapTileSize.width,this._mapTileSize.height);
@@ -165,7 +165,7 @@ _ccsg.TMXLayer = cc.SpriteBatchNode.extend(/** @lends _ccsg.TMXLayer# */{
/**
* Set the map tile size.
- * @param {cc.Size} Var
+ * @param {Size} Var
*/
setMapTileSize:function (Var) {
this._mapTileSize.width = Var.width;
@@ -317,7 +317,7 @@ _ccsg.TMXLayer = cc.SpriteBatchNode.extend(/** @lends _ccsg.TMXLayer# */{
* You can remove either by calling:
* - layer.removeChild(sprite, cleanup);
* - or layer.removeTileAt(ccp(x,y));
- * @param {cc.Vec2|Number} pos or x
+ * @param {Vec2|Number} pos or x
* @param {Number} [y]
* @return {_ccsg.Sprite}
*/
From 52c8d7551a4ba2b99d8ed6af6f661a7cc4f914cd Mon Sep 17 00:00:00 2001
From: Nan Wang
Date: Mon, 21 Mar 2016 11:23:11 +0800
Subject: [PATCH 2/3] fix audio source tooltip
---
README.mdown | 2 +-
cocos2d/core/components/CCAudioSource.js | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/README.mdown b/README.mdown
index edf6964a37..bb9fdb495a 100644
--- a/README.mdown
+++ b/README.mdown
@@ -1,4 +1,4 @@
-Cocos2d-html5
+Cocos Creator Game Engine
==================
[Cocos2d-html5][1] is a cross-platform 2D game engine written in Javascript, based on [Cocos2d-X][2] and licensed under MIT.
diff --git a/cocos2d/core/components/CCAudioSource.js b/cocos2d/core/components/CCAudioSource.js
index a36efc3952..02a54e893a 100644
--- a/cocos2d/core/components/CCAudioSource.js
+++ b/cocos2d/core/components/CCAudioSource.js
@@ -81,7 +81,7 @@ var AudioSource = cc.Class({
this._clip = value;
},
url: cc.AudioClip,
- tooltip: 'i18n.COMPONENT.audio.clip',
+ tooltip: 'i18n:COMPONENT.audio.clip',
animatable: false
},
@@ -106,7 +106,7 @@ var AudioSource = cc.Class({
}
}
},
- tooltip: 'i18n.COMPONENT.audio.volume'
+ tooltip: 'i18n:COMPONENT.audio.volume'
},
/**
@@ -141,7 +141,7 @@ var AudioSource = cc.Class({
}
},
animatable: false,
- tooltip: 'i18n.COMPONENT.audio.mute',
+ tooltip: 'i18n:COMPONENT.audio.mute',
},
/**
@@ -159,7 +159,7 @@ var AudioSource = cc.Class({
if (this.audio) this.audio.loop = this._loop;
},
animatable: false,
- tooltip: 'i18n.COMPONENT.audio.loop'
+ tooltip: 'i18n:COMPONENT.audio.loop'
},
/**
@@ -170,7 +170,7 @@ var AudioSource = cc.Class({
*/
playOnLoad: {
default: false,
- tooltip: 'i18n.COMPONENT.audio.play_on_load',
+ tooltip: 'i18n:COMPONENT.audio.play_on_load',
animatable: false
}
},
From 3819f4f8f9c0c83b4cef9a6b84683d1af399372b Mon Sep 17 00:00:00 2001
From: Nan Wang
Date: Mon, 21 Mar 2016 12:19:19 +0800
Subject: [PATCH 3/3] add spine component tooltips.
---
extensions/spine/Skeleton.js | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/extensions/spine/Skeleton.js b/extensions/spine/Skeleton.js
index e16d00c9e8..92835d2b0d 100644
--- a/extensions/spine/Skeleton.js
+++ b/extensions/spine/Skeleton.js
@@ -55,7 +55,7 @@ sp.Skeleton = cc.Class({
name: 'sp.Skeleton',
extends: cc._RendererUnderSG,
editor: CC_EDITOR && {
- menu: 'i18n:MAIN_MENU.component.others/Spine Skeleton',
+ menu: 'i18n:MAIN_MENU.component.renderers/Spine Skeleton',
help: 'app://docs/html/components/spine.html',
//playOnFocus: true
},
@@ -76,6 +76,7 @@ sp.Skeleton = cc.Class({
this.defaultAnimation = '';
this._refresh();
},
+ tooltip: 'i18n:COMPONENT.skeleton.skeleton_data'
},
///**
@@ -171,7 +172,8 @@ sp.Skeleton = cc.Class({
},
type: DefaultSkinsEnum,
visible: true,
- displayName: "Default Skin"
+ displayName: "Default Skin",
+ tooltip: 'i18n:COMPONENT.skeleton.default_skin'
},
// value of 0 represents no animation
@@ -212,7 +214,8 @@ sp.Skeleton = cc.Class({
},
type: DefaultAnimsEnum,
visible: true,
- displayName: 'Animation'
+ displayName: 'Animation',
+ tooltip: 'i18n:COMPONENT.skeleton.animation'
},
//// for inspector
@@ -233,7 +236,12 @@ sp.Skeleton = cc.Class({
* @property {boolean} loop
* @default true
*/
- loop: true,
+ loop: {
+ default: true,
+ type: Boolean,
+ tooltip: 'i18n:COMPONENT.skeleton.loop'
+ },
+
/**
* The time scale of this skeleton.
@@ -246,7 +254,8 @@ sp.Skeleton = cc.Class({
if (this._sgNode) {
this._sgNode.setTimeScale(this.timeScale);
}
- }
+ },
+ tooltip: 'i18n:COMPONENT.skeleton.time_scale'
},
/**
@@ -262,6 +271,7 @@ sp.Skeleton = cc.Class({
}
},
editorOnly: true,
+ tooltip: 'i18n:COMPONENT.skeleton.debug_slots'
},
/**
@@ -277,6 +287,7 @@ sp.Skeleton = cc.Class({
}
},
editorOnly: true,
+ tooltip: 'i18n:COMPONENT.skeleton.debug_bones'
}
},