摘要: 如题 阅读全文
posted @ 2019-12-07 19:47 流星曳尾 阅读(429) 评论(0) 推荐(0)
摘要: 需将拖动物坐标和要飞向物坐标转化为整个layer的坐标,因为人们判断远近是根据整个layer来看的。 阅读全文
posted @ 2019-12-07 11:13 流星曳尾 阅读(333) 评论(0) 推荐(0)
摘要: 可能是json文件中file的Path不对引起的。因为生成的path是根据文件在项目中的path生成的,即当此特效不是项目的一级目录时,会带有项目中上级目录,导致找不到文件(不会报错)。 ccs.load(jsonfile,josnfile的上级目录)中的josnfile的上级目录加上json文件中 阅读全文
posted @ 2019-11-26 14:51 流星曳尾 阅读(193) 评论(0) 推荐(0)
摘要: cc.rectContainsPoint(rect, point);此中rect常用node.getBoundingBox()方法取得,而这个方法通过node的x,y和width,height算得。也就带来了此中rect常用node和point在不同parent下时,坐标系不同。当使用时,应统一坐标 阅读全文
posted @ 2019-11-25 14:38 流星曳尾 阅读(1283) 评论(0) 推荐(0)
摘要: 如题 阅读全文
posted @ 2019-11-22 14:36 流星曳尾 阅读(144) 评论(0) 推荐(0)
摘要: let testLayer = new TestLayer1();this.addChild(testLayer);let TestLayer1 = cc.Layer.extend({ ctor:function(){ this._super(); }, onEnter: function () { 阅读全文
posted @ 2019-11-22 14:29 流星曳尾 阅读(165) 评论(0) 推荐(0)
摘要: let progressTimer= new cc.ProgressTimer(new cc.Sprite(fileName));this.addChild(progressTimer);progressTimer.setType(cc.ProgressTimer.TYPE_RADIAL);//圆形 阅读全文
posted @ 2019-11-20 16:02 流星曳尾 阅读(613) 评论(0) 推荐(0)
摘要: testSprite.runAction(cc.Sequence(cc.moveTo(x,y), cc.CallFunc(Func, this))); cc.CallFunc 调用回调函数 阅读全文
posted @ 2019-11-18 16:52 流星曳尾 阅读(174) 评论(0) 推荐(0)
摘要: MoveTo和MoveBy可以使精灵移动,区别在于MoveTo是移动到给定的坐标点;而MoveBy是从当前坐标点移动给定的坐标点这么多的距离。举个例子,假定精灵当前的坐标点是(x, y),分别给MoveTo和MoveBy指定一个坐标点(x1, y1),那么MoveTo和MoveBy最终的效果分别如下 阅读全文
posted @ 2019-11-18 16:48 流星曳尾 阅读(1098) 评论(0) 推荐(0)
摘要: let 声明变量用于块级作用域中 阅读全文
posted @ 2019-10-23 15:39 流星曳尾 阅读(93) 评论(0) 推荐(0)