上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 38 下一页
摘要: 使用setFlippedX后,又改变锚点为1。此时代码中坐标需要相对于cocos studio 中增加它本身的width,因为(0.5,0.5)是相对于自己中点的翻转,不变坐标。而(1,0.5)是相对于自己最右边的翻转,会改变坐标(例:最右边向右平移一个自己的width。注:即时之后setConte 阅读全文
posted @ 2019-12-26 13:49 流星曳尾 阅读(143) 评论(0) 推荐(0)
摘要: 今天写代码,报找不到function。然后又不为空。最后发现是类型不对。因为是数组,所以不能用node.function(),而应该用nodeArr[0].function。错用前者会找不到function。干。因为这个node是用arr.splice()返回的,而我当时又不知道返回的是数组,所以就 阅读全文
posted @ 2019-12-25 14:31 流星曳尾 阅读(171) 评论(0) 推荐(0)
摘要: let arr = [51,68,98,78];let result = arr.splice(1,1);//[68]let arr2 = [51,68,98,78];let result2 = arr2.splice(1,2);//[98,78] 阅读全文
posted @ 2019-12-25 14:25 流星曳尾 阅读(1081) 评论(1) 推荐(0)
摘要: 发现是因为没有addChild到父节点上引起的 阅读全文
posted @ 2019-12-19 19:12 流星曳尾 阅读(349) 评论(0) 推荐(0)
摘要: cc.repeat(action, times)cc.repeatForever(action)例:sprite.runAction(cc.repeatForever(cc.rotateBy(1,360))); 阅读全文
posted @ 2019-12-19 15:33 流星曳尾 阅读(91) 评论(0) 推荐(0)
摘要: 如题 阅读全文
posted @ 2019-12-18 15:01 流星曳尾 阅读(132) 评论(0) 推荐(0)
摘要: cc.formatStr() 第一个变量为含有 %s 或 %d 的字符串 后面依次为%s或%d对应的内容 阅读全文
posted @ 2019-12-17 15:25 流星曳尾 阅读(658) 评论(0) 推荐(0)
摘要: let arr1 = [1,3,5],arr2 = [2,32,78],arr3 = [];arr3 = arr1.concat(arr2);// arr1 = [1,3,5] arr2 = [2,32,78] arr3 = [1,3,5,2,32,78] 阅读全文
posted @ 2019-12-16 14:16 流星曳尾 阅读(589) 评论(0) 推荐(0)
摘要: 通过事件传递信息 阅读全文
posted @ 2019-12-12 17:24 流星曳尾 阅读(78) 评论(0) 推荐(0)
摘要: et listView = new ccui.ListView();this.addChild(listView,9999);listView.setDirection(ccui.ScrollView.DIR_VERTICAL);listView.setTouchEnabled(true);list 阅读全文
posted @ 2019-12-12 14:59 流星曳尾 阅读(556) 评论(0) 推荐(0)
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 38 下一页