ccc 单点触控

cc.Class({
extends: cc.Component, properties: { }, // use this for initialization
onLoad: function () {
this.registerTouch()
}, registerTouch:function () {
var self=this cc.eventManager.addListener({
event: cc.EventListener.TOUCH_ONE_BY_ONE, //开始
onTouchBegan: function(touch, event) {
cc.log("began") return true; // don't capture event
}, //移动
onTouchMoved: function( touch, event) {
cc.log("moved")
}, //结束
onTouchEnded: function(touch, event) {
cc.log("end")
}
}, self.node);
} // called every frame, uncomment this function to activate update callback
// update: function (dt) { // },
});
上一篇:Python3基础-特别函数(map filter partial reduces sorted)实例学习


下一篇:SVM算法