跨平台Cocos2dx 工具开发 (一) 特效编辑器

写特效编辑器有一段时间了。。。最近准备发布具体编写过程,供大家参考,同时作为自己的工作记录。 敬请期待,暂且保存

1. 项目简介

特效编辑器(下文称编辑器)是一个基于当下流行的2d游戏引擎cocos2dx(2.1.4)开发的夸windows和mac平台的特效编辑工具,为游戏开发提供便利,编辑器使用的特效库与游戏共享,导出的特效文件可以直接在游戏中通过特效库加载使用。 编辑器支持类似于visual studio的资源浏览器,可以新建一个项目工程,然后在里面添加各种特效,方便特效的分类管理,特效在编辑器中所见即所得,下面具体介绍该编辑器。

编辑器目前支持的特效

闪电效果( Lightning Effect ), 粒子系统, 高级精灵( Advanced Sprite ), 网格变形(Mesh Warp)等。

同时支持以上所有特效的组合。编辑器支持Tween变换。

        编辑器UI布局

       编辑器界面分为项目管理,渲染窗口,时间轴,属性编辑,工具栏5个子窗口,如下图

项目管理窗口: 支持新建特效和添加分组,考虑到实际游戏中会有许多特效,他们应用的地方也不尽相同,例如ui特效,技能特效,武器特效等等,这里就可以根据不同的特效应用场景添加分组

渲染窗口:实时渲染特效及编辑器辅助编辑工具,可以在工具栏中选择具体的分辨率来调整渲染窗口的大小以适应不同的设备分辨率。

时间轴:时间轴所用的资源来自于CocosBuilder,正式版会替换,目前时间轴支持单帧查看和编辑特效;支持插入多个子特效节点和子效果;时间轴显示的是一个完整特效的所有子特效和子特效节点。

属性编辑器窗口:用来编辑选中的特效或者子特效节点的属性, 该窗口会根据选择的特效的不同而动态创建。

工具栏:一些快捷更能集合,跟MFC的RibbonBar功能一样,进行特效的加载保存和新建,以及工具的相关设置。

2. 项目结构

下面的简图是我个人整个游戏开发的工作目录结构, 其中本文中的编辑器是绿色框部分。EffectEditor即特效编辑器,ProjectFramework提供了一个特效编辑器与其他编辑器共享的编辑器UI框架。

 ToolUtil,提供了编辑器项目管理和常用工具类工具集。wxExtensions是对wxWidgets的一个扩展,实现上面图中的时间轴以及属相编辑框等众多原本wxWidgets没有的控件和功能。

3. 跨平台界面开发库wxWidgets

wxWidgets是一个免费开源的App UI开发框架,详细内容请前往官方地址http://www.wxwidgets.org/了解。


到现在还没有对大家有什么帮助的地方,接下来我会介绍我的各个效果的实现过程。

To be continued...  



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、付费专栏及课程。

余额充值