Cocos Studio编辑器使用教程 -- 常见问题汇总

本文汇总Cocos Studio新版本的用户手册、动画编辑器的使用、回调特性、帧动画编辑教程以及一些常见问题等。

0.用户手册 

http://cocosstudio.org/helpv2.html#page=0 

1.动画编辑、插事件帧 

http://www.cocoachina.com/bbs/read.php?tid=274328

 

2.回调特性 

参考:《Cocos Studio 2.0.5版本“回调特性“使用教程

 

3.帧动画编辑教程(2.0.5开始支持) 

48_387086_b6534f58bd7ed54.gif

讨论帖:http://www.cocoachina.com/bbs/read.php?tid-274227.html 

 

4.Flash 目前编辑器不支持导入flash但有个插件可以从flash导出cocos studio2.0项目。

参考:《Cocos Studio v2.0 Flash插件 -- CocoStudioPlugin
 

5.发布到IDE 、VS、XCODE选项灰色 

可能: 

1)新建项目时,没有选择生成2d-x工程。 

2)脚本项目没有勾选使用IDE。 

3)脚本项目没有勾选生成源码(发布到IDE可用,XCODE/VS不可用) 

6. Cocos Studio 2.0版本的加载方式

使用Cocos Studio v2.0发布的CSB资源更换了加载方式,需要用CSLoader来加载。CSLoader在Cocos2d-x 3.3-RC0开始提供。 

#include "ui/CocosGUI.h"//UI相关的头文件 
#include"cocostudio/CocoStudio.h"//在CocosStudio.h 头文件中已经包含了Studio所需要的各个头文件(除CocosGUI)因此我们使用Studio仅需要包含他就可以 
using namespace cocos2d;//CSLoader位于cocos2d命名空间。 
using namespace cocostudio::timeline;//动画相关的类位于cocostuio::timeline当中 
  
  
void myScene::initFunc() 
{ 
    //以下是加载相关的代码: 
    None *rootNode = CSLoader::createNode("MainScene.csb");//传入Studio2.x的资源路径 
    this->addChild(rootNode);//假设this是即将显示的scene 
  
    //加载动画: 
    ActionTimeline *action = CSLoader::createTimeline("MainScene.csb"); 
    rootNode->runAction(action);//注!!!:同一个文件创建的节点只能使用同一个文件创建的动画。 
  
  
    //播放动画: 
    action->gotoFrameAndPlay(0,60,true);//从第0帧到60帧循环播放。还有其他重载函数,具体看源码。 
  
  
    //帧事件监听 
    action->setFrameEventCallFunc(CC_CALLBACK_1(myScene::onFrameEvent, this)); 
    //关于CC_CALLBACK_1需要点C++11的基础才能知道是咋回事,这里只要照着写就行。想了解可以查下std::Bind 
} 
void myScene::onFrameEvent(Frame* frame)//固定的格式 
{ 
    EventFrame* evnt = dynamic_cast<EventFrame*>(frame); 
    if(!evnt) 
        return; 
  
    std::string str = evnt->getEvent(); 
    if (str == "xxoo") 
    { 
        CCLOG("come on baby"); 
    } 
}

PS:不会看源码的码农不是好程序猿啊。经常有人求某个API接口,这东西查查头文件看接口名就能知道个大概啦。源码就是最权威的API文档啊有木有!!! 


Cocos Studio 1.x学习资料请参考:http://www.cocoachina.com/bbs/read.php?tid-200192.html


Cocos引擎中文官网现面向广大开发者有奖征集优秀原创Cocos教程,奖品丰厚!详见:http://www.cocoachina.com/bbs/read.php?tid-274890.html

来源网址:http://www.cocoachina.com/bbs/read.php?tid-274348.html

 

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

余额充值