cocostudio编辑器的一些总结

    最近一直在尝试性的使用cocostudio,发现确实是个不错的编辑器,虽然可能此编辑器还不是很成熟,但是对于我这样的新手,还是比较够用的。

    里面的UI编辑器,动画编辑器和场景编辑器都用了下,基本流程就是在UI编辑器和动画编辑中编辑好UI和动画,然后在加入场景编辑器中,coding时只需要一行代码就能可以把场景加载进来(当然,一些UI的位置变化以及其他诸如按钮事件之类的,还是需要代码去设置),然后获取加入场景中的UI和动画,对它们进行操作。

    UI编辑器

    开始学习cocos2dx的时候,都是在代码里面自己手动添加各种UI,不直观而且要写很多重复的代码,再加上各种类的不熟悉,所以比较费劲。UI编辑器的好处就在于此,可以直观的编辑出自己想要的UI,马上能看到效果,而且替换资源也很方便,还有很关键的就是在导出的时候所有UI的纹理贴图会被导入到一张或者多张大图中,提高性能。


    动画编辑器

    先吐个槽,对于我这样的程序去摆骨骼动画的确有点困难,一个pose可以琢磨很久甚至自己摆pose做示范然后摆出来还是比较别扭比较丑,但是没办法,自己玩么,什么事都得自己做,一开始在youku上看过一个视频教程,本来以为照着做就可以了,但发现视频是6个月前的,而现在的动画编辑器的一些操作已经有一些不同(表明cocostudio的版本更新速度还是挺快的),但不要在意这些细节,程序员思维转的快,用起来还是没有什么大碍。

    动画编辑器里面主要分为骨骼动画和序列帧动画,序列帧动画先不说了而且暂时没去用。骨骼动画的优势很明显诸如动作流畅资源占用小美术成本低pose随便摆等,但缺点其实也是很明显的(这里我针对的是2d,非3d),就像我这样的想去做个2d格斗游戏,很多动作如果硬是用骨骼动画来表现会显得很别扭,比如出拳带转身的出招这样的动作,目前为止我还不知道如何去解决,现有想法是在出招过程中对骨骼使用不同的贴图(在编辑器里面给一个骨骼添加多个资源文件,然后使用函数armature->getBone("bonename")->changeDisplayByIndex(displayIndex, true);),但这貌似又回到了需要多画图这个问题上,而且貌似动画的编辑也会增加一点点复杂度。

    还有一个困扰我的就是动画编辑器编辑出来的动画(armature)的contentsize和anchor到底是怎么定义的,这个关系到在代码中该如何去对其setPosition。以下是我自己总结出来的,不一定正确。contentsize是你在动画编辑器中在形体状态下最初的骨骼形体(包含贴图)下给你计算出来的boundingbox的大小,而anchor则是骨骼中最上父节点的中心点,而目前我在代码中强制的把新的armature的anchorpoint设置成(0.5, 0.5),基于此去对armature对象进行setPosition操作。

20140325

今天发现原来cocostudio的动画编辑器有个功能叫IK(Inverse kinematics),有了这个东西就不用调一个走路姿势都调N久了,哎 ... 一个人研究东西果然弯路走的很多。

    场景编辑器

    作为2d游戏的编辑器,无论是使用还是理解起来,都会比较简单,场景编辑器在代码里面就是一个node,这个node有很多子node,子node可以添加包含根据UI编辑器动和画编辑器里面导出文件创建的对象的组件,最后使用addchild加入到代码中的scene中,在代码中可以对这些子node以及其子component进行各种操作获得自己想要的结果。


好了暂时先写这些,当然,以上仅供参考阅读,不一定都对 ...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
About CocoStudio is a game development tool kit based on Cocos2d-x. It breaks down tasks in game development into different roles, it includes: UI editor for UI graphic artists, Animation editor for graphic artists, Number cruncher for game data designers, Scene editor for game designers CocoStudio forms a complete game development solution. The UI editor The UI was designed to serve its only purpose: create UI for games. Its simple and intuitive interface allows graphic artists to focus on their expertise, without worrying about other aspects such as programming. Currently the UI editor has 12 different UI elements ready to be used in games, new UI elements will be added with each and every release of CocoStudio, Other key features that the UI editor supports are: Texture packaging - Automatically packs individual texture files into a single large sprite, which further saves memory and improves game performance. Multi-resolution adaption - Automatically adapts to multiple resolution sizes with relative UI positioning. Templating - Reuse the same UI layout across different games, swap out texture resources to give it a new look. The Animation editor The Animation editor was designed to feel like Adobe Flash, which makes graphic artists feel right at home. The Animation editor brings skeletal animation to Cocos2d-x. What advantage does skeletal animation holds against the traditional frame animation? Lower memory consumption - An animation with the traditional frame based solution could use dozens of individual textures, but with skeletal animation, only 1 set of body parts is required to make infinite number of different animations. Smaller file size - due to less number of assets. Animation blending - you can combine animations together to easily make new animation, for example, you could blend attacking animation with walk animation to create "attacking while walking animation". Animation reuse - you can share skeletal animations with another character with the same skeleton setup. Smooth interpolation - traditional frame based animation is very choppy especially in slow motion. Skeletal animation interpolates between 2 sets of key frames, so animation is always played at the same frame rate as the game. However Skeletal animation cannot replace the traditional frame based animation, for example, it cannot make isometric character, it cannot make explosion, that is why we did not forget frame based animation, we even made it better and simpler. You only have to drag and drop frame sequences to the work space, and the animation editor will automatically creates the frame animation for you. Other highlight of Animation editor includes: WYSIWYG collision box editing - editing collision box in wysiwyg way has never being easier and accurate. Reference point - enables characters to wield swords, mount horses, and attaching other objects easily. Texture packing - Automatically packs individual texture files into a single large sprite, which further saves memory and improves game performance. The Data Cruncher The data Cruncher imports excel tables and converts the data into a format readable by cocos2d-x, which can also be used as a component for the Scene editor. The Scene editor The scene editor pieces all the assets made by the UI editor, Animation editor, and the Data Cruncher into a game scene, it can then simulate the game inside the editor. The scene editor also supports many assets made from third party editors such as particle designer, tiled etc. The scene editor relies on the CocosStudio Framework. CocoStudio Framework CocoStudio Framework is an open source higher level framework on top of Cocos2d-x, it employes entity and component system, it is used to read the data saved from the scene editor. The Scene editor saves data in a MVC like fashion, it includes all entities and events used in the current scene, and exports to corresponding code template for the programmers. A programmer can then write the code in Javascript to bring the game alive. CocoStudio的安装 1.CocoStudio的运行平台是Windows操作系统,推荐使用Windows7操作系统。 2.安装CocoStudio之前,确保电脑中安装了.Net 4.0 Framework 3.安装目录尽量不要在C盘的Program Files文件夹下,可能会导致启动器无法启动编辑器。当然,通过“以管理员身份运行”的方式也可以打开软件 4.在Xp和Windows8的操作系统下,可能会出现的闪屏或无法运行的问题。这个问题会尽快修复
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值