CocoStudio工具集开发入门之UI编辑器教程(1)

建议参考原文:点击打开链接

1.1    UI编辑器简介:

UI编辑器:是一款用于编辑游戏中的UI界面的工具。支持丰富的UI控件,包括按钮,列表,复选框,进度条,列表,滑动框等等,达到省时、省力、高效的目的。

1.2      安装环境

操作系统:Windows7/WindowsXP

程序扩展包:

l  NetFramework 4.0

l  VC2010(vcredist_x64/ vcredist_x86)

   安装SPII游戏开发工具集

l  CocoStudio.exe

1.3     界面介绍

结构树:展示渲染区域节点的层次结构并且支持拖拽移动节点。结构树的根节点是一个Layer。

渲染区:UI布局的主编辑区,在该区域可以对精灵进行移动,缩放,旋转的操作。

控件库:可用于在渲染区域编辑的各种控件包括Node,Sprite,LabelTFF,Layer,Menu,MenuItemImage等,还可以扩充。

属性窗口:当选中一个节点,属性窗口会显示出该节点的所有属性。修改任意属性可以立即改变该节点在渲染区域的状态。

日志窗口:日志窗口用来记录所有操作的明细和历史。

2.1 新建工程

点击菜单栏的文件菜单,下拉列表中的新建按钮,会弹出一个新建工程的信息面板,大家可以给工程命名,并选择工程的保存路径,最好在命名和路径中不要有中文字符。

2.2 导入资源

1.点击菜单栏的文件菜单,下拉列表中的导入资源菜单,可以导入单个文件,也可以导入整个文件夹;

2.也可以点击资源窗口的图标按钮,分辨导入单个文件,和整个文件夹;

2.3资源编辑

右键点击资源窗口的资源,可以进行删除,重命名的操作;

可以再资源窗口下方的预览窗口,查看选中的资源预览效果图;

3.1 创建控件

1.右键点击渲染区画布,在右键菜单中选择添加控件,选中容器控件的情况下,会直接添加控件到容器控件下;

2.也可以直接在控件列表区,选中需要的控件,直接拖动到渲染区;

3.还可以从结构树上,选择一个容器控件,右键菜单,给容器控件添加子控件;

3.2编辑控件

单个控件编辑方式:

(1)鼠标点击控件,选中控件,移动鼠标进行控件的拖动;

(2)在结构树上选择相应的控件,该控件会全局被选中;

多个控件编辑方式:

(1)渲染区:Ctrl + 鼠标左键可以进行控件的多选;

(2)结构树:Ctrl + 鼠标左键可以进行控件的多选;

(3)渲染区:点击鼠标左键并进行拖动,可以进行控件的框选;

删除控件:渲染区右键菜单,结构树右键菜单,delete建;

复制控件:渲染区右键菜单,结构树右键菜单,Ctrl+C;

粘贴控件:渲染区右键菜单,结构树右键菜单,Ctrl+V;

显示编辑:

1.控件被选中的时候,会显示白色的编辑框,编辑框的四个角点可以进行缩放编辑,编辑框的右边中心点可以进行旋转编辑;

2.控件被选中的时候,可以通过编辑器上方的工具栏,进行透明度的编辑,颜色混合的编辑,顺时针的旋转(Ctrl+R),逆时针的旋转(Ctrl +T);

3.多选控件的时候,可以进行中心点对齐,左边线对齐(Ctrl + shit +L),右边线对齐(Ctrl + shit +R),上边线对齐(Ctrl + shit +T),下边线对齐(Ctrl + shit +B);

3.3画布操作

1.缩放画布:Ctrl+鼠标滚轮,可以放大缩小画布;

2.移动画布:space(空格键) + 鼠标左键,可以拖动画布;

3.4属性编辑

常规属性:

交互:使用在输出数据中启动控件的鼠标事件响应;

显示/隐藏:显示或隐藏选中的控件;

垂直翻转:

水平翻转:

名字:输出到数据文件的字符串,用于代码查找控件的标识(不可重复定义);

标志:输出到数据文件的整数,用于代码查找控件的标识(不可重复定义);

旋转:调整控件的旋转角度;

缩放:调整控件的横向缩放和纵向缩放;

位置:调整控件的坐标;

渲染层级:调整控件的渲染顺序,上下的遮挡关系;

特殊属性:

图片:

文件:图片控件用到的美术资源图,可以从资源渲染区拖动图片资源到此属性上,进行资源替换;

复选框:

选中/取消:设置复选框的初始状态;

常态底图:复选框的正常状态下的底图图片资源;

按下底图:复选框的按下状态下的底图图片资源;

禁用状态:复选框的禁用状态下的底图图片资源;

标示图默认状态:复选框的按下状态下的底图图片资源(选择使用);

标示图选中状态:复选框的选中状态下的高亮图片资源(选择使用);

进度条:

进度:进度条的初始进度(0-100);

类型:进度条的加载方向(左->右,右->左);

图片资源:进度条的图片资源文件;

文本区:

宽度:文本区的宽(影响文本区的点击测试区域);

高度:文本区的高(影响文本区的点击测试区域);

字号:文本区的文字字体的大小;

字体:文本区的文字的字体;

对平对齐:文本区的文字的水平对齐方式(左对齐,中心对齐,右对齐);

垂直对齐:文本区的文字的垂直对齐方式(顶对齐,中心对齐,底对齐);

文本:文本区的初始显示的文字文本;

滚动层:

宽度:滚动层的宽(影响滚动层的点击测试区域);

高度:滚动层的高(影响滚动层的点击测试区域);

文件:滚动层的初始背景图片资源;

滚动层的子控件,需要选中滚动层,右键进行添加;

层容器:

宽度:层容器的宽(影响层容器的点击测试区域);

高度:层容器的高(影响层容器的点击测试区域);

文件:层容器的初始背景图片资源;

层容器的子控件,需要选中层容器,右键进行添加;

按钮:

正常状态:按钮的正常状态下的图片资源;

按下状态:按钮的按下状态下的图片资源;

禁用状态:按钮的禁用状态下的图片资源;

文本按钮:

正常状态:按钮的正常状态下的图片资源;

按下状态:按钮的按下状态下的图片资源;

禁用状态:按钮的禁用状态下的图片资源;

字体:文本按钮显示文字的字体;

字号:文本按钮显示文字的字体大小;

文本:文本按钮显示的文字字符串;

数字标签:

标签图片:数字标签使用的图片资源;

标签首字符:数字标签使用的图片资源中的第一个字符;

标签首字宽:数字标签使用的图片资源中的第一个字符的宽(像素);

标签首字高:数字标签使用的图片资源中的第一个字符的高(像素);

文本:数字标签显示的文本字符串(图片资源中存在的字符集合);

滑动条:

滑动进度:滑动条的初始进度,滑动节点的显示位置;

底图资源:滑动条的背景图片资源;

节点正常状态:滑动节点的正常状态显示的图片资源;

节点按下状态:滑动节点的按下状态显示的图片资源;

节点禁用状态:滑动节点的禁用状态显示的图片资源;

输入框:

宽度:输入框的宽(影响输入框的点击测试区域);

高度:输入框的高(影响输入框的点击测试区域);

字号:输入框的文字字体的大小;

字体:输入框的文字的字体;

文本:输入框的初始显示的文字文本;

文本框:文本框

交互动画:是否启动文本框的点击动画;

字号:文本框的文字字体的大小;

字体:文本框的文字的字体;

文本:文本框的初始显示的文字文本;

3.5导出资源

导出资源面板:

图片最大宽度:合成图片的最大宽度;

图片最大高度:合成图片的最大高度;

碎图缝隙:合成大图中的小图之间的缝隙像素;、

导出路径:用户自定义导出路径;

导出文件包括.png和.plist文件;

当工程中使用的图片合并后的尺寸大于设定的图片尺寸,程序将自动分割合并后的图片成多组合并图片,并添加序列下标。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
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的操作系统下,可能会出现的闪屏或无法运行的问题。这个问题会尽快修复

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值