update node api (#3213)

This commit is contained in:
Knox
2018-09-07 10:37:35 +08:00
committed by pandamicro
parent 6c4994692a
commit f2216af33a
2 changed files with 17 additions and 10 deletions
+3 -3
View File
@@ -860,7 +860,7 @@ var Node = cc.Class({
/**
* !#en Skew x
* !#zh 该节点 Y 轴倾斜角度。
* !#zh 该节点 X 轴倾斜角度。
* @property skewX
* @type {Number}
* @example
@@ -880,7 +880,7 @@ var Node = cc.Class({
/**
* !#en Skew y
* !#zh 该节点 X 轴倾斜角度。
* !#zh 该节点 Y 轴倾斜角度。
* @property skewY
* @type {Number}
* @example
@@ -2296,7 +2296,7 @@ var Node = cc.Class({
* Set world position.
* This is not a public API yet, its usage could be updated
* @method setWorldPos
* @param {vec3} pos
* @param {Vec3} pos
*/
setWorldPos (pos) {
// NOTE: this is faster than invert world matrix and transform the point
+14 -7
View File
@@ -338,18 +338,25 @@ var BaseNode = cc.Class({
},
/**
* !#en The parent of the node.
* !#zh 该节点的父节点。
* @property parent
* @type {Node}
* @default null
* !#en Get parent of the node.
* !#zh 获取该节点的父节点。
* @method getParent
* @return {Node}
* @example
* node.parent = newNode;
* var parent = this.node.getParent();
*/
getParent () {
return this._parent;
},
/**
* !#en Set parent of the node.
* !#zh 设置该节点的父节点。
* @method setParent
* @param {Node} value
* @example
* node.setParent(newNode);
*/
setParent (value) {
if (this._parent === value) {
return;
@@ -501,7 +508,7 @@ var BaseNode = cc.Class({
* !#en Get the sibling index.
* !#zh 获取同级索引。
* @method getSiblingIndex
* @return {number}
* @return {Number}
* @example
* var index = node.getSiblingIndex();
*/