cocos2d 工具使用方法介绍(包含字体,图片,粒子等工具)
1.Tiled Map:游戏关卡制作 下载地址:http://download.csdn.net/detail/chuanyu/8894901
2.TexturePacker:图片打包下载地址:http://download.csdn.net/detail/chuanyu/8894529 cocos2d-html5 使用方法 生成的资源文件: test.plist,test.png 在resource.js下面增加: var p_list = "res/test.plist"; var g_resources = [ ] 然后在使用的地方调用: //texturePacker
3. ParticleDesigner:粒子编辑器 下载地址:http://download.csdn.net/detail/chuanyu/8894529 cocos2d-html5使用方法: 利用ParticleEditor生成2个文件,firework.plist和stars.png 然后在resource.js下面增加: //particle var g_resources = [ ] 最后在使用的地方调用: //particle
4.BMPFont:美术字下载地址:http://download.csdn.net/detail/chuanyu/8894283 http://www.7edown.com/soft/down/soft_46015.html http://www.2cto.com/kf/201403/286776.html http://blog.csdn.net/keshuiyun/article/details/9960589
cocos2d-html5使用方法: 生成的资源文件: 234.fnt,234_0.png 在resource.js下面增加: var f_fnt = "res/234.fnt"; var g_resources = [ ] 然后在使用的地方调用: //测试
5.cocos studio 工具的使用:
在代码中使用: cc.log("scene is begin"); var mainscene = ccs.load(res.MainScene_json); this.addChild(mainscene.node); var btn = ccui.helper.seekWidgetByName(mainscene.node,"Button_1"); btn.addTouchEventListener(this.selectedStateEvent,this); cc.log("scene is over"); selectedStateEvent:function(sender,type){ switch(type){ case ccui.Widget.TOUCH_BEGAN: cc.log("touch begin"); break; case ccui.Widget.TOUCH_MOVED: cc.log("touch moved"); break; case ccui.Widget.TOUCH_ENDED: cc.log("touch end"); break; case ccui.Widget.TOUCH_CANCELED: cc.log("touch cancle"); break; default: break; } } 最后在浏览器中的效果:
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |