百度建网站,网站开发需求表,做流量网站要做哪一种,wordpress更换服务器ip1.安装texturepacker#xff0c;去官网下载https://www.codeandweb.com/texturepacker
2.将图片拖动进来#xff0c;即可自动生成精灵表#xff0c;这里输出选用cocos2d-x#xff0c;打包用免费版的“基本”就行#xff0c;高级模式是收费的#xff0c;然后点击“发布精…1.安装texturepacker去官网下载https://www.codeandweb.com/texturepacker
2.将图片拖动进来即可自动生成精灵表这里输出选用cocos2d-x打包用免费版的“基本”就行高级模式是收费的然后点击“发布精灵表” 3.会导出两个文件一个plist配置文件一个png图集文件 4.将plist和png一起放到resources目录下注意两者要放在一起然后用resources.load加载即可 // 加载图集resources.load(Atlas/1, SpriteAtlas, (err, atlas) {if (err) {console.error(SpriteAtlas load failed, err: err.message);return;}let spriteFrames atlas.spriteFramesconsole.log(111, spriteFrames )})
5.控制台里打印的就是图集里各个精灵图的spriteFrame然后根据自己需求使用即可