From 309df021ae2b4cc5cb6bb3caeae9c9ab7fc6963b Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Thu, 7 Apr 2016 10:44:31 +0800 Subject: [PATCH] fix CCScene CCGame CCSceneAsset API --- cocos2d/core/CCGame.js | 44 ++++++++++++++++++++--------------------- cocos2d/core/CCScene.js | 8 ++++---- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cocos2d/core/CCGame.js b/cocos2d/core/CCGame.js index df42aab08d..29e4d18fbd 100644 --- a/cocos2d/core/CCGame.js +++ b/cocos2d/core/CCGame.js @@ -31,7 +31,7 @@ if (!(CC_EDITOR && Editor.isCoreLevel)) { /** * !#en An object to boot the game. - * !#zh 一个启动游戏的对象。 + * !#zh 包含游戏主体信息并负责驱动游戏的游戏对象。 * @class Game */ var game = /** @lends cc.game# */{ @@ -97,14 +97,14 @@ var game = /** @lends cc.game# */{ frame: null, /** * !#en The container of game canvas, equals to cc.container. - * !#zh 游戏画布的容器,等于 cc.container。 + * !#zh 游戏画布的容器。 * @property container * @type {Object} */ container: null, /** * !#en The canvas of the game, equals to cc._canvas. - * !#zh 游戏的画布,等于 cc._canvas。 + * !#zh 游戏的画布。 * @property canvas * @type {Object} */ @@ -139,8 +139,8 @@ var game = /** @lends cc.game# */{ * Please DO NOT modify this object directly, it won't have any effect.
* !#zh * 当前的游戏配置,包括:
- * 1. debugMode(debug 模式)
- * "debugMode" 各类显示数值的意思。
+ * 1. debugMode(debug 模式,但是在浏览器中这个选项会被忽略)
+ * "debugMode" 各种设置选项的意义。
* 0 - 没有消息被打印出来。
* 1 - cc.error,cc.assert,cc.warn,cc.log 将打印在 console 中。
* 2 - cc.error,cc.assert,cc.warn 将打印在 console 中。
@@ -151,14 +151,14 @@ var game = /** @lends cc.game# */{ * 2. showFPS(显示 FPS)
* 当 showFPS 为 true 的时候界面的左下角将显示 fps 的信息,否则被隐藏。
* 3. frameRate (帧率)
- * “frameRate” 设置想要的帧率你的游戏,但真正的FPS取决于你的游戏实施和运行环境。
+ * “frameRate” 设置想要的帧率你的游戏,但真正的FPS取决于你的游戏实现和运行环境。
* 4. id
- * "gameCanvas" 设置画布元素的 ID 在网页上,仅适用于 web 端。
+ * "gameCanvas" Web 页面上的 Canvas Element ID,仅适用于 web 端。
* 5. renderMode(渲染模式)
- * “renderMode” 关于设置渲染器类型,仅适用于 web 端:
+ * “renderMode” 设置渲染器类型,仅适用于 web 端:
* 0 - 通过引擎自动选择。
* 1 - 强制使用 canvas 渲染。 - * 2 - 强制使用 WebGL 渲染,但是在浏览器中这个选项会被忽略。
+ * 2 - 强制使用 WebGL 渲染,但是在部分 Android 浏览器中这个选项会被忽略。
* 6. scenes
* “scenes” 当前包中可用场景。
*
@@ -170,7 +170,7 @@ var game = /** @lends cc.game# */{ /** * !#en Callback when the scripts of engine have been load. - * !#zh 当引擎的脚本已被加载后的回调函数。 + * !#zh 当引擎完成启动后的回调函数。 * @method onStart * @type {Function} */ @@ -230,7 +230,7 @@ var game = /** @lends cc.game# */{ /** * !#en Resume the game from pause. - * !#zh 恢复暂停时的游戏 + * !#zh 继续游戏 * @method resume */ resume: function () { @@ -244,7 +244,7 @@ var game = /** @lends cc.game# */{ /** * !#en Check whether the game is paused. - * !#zh 检查游戏是否暂停。 + * !#zh 判断游戏是否暂停。 * @method isPaused * @return {Boolean} */ @@ -254,7 +254,7 @@ var game = /** @lends cc.game# */{ /** * !#en Restart game. - * !#zh 重新开始播放游戏 + * !#zh 重新开始游戏 * @method restart */ restart: function () { @@ -268,7 +268,7 @@ var game = /** @lends cc.game# */{ // @Game loading /** * !#en Prepare game. - * !#zh 准备游戏。 + * !#zh 准备引擎,请不要直接调用这个函数。 * @param {Function} cb * @method prepare */ @@ -300,14 +300,14 @@ var game = /** @lends cc.game# */{ /** * !#en cc.view is the shared view object. - * !#zh cc.view 是共享的视图对象。 + * !#zh cc.view 是全局的视图对象。 * @property view * @type {View} */ cc.view = View ? View._getInstance() : null; /** - * !#en TODO + * !#en Director * !#zh 导演类。 * @property director * @type {Director} @@ -354,13 +354,13 @@ var game = /** @lends cc.game# */{ /** * !#en cc.game is the singleton object for game related functions. - * !#zh cc.game 是游戏相关的功能单例对象。 + * !#zh cc.game 是 Game 的实例,用来驱动整个游戏。 * @class Game */ /** * !#en Run game with configuration object and onStart function. - * !#zh 运行游戏配置对象和 onStart 函数。 + * !#zh 运行游戏,并且指定引擎配置和 onStart 的回调。 * @method run * @param {Object|Function} [config] - Pass configuration object or onStart function * @param {Function} [onStart] - function to be executed after game initialized @@ -387,8 +387,8 @@ var game = /** @lends cc.game# */{ * Add a persistent root node to the game, the persistent node won't be destroyed during scene transition.
* The target node must be placed in the root level of hierarchy, otherwise this API won't have any effect. * !#zh - * 添加不自动销毁的节点,该节点不会被在场景切换中被销毁。
- * 目标节点必须放置在根级别的层次结构下,否则该 API 不产生任何影响。 + * 声明常驻根节点,该节点不会被在场景切换中被销毁。
+ * 目标节点必须位于为层级的根节点,否则无效。 * @method addPersistRootNode * @param {Node} node - The node to be made persistent */ @@ -420,7 +420,7 @@ var game = /** @lends cc.game# */{ /** * !#en Remove a persistent root node. - * !#zh 移除不自动销毁的节点。 + * !#zh 取消常驻根节点。 * @method removePersistRootNode * @param {Node} node - The node to be removed from persistent node list */ @@ -436,7 +436,7 @@ var game = /** @lends cc.game# */{ /** * !#en Check whether the node is a persistent root node. - * !#zh 检查节点是否是不自动销毁的节点。 + * !#zh 检查节点是否是常驻根节点。 * @method isPersistRootNode * @param {Node} node - The node to be checked * @return {Boolean} diff --git a/cocos2d/core/CCScene.js b/cocos2d/core/CCScene.js index 4e7ba8c2ee..d33ae4c464 100644 --- a/cocos2d/core/CCScene.js +++ b/cocos2d/core/CCScene.js @@ -26,11 +26,11 @@ var NIL = function () {}; /** * !#en - * cc.Scene is a subclass of ccsg.Node that is used only as an abstract concept.
- * cc.Scene and ccsg.Node are almost identical with the difference that users can not modify cc.Scene manually. + * cc.Scene is a subclass of cc.Node that is used only as an abstract concept.
+ * cc.Scene and cc.Node are almost identical with the difference that users can not modify cc.Scene manually. * !#zh - * cc.Scene 是 ccsg.Node 的子类,仅作为一个抽象的概念。
- * cc.Scene 和 ccsg.Node 差异几乎相同,用户无法手工修改 cc.Scene。 + * cc.Scene 是 cc.Node 的子类,仅作为一个抽象的概念。
+ * cc.Scene 和 cc.Node 有点不同,用户不应直接修改 cc.Scene。 * @class Scene * @extends _BaseNode */