[置顶] cocos优化以及一些经验记录--不定时更新

摘要: 突然想把一些自己的cocos经验记录一下: cocos优化(cocos creator 2.3.1): 包体大小-Start: creator的包体优化可以分3方面: 1、图片大小。包体资源中比重最大的,简单点就是将图片大小压缩一下,大部分是适用的 tinypng/熊猫压图(网址:https://t 阅读全文

posted @ 2020-11-30 17:34 JackerCao 阅读(360) 评论(0) 推荐(0)

2021年4月27日

spine换肤

摘要: cc.loader.loadRes('clickBtn',cc.Texture2D,(err,texture)=>{ const component = this.spineNode.getComponent(sp.Skeleton); const slot = component.findSlot 阅读全文

posted @ 2021-04-27 16:58 JackerCao 阅读(191) 评论(0) 推荐(0)

2021年1月11日

cocos creator连续动作执行随笔

摘要: 分别适用Promise和Generator进行连续动作。 const pos = [[6, 1, 1], [6, 2, 1], [6, 3, 0], [6, 4, 0], [6, 5, 0], [5, 6, 0], [4, 6, 0], [3, 6, 0], [2, 6, 0], [1, 6, 0] 阅读全文

posted @ 2021-01-11 17:32 JackerCao 阅读(282) 评论(0) 推荐(0)

2020年12月31日

node读取json、docx和xlsx

摘要: const pwd = process.cwd(); const fs = require('fs'); //读取xlsx; const xlsx = require('node-xlsx'); const sheets = xlsx.parse(`${pwd}/test.xlsx`); sheet 阅读全文

posted @ 2020-12-31 10:50 JackerCao 阅读(221) 评论(0) 推荐(0)

2020年12月30日

分帧加载----Generator真是个好东西

摘要: 游戏中,如果同时需要加载大量的item,比如背包的装备或者任务列表等,一般都是同时采用同时加载所有或者部分的item(20个左右)。但是,这个步骤,可能会比较耗时,而且一下加载太多的item也会很消耗性能。所以,分帧加载真是个好东西。分帧加载主要用到Generator的特性。 Generator详解 阅读全文

posted @ 2020-12-30 20:36 JackerCao 阅读(535) 评论(0) 推荐(0)

2020年9月29日

为什么选择使用 TypeScript

摘要: https://mp.weixin.qq.com/s?__biz=MzI3MDQ1Mzc5MQ==&mid=2247485727&idx=1&sn=86e5a633a1022036b15afab5af84742c&chksm=ead1946fdda61d7952834e7ce8bf297572bf8 阅读全文

posted @ 2020-09-29 17:32 JackerCao 阅读(74) 评论(0) 推荐(0)

2018年5月25日

cocos creator box2d

摘要: title Map 使用box2d var sfloors = this.tiledMap.getObjectGroup('Special_Floor').getObjects(); //此处获取对象层 for (let i = 0, l = sfloors.length; i < l; i++) 阅读全文

posted @ 2018-05-25 09:52 JackerCao 阅读(1322) 评论(0) 推荐(0)

2017年4月21日

cocosjs-Box2d

摘要: 最近使用cocosjs-3.12在写捕鱼,总结一下使用box2d: 创建物理世界: 阅读全文

posted @ 2017-04-21 18:58 JackerCao 阅读(286) 评论(0) 推荐(0)

导航