Actor API增加完成
This commit is contained in:
@@ -17,47 +17,188 @@ class Actor extends BaseNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名字
|
||||
* @function
|
||||
* @param {string} Name
|
||||
* @returns {void}
|
||||
*/
|
||||
function SetName(Name) {
|
||||
sq_SetName(this.C_Object, Name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取名字
|
||||
* @function
|
||||
* @returns {string}
|
||||
*/
|
||||
function GetName() {
|
||||
return sq_GetName(this.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加子对象
|
||||
* @function
|
||||
* @param {Actor} Act
|
||||
* @returns {void}
|
||||
*/
|
||||
function AddChild(Act) {
|
||||
sq_AddChild(this.C_Object, Act.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除子对象
|
||||
* @function
|
||||
* @param {Actor} Act
|
||||
* @returns {void}
|
||||
*/
|
||||
function RemoveChild(Act) {
|
||||
sq_RemoveChild(this.C_Object, Act.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置层级
|
||||
* @function
|
||||
* @param {integer} Order
|
||||
* @returns {void}
|
||||
*/
|
||||
function SetZOrder(Order) {
|
||||
sq_SetZOrder(this.C_Object, Order);
|
||||
}
|
||||
|
||||
function SetScale(Value, ...) {
|
||||
if (vargv.len() == 0)
|
||||
sq_SetScale(this.C_Object, Value);
|
||||
else if (vargv.len() == 1)
|
||||
sq_SetScale(this.C_Object, Value, vargv[0]);
|
||||
/**
|
||||
* 获取层级
|
||||
* @function
|
||||
* @returns {*}
|
||||
*/
|
||||
function GetZOrder() {
|
||||
return sq_GetZOrder(this.C_Object);
|
||||
}
|
||||
|
||||
function SetPos(Value, ...) {
|
||||
if (vargv.len() == 0) {
|
||||
sq_SetPos(this.C_Object, Value);
|
||||
} else if (vargv.len() == 1) {
|
||||
sq_SetPos(this.C_Object, Value, vargv[0]);
|
||||
/**设置坐标 */
|
||||
function SetPos(...) {
|
||||
if (vargv.len() == 1) {
|
||||
sq_SetPos(this.C_Object, vargv[0]);
|
||||
} else if (vargv.len() == 2) {
|
||||
sq_SetPos(this.C_Object, vargv[0], vargv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
function GetSize(){
|
||||
|
||||
/**
|
||||
* 获取坐标
|
||||
* @function
|
||||
*/
|
||||
function GetPos() {
|
||||
return sq_GetPos(this.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取世界坐标
|
||||
* @function
|
||||
*/
|
||||
function GetWorldPos() {
|
||||
return sq_GetWorldPos(this.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置透明度
|
||||
* @function
|
||||
* @param {integer} Alpha
|
||||
* @returns {void}
|
||||
*/
|
||||
function SetAlpha(Alpha) {
|
||||
sq_SetAlpha(this.C_Object, Alpha);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取透明度
|
||||
* @function
|
||||
* @returns {integer}
|
||||
*/
|
||||
function GetAlpha() {
|
||||
return sq_GetAlpha(this.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置缩放
|
||||
* @function
|
||||
*/
|
||||
function SetScale(Value, ...) {
|
||||
if (vargv.len() == 0) sq_SetScale(this.C_Object, Value);
|
||||
else if (vargv.len() == 1) sq_SetScale(this.C_Object, Value, vargv[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缩放
|
||||
* @function
|
||||
*/
|
||||
function GetScale() {
|
||||
return sq_GetScale(this.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置旋转角度
|
||||
* @function
|
||||
* @param {float} Angle
|
||||
* @returns {void}
|
||||
*/
|
||||
function SetRotation(Angle) {
|
||||
sq_SetRotation(this.C_Object, Angle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取旋转角度
|
||||
* @function
|
||||
* @returns {float}
|
||||
*/
|
||||
function GetRotation() {
|
||||
return sq_GetRotation(this.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置大小
|
||||
* @function
|
||||
* @returns {void}
|
||||
*/
|
||||
function SetSize(Value, ...) {
|
||||
if (vargv.len() == 0) sq_SetScale(this.C_Object, Value);
|
||||
else if (vargv.len() == 1) sq_SetScale(this.C_Object, Value, vargv[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取大小
|
||||
* @function
|
||||
*/
|
||||
function GetSize() {
|
||||
return sq_GetSize(this.C_Object);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置可见性
|
||||
* @function
|
||||
* @param {boolean} Flag
|
||||
* @returns {void}
|
||||
*/
|
||||
function SetVisible(Flag) {
|
||||
sq_SetVisible(this.C_Object, Flag);
|
||||
}
|
||||
|
||||
|
||||
function GetWorldPos(){
|
||||
return sq_GetWorldPos(this.C_Object);
|
||||
/**
|
||||
* 获取可见性
|
||||
* @function
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function GetVisible() {
|
||||
return sq_GetVisible(this.C_Object);
|
||||
}
|
||||
|
||||
function SetName(Name) {
|
||||
sq_SetName(this.C_Object, Name);
|
||||
/**
|
||||
*
|
||||
* @function
|
||||
* @param {BLENDMODE} BlendMode
|
||||
* @returns {void}
|
||||
*/
|
||||
function SetBlendMode(BlendMode) {
|
||||
sq_SetBlendMode(this.C_Object, BlendMode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user