设定schedule 每隔1秒向鼠标拖拽的当前位置发射一个Sprite
2016-06-22 09:12
387 查看
mySprite:null,
var that = this; that.schedule(0.001,cc.REPEAT_FOREVER);//定时器 var listener = cc.EventListener.create({ event: cc.EventListener.TOUCH_ONE_BY_ONE, swallowTouches: true, // 吞没事件 onTouchBegan: function (touch, event) { return true; }, onTouchMoved:function(touch,event){ that.mySprite = new cc.Sprite("res/mySprite.png"); that.mySprite.setPosition(touch.getLocation().x,touch.getLocation().y); that.addChild(that.mySprite); }, }) cc.eventManager.addListener(listener,this); }
相关文章推荐
- 鼠标点击角度
- Eclipse的SVN插件与本地客户端关联不上解决方案
- 关闭ubuntu中的”System Program Problem Detected”提示
- 素材网址
- Delphi中window消息截获的实现方式(2)
- Ubuntu安装Oracle 11g出现INS_RDBMS.MK的'all_no_orcl'错误
- JavaScript语法
- 小心陷阱!MySQL中处理Null时需注意两点
- activemq和mqtt消息总线
- IntelliSense: 应输入“;” c:\Program Files (x86)\Windows Kits\8.0\Include\um\gl\GL.h 1157 11 Win32Project2
- 不容错过的iOS 8的导航交互
- Delphi中window消息截获的实现方式(1)
- 关于Ubuntu的使用记录
- Java编程注意事项
- 计算机网络学习笔记一
- yii 验证问题
- Delphi Dll 消息处理
- 深入浅出之正则表达式(二)
- 深入浅出之正则表达式(一)
- Ti:关于Idea模块化部署web项目(非maven)