1
2
|
void
CCNode::setScale(
float
scale)
scaleX,
scaleY)
|
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
JSBool js_cocos2dx_Node_setScale(JSContext *cx,uint32_t argc,jsval *vp)
{
jsval *argv = JS_ARGV(cx,vp);
JSBool ok = JS_TRUE;
JSObject *obj = NULL;
cocos2d::Node* cobj = NULL;
obj = JS_THIS_OBJECT(cx,vp);
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj,cx,JS_FALSE,
"js_cocos2dx_Node_setScale : Invalid Native Object"
);
do
{
if
(argc == 2) {
double
arg0;
ok &= JS_ValueToNumber(cx,argv[0],&arg0);
(!ok) { ok = JS_TRUE;
break
; }
arg1;
; }
cobj->setScale(arg0,arg1);
JS_SET_RVAL(cx,vp,JSVAL_VOID);
return
JS_TRUE;
}
}
while
(0);
{
(argc == 1) {
arg0;
; }
cobj->setScale(arg0);
JS_TRUE;
}
(0);
JS_ReportError(cx,monospace!important; font-size:1em!important; min-height:inherit!important; color:blue!important">"js_cocos2dx_Node_setScale : wrong number of arguments"
);
JS_FALSE;
}
11
setPosition:
function
(newPosOrxValue,yValue) {
var
locPosition =
this
._position;
if
(arguments.length == 2) {
locPosition._x = newPosOrxValue;
locPosition._y = yValue;
}
else
(arguments.length == 1) {
locPosition._x = newPosOrxValue.x;
locPosition._y = newPosOrxValue.y;
}
.setNodeDirty();
},