We are happy to announce that cocos2d-x v3.3 beta0 is released.
Not all features are listed here, because they were mentioned in release note of v3.3alpha0.
Download
Highlights of v3.3beta0
- 3d:
Camera
, 'Reskin', 'Attachment', 'Better support for FBX', 'New fbx-conv',AABB
,OBB
,Ray
andBillBoard
- audio: new audio is added on iOS and Android
- DrawNode: added as many functions as
DrawPrimitive
, andDrawPrimitive
is deprecated - Primitive: Support Points, Lines and Triagles for rendering
- Renderer: added
trianle command
- UI: added
WebView
on iOS and Android - Only two libraries in cocos2d-x, one for c++ codes, another one for lua-binding codes
- Many other small features added and many bugs fixed
Features in detail
Camera
This version of camera is powerful then previous one. And you can add it as a child anywhere. If you want to let a Node to be visited by a camera, Node's camera mask should include Camera's flag:
If you have many Nodes that want to be visited by a camera, there is a convenient way:
Full test case please refer to tests/cpp-tests/res/Camera3DTest/Camera3DTest.cpp
.
Reskin
It is a powerful feature, all the user change the appearance of character.
For example, there a model named girl.c3b, which has two coats, coat0 and coat1.
The character's coat can be changed like this,
Full test case please refer to tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp
.
Attachment
Allows to attach a node to a bone
Usage,
Full test case please refer to tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp
.
Better support for FBX
support multiple mesh
support multiple material
bones bind to each mesh limited to 40. But the FBX model can contain more meshes. So the model can contain much more bones.
New fbx-conv
It can export more complex model, which contains multiple meshes and multiple materials.
AABB, OBB and Ray
AABB means Axis Aligned Bounding Box
OBB means Oriented Bounding Box
Ray has a origin position and direction
Each Sprite3D or Mesh has its own AABB.
AABB and OBB can be picked by Ray.
Usage,
Full test case please refer to tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp
.
BillBoard
BillBoard
is a rectangle always faces to the camera. It is useful in the 3D world. People use BillBoard to create trees in some racing games. It looks real, but the cost is much lower than 3d tree.
BillBoard
inherits from Sprite, so it also supports animate. Here is example of creating BillBoard.
Primitive
Primitive
is added to support Points
,Lines
,Triangles
rendering. Previously, if we want to draw a custom geometry(sphere, line), we can only do this by using CustomCommand
. Now, what is need is to create a Primitive, set datas, and use the corresponding PrimitiveCommand
to draw the Primitive.
Here is a simple example of rendering a quad in Sprite
.
- create verexBuffer
- create vertexData
- create primitive
- add command to renderer
Primitive supports three typs of primitives (POINTS, LINES, TRIANGLES), vertex and index sharing, multiple streams. It has some constrains:
The size of vertex and index Buffer is fixed, which means data must be pre allocated.
Batching is not supported.
Triangles command
We have enhanced auto batching feature by introduce TrianglesCommand
, the rendering of the Triangles
can be auto batched. Now if we have anything which can be rendered by Triangles
, we can useTrianglesCommand
or inherit from TrianglesCommand
to take use of auto batching feature and gain rendering improvements. The QuadCommand
, which is used for Quad
rendering, is a good example of inheriting from TrianglesCommand
.
The step to use Triangle Command is very simple.
To improve performance, Triangles
will hold a weak reference to the vertices and indices data to be rendered, which is the same like QuadCommand
. The userer should not release any rendered data before theCommand
is executed by Renderer
.
WebView
WebView is an new widget type which allows you to display web content inside Cocos2D-X. We only provide iOS and Android implementation currently, more platform might be added in the future.
The class is under cocos2d::ui::experimental
namespace.
As we clarified the experimental
namespace before, the experimental
namespace doesn't mean the widget is incomplete, but only due to the lack of full platform support. Feel free to use the WebView
widget in your game.
To display the website Google in a WebView, we could simply write:
The setscalesPageToFit
method will adjust the WebView content to fit the content size you set.
We could also set some callback to the WebView:
For full test case, please refer to WebViewTest
New audio
New audio is more powerful than old one, and it is not compatible with old one. We will deprecated old one when new audio is ready on all supported platforms. Now it only supports iOS and Android. We plan to finish it on v3.4.
What's enhanced in new audio engine:
- can play more than one backgournd music
- can have a call back when an audio(music or effect) finishs
- can get duration of an audio
- can get/set playback position of a playing audio
- can change loop state when playing
The difference compared to old audio engine
- all functions are static, which means you can more easy to invoke function, such as
Audio::play2d()
- there is only one method
play2d()
to play music or effect - should use
Audio::getState()
to determine an audio is playing, paused - its class name is
cocos2d::experimental::AudioEngine
in c++, and its module name isccexp.AudioEngine
in lua-binding - there is not preload function, you can play an audio immediately
Full test case please refer to tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp
.
Only two libraries left
Now there are two libraries left: one for all c++ codes and another one for lua-bindings codes.
If you are developing with c++, you only have to link to libcocos2d
. libcocos2d
includes all c++ codes:
- cocos2d(including 2d and 3d)
- network
- cocosstudio
- ui
- cocosbuilder
- spine
- chipmunk
- box2d
- ...
Not used codes will be stripped by linker.
If you are developing with lua, you should link to libcocos2d
and libluacocos2d
. You can comment codes in lua_module_register.h
if you don't want to some module.
More information
For further information please read:
- Release Notes, with detailed information of the new API.
- Full Changelog
We would appreciate if you can test this version and report any possible bugs.
Thank you!
'Software Dev. Tools > Cocos2d-x' 카테고리의 다른 글
3.2 release (0) | 2014.12.12 |
---|---|
cocos2d-x-3.3-rc0 (0) | 2014.10.27 |
cocos2d-x v3.2-alpha0 Release Notes (0) | 2014.06.21 |
cocos2d-x 3.1.1 & 3.2 (0) | 2014.06.13 |
cocos2d-x v3.1 Release Notes (0) | 2014.06.02 |