标签:button textfield scene end 不同 tac sse 节点 微软
settingScene = ccs.load(res.setting_json).node;2、在当前层中增加改节点。
this.addChild(settingScene);3、通过ccui.helper.seekWidgetByName(node,name)获得控件
musicSlider = ccui.helper.seekWidgetByName(settingScene, "musicSlider");4、通过addCCSEventListener监听事件(sender,type)
musicSlider.addCCSEventListener(this.sliderStateChange);5、不同的控件监听事件的时候type不同
ccui.Slider.EVENT_PERCENT_CHANGED能够得到的数据:
sender.getPercent()
(2)buttonswitch (type) {(3)TextField
case ccui.Widget.TOUCH_BEGAN:
break;
case ccui.Widget.TOUCH_MOVED:
break;
case ccui.Widget.TOUCH_ENDED:
break;
case ccui.Widget.TOUCH_CANCELED:
break;
default:
break;
}
switch (type) {(4)checkbox
case ccui.TextField.EVENT_ATTACH_WITH_IME:
break;
case ccui.TextField.EVENT_DETACH_WITH_IME:
break;
case ccui.TextField.EVENT_INSERT_TEXT:
break;
case ccui.TextField.EVENT_DELETE_BACKWARD:
break;
default:
break;
}
switch (type) {
case ccui.CheckBox.EVENT_SELECTED:
break;
case ccui.CheckBox.EVENT_UNSELECTED:
break;
default:
break;
}
cocos2d-js的UI用cocoStudio结合开发笔记
标签:button textfield scene end 不同 tac sse 节点 微软
原文地址:http://www.cnblogs.com/jzdwajue/p/6717781.html