tweak api syntax

This commit is contained in:
Jare Guo
2016-01-08 17:41:51 +08:00
parent 3bceab21d2
commit 7ed4ea56fb
4 changed files with 20 additions and 17 deletions
+5 -7
View File
@@ -467,9 +467,8 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
* Run a scene. Replaces the running scene with a new one or enter the first scene.
* @method runScene
* @param {Scene} scene - The need run scene.
* @param {Function} [onBeforeLoadScene] - The function at the scene before loading.
*/
runScene: function (scene, onBeforeLoadScene) {
runScene: function (scene, _onBeforeLoadScene) {
cc.assert(scene, cc._LogInfos.Director.pushScene);
// detach persist nodes
@@ -492,8 +491,8 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
// purge destroyed nodes belongs to old scene
cc.Object._deferredDestroy();
if (onBeforeLoadScene) {
onBeforeLoadScene();
if (_onBeforeLoadScene) {
_onBeforeLoadScene();
}
this.emit(cc.Director.EVENT_BEFORE_SCENE_LAUNCH, scene);
@@ -544,10 +543,9 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
* @method loadScene
* @param {String} sceneName - The name of the scene to load.
* @param {Function} [onLaunched] - callback, will be called after scene launched.
* @param {Function} [onUnloaded] - callback, will be called when the previous scene was unloaded.
* @return {Boolean} if error, return false
*/
loadScene: function (sceneName, onLaunched, onUnloaded) {
loadScene: function (sceneName, onLaunched, _onUnloaded) {
var uuid, info;
if (this._loadingScene) {
cc.error('[loadScene] Failed to load scene "%s" because "%s" is already loading', sceneName, this._loadingScene);
@@ -582,7 +580,7 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
}
if (uuid) {
this._loadingScene = sceneName;
this._loadSceneByUuid(uuid, onLaunched, onUnloaded);
this._loadSceneByUuid(uuid, onLaunched, _onUnloaded);
return true;
}
else {
+14
View File
@@ -1089,24 +1089,38 @@ if (cc.sys.isNative) {
/**
* @event position-changed
* @param {cc.Event} event
* @param {cc.Vec2} event.detail - old position
*/
/**
* @event rotation-changed
* @param {cc.Event} event
* @param {Number} event.detail - old rotation x
*/
/**
* @event scale-changed
* @param {cc.Event} event
* @param {cc.Vec2} event.detail - old scale
*/
/**
* @event size-changed
* @param {cc.Event} event
* @param {cc.Size} event.detail - old size
*/
/**
* @event anchor-changed
* @param {cc.Event} event
* @param {cc.Vec2} event.detail - old anchor
*/
/**
* @event color-changed
* @param {cc.Event} event
* @param {cc.Color} event.detail - old color
*/
/**
* @event opacity-changed
* @param {cc.Event} event
* @param {Number} event.detail - old opacity
*/
Node.EventType = EventType;
+1
View File
@@ -61,6 +61,7 @@ var Canvas = cc.Class({
/**
* Current active canvas, the scene should only have one active canvas at the same time.
* @property {Canvas} instance
* @static
*/
instance: null
},
-10
View File
@@ -218,16 +218,6 @@ var _metaClass = {
if (CC_DEV) {
Object.defineProperty(this.prototype, name, {
//set: function setter_editorWrapper (value) {
// if (this._observing) {
// Object.getNotifier(this).notify({
// type: 'update',
// name: name,
// oldValue: this[name]
// });
// }
// setter.call(this, value);
//},
set: setter,
configurable: true,
enumerable: true