2015年9月17日

摘要: function cc.exports.VerticalVector(vec)--求出两个垂直向量 local result = {} result[1] = cc.p(vec.y/vec.x,-1)--向下方向 result[2] = cc.p(-vec.y/vec.x,1)--向上方向 ... 阅读全文
posted @ 2015-09-17 17:36 HemJohn 阅读(1589) 评论(0) 推荐(0) 编辑
摘要: cc.exports.LineCollideRect(startLine,endLine,rect)--向量与矩形检测碰撞 --获取矩形的四个顶点位置 local p = {cc.p(rect.x,rect.y),cc.p(rect.x + rect.width,rect.y),cc.p(rec... 阅读全文
posted @ 2015-09-17 17:27 HemJohn 阅读(707) 评论(0) 推荐(0) 编辑
摘要: 在之前,笔者写过一编博客,通过lua在加载场景加载spineAnimation动画精灵,保存在table中,然后在游戏中创建动画精灵时,提取加载好的spineAnimaiton中的spSkeletonData来创建spineAnimation,但后来笔者发现重复创建spineAnimation时,全... 阅读全文
posted @ 2015-09-17 12:30 HemJohn 阅读(715) 评论(0) 推荐(0) 编辑
摘要: 首先要创建一个layer,设置该层为可触摸layer:setTouchEnabled(true)注册触摸事件local listener = cc.EventListenerTouchOneByOne:create()listener:setSwallowTouches(true)listener:... 阅读全文
posted @ 2015-09-17 12:04 HemJohn 阅读(979) 评论(0) 推荐(0) 编辑

导航