初接触cocos2dx3.X,持续记录遇到的一些坑

1.cocos2dx家的ui编辑器cocostudio不维护了,由于mac不支持32位应用程序,所以完全不能用,只能装一个虚拟机运行,并且需要搞明白cocos2dx版本和cocostudio版本对应关系,cocos2dx 3.X对应的是cocostudio 1.4版本,我下载了2.1版本折腾了半天不行,看了看源码才发现生成的json信息完全不支持……

2.cocos2dx 3.X 进度条LoadingBar无法点击,是因为在UI设计中没有打开交互:
编辑器里面把交互属性勾上,或者

pro = (LoadingBar*)Helper::seekWidgetByName(UI, "ProgressBar_6");  这里能获取到ui中的进度条。
pro->setTouchEnabled(true); //这句的作用等同于编辑器里面的交互选项
pro->addTouchEventListener(this, toucheventselector(MyLayer::onClick2)); 添加点击事件

原文:http://www.cocoachina.com/bbs/read.php?tid-276353-keyword-LoadingBar.html
 
3.阅读源码时发现这样的类声明:class+宏+类名,例如:class CC_DLL CCObject : public CCCopying,不懂,就去搜,于是有了如下文章的解答:
所以这个写法是为了声明动态链接库的加载,在windows和linux环境上有不同的实现,而我因为是macos环境(还有iOS/ Android/Blackberry环境),找到的实现是空
 
  • 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的操作系统下,可能会出现的闪屏或无法运行的问题。这个问题会尽快修复
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页

打赏

欧阳小辰

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者