var button = ccui.Button.create(res.button1,res.button1,"");
button.x=400;
button.y=125;
button.addTouchEventListener(this.touchEvent1,this);
this.addChild(button);
var helloLabel = new cc.LabelTTF("你好啊\n我爱中国", "Arial", 38);
// position the label on the center of the screen
helloLabel.x = 300;
helloLabel.y = 100 ;
// add the label as a child to this layer
helloLabel.setColor(cc.color(150,150,150));
//helloLabel.setDimensions(400,300);
this.addChild(helloLabel);
return true;
},
touchEvent1: function(sender, type){
ccui.button.setColor(cc.color(150,150,150));
ccui.helloLabel.setString("haha");
cc.log("你输入的内容是:");
}
是ccui.helloLabel.setString(“haha”);不对吗?到底要怎么写?为什么按的时候提示错误,说不存在