mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 08:42:43 +08:00
update node api (#3213)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user