cocos2d-x V3.14.1 version update instructions

On the occasion of the 2017 new year, the Cocos engine team sent a surprise for the new year: a new version of Cocos2d-x v3.14. This version supports all platforms to use luajit 2.10-beta2, Sprite supports Jiugongge feature, new action classes ResizeBy and ResizeTo... so many powerful new functions, I believe you will like them. 280986329434709337   Not much to say, let's take a closer look at the new surprises of the new version of Cocos2d-x v3.14.  

List of major new features

  • Support for Spine binary format
  • All platforms use luajit 2.10-beta2
  • New action classes: ResizeBy and ResizeTo
  • Android emulation support to turn off multi-touch
  • Sprite supports Jiugongge feature
  • The new function of the action class, you can query the number of actions that a node is running according to the tag
  • The Button class can set the title content
  • EditBox supports text horizontal alignment
  • Support Mac platform controller

Detailed explanation of main features

1. The performance of all platforms using luajit 2.10-beta2 has been significantly improved

The previous version of luajit cannot easily compile arm64 bytecode on a PC, and needs to be compiled with a real machine (such as an iPhone6 ​​real machine). Therefore, in the previous version, iOS 64-bit uses lua, and iOS 32-bit uses lua. luajit.

The new version supports luajit 2.10-beta2. Developers can easily compile arm64-bit bytecode on the PC platform. Therefore, we use luajit on all platforms to improve performance. If you use the Cocos command to compile and package, then the Cocos command will automatically compile the bytecode of the corresponding platform. If 64-bit bytecode is generated, then these bytecodes will be placed in the 64-bit directory. Of course, you can also compile the bytecode yourself through Cocos luacompile. For specific usage methods, please refer to the help information output by Cocos luacompile -h.

When compiling and packaging the generated bytecode through the Cocos command, the situation of each platform is as follows:

platform

Generate 32-bit bytecode

Generate 64-bit bytecode

iOS

yes

yes

Android

是,如果APP_ABI的内容不是只包含64位架构(APP_ABI := arm64-v8a)

是,如果APP_ABI包含了64位架构,比如APP_ABI := arm64-v8a ...

Mac

Windows

Linux

 

2、Sprite支持九宫格特性  UI 界面调整更方便

在开发 UI 界面时,我们通常会使用九宫格格式的图像来显示尺寸可能会根据适配屏幕分辨率的需要动态修改的 UI 元素。如今Sprite现在支持九宫格特性了,使用方式如下: c++ auto sprite = Sprite::create(...); // set center rect // the origin is top-left sprite->setCenterRectNormalized(Rect(x, y, width, heigh)); 这样即使使用很小的原始图片也能生成覆盖整个屏幕的背景图像,一方面节约游戏包体空间,另一方面能够灵活适配不同的排版需要。   sprite-slice-1  

详细信息可以参考Sprite::setCenterNormalized()的注释。

3、支持Spine二进制格式 解析更高效文件更小

使用方式没有改变,只是文件格式变成了二进制格式。这样的好处就是解析效率更高,文件更小。具体的使用方法如下:

`c++ skeletonNode = SkeletonAnimation::createWithBinaryFile("spine/spineboy.skel", "spine/spineboy.atlas", 0.6f);

...

spine-binary

4、新增两大动作类 节点缩放更方便

新增加两个动作类:ResizeBy和ResizeTo。和ScaleBy、ScaleTo不同的是,ResizeBy和ResizeTo改变的是节点的content size的大小。这种动作对于支持九宫格特性的节点的缩放效果比ScaleBy和ScaleTo好,因为ScaleBy和ScaleTo是对节点做整体缩放。效果对比如下:

resize-action-effect

5、已知问题说明

如果使用Xcode 8.2,那么lua工程会在iOS模拟器上崩溃。通过调试发现崩溃在lua_open函数的调用上。如果使用Xcode 8.1或一下版本,那么没有问题。我们怀疑这是Xcode的bug,在v3.14无法解决。使用lua的开发者在位iOS平台开发时有两个选择:

  • 使用Xcode 8.1或者一下版本
  • 使用Xcode 8.2,在Mac或者iOS真机开发、调试

该问题的进展可以跟踪下列帖子:

https://github.com/cocos2d/cocos2d-x/issues/17043

更多详细的改动列表,欢迎查看:

https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG

 

Cocos2d-x v3.14.1

修复的问题

  • 如果创建物理场景但是没有设置3d物理的摄像机,那么程序会崩溃
  • 由于glfw版本冲突,在linux平台可能会有链接错误
  • 通过带有多边形信息的sprite frame创建的Sprite效果不对
  • VS2015编译Lua工程时有链接错误
  • 通过cocos compile/run -p android --android-studio命令编译Android工程时会有编译错误

其他

通过查看3.14.1版本信息了解所有的问题或者代码改动。

原地址:http://www.cocos.com/cocos2dx

更多问题和技术交流欢迎加入QQ群讨论:83459374

Guess you like

Origin blog.csdn.net/u013007305/article/details/71424480