Cocos2d-x&JS v3.7.1 is released

Hi, Cocos developers

We are happy to announce the release of Cocos2d-x v3.7.1.

Cocos2d-x v3.7.1 is a stable version based on v3.7. The most important update is that we added skeleton animation support for Cocos 2.3.2Beta.

  • [NEW] studio: Added new skeleton animation support and csb parser for cocos v2.3.2 beta
  • [NEW] studio: Added new skeleton animation support and JSON parser in the web engine
  • [NEW] studio: Added Skybox csb/JSON parser for cocos v2.3.2 beta
  • [NEW] studio: Parsed Touch/Click/Event callback in JSON parser
  • [NEW] Node: Added getNodeToParentTransform with selected ancestor
  • [NEW] web: Added cc.director.setClearColor and support transparent background
  • [REFINE] Widget: Synchronize enable state and bright state for Widget
  • [REFINE] studio: Optimized JSON parser’s performance by removing audio play
  • [REFINE] JSB: Add Firefox remote debugger support in JS templates

Download

Cocos2d-x v3.7.1 including : C++, Lua & JS

The main features in detail:

Skeleton Animation

In v3.7.1 and Cocos 2.3.2, we are providing a new skeleton animation system which is different from Armature. The reason is that we abstract ActionTimeline system to support all sort of animations but Armature doesn’t support it. To benefit the timeline system and to make skeleton animation system much more compact, we have implemented the new skeleton animation system. From this version, you will be able to edit skeleton animations in Cocos v2.

New skeleton animation system contains BoneNode, SkeletonNode, SkinNode. SkeletonNode is a subclass of BoneNode and extended container functionalities, so it can contain BoneNode and nested SkeletonNode to construct a skeleton.

Features provided:

  1. Playable skeleton animation
  2. Nested skeleton
  3. Skin replacement
  4. Time scale control
  5. Debug draw
  6. Frame event callback

New skeleton animation is also supported by the web engine. We will keep enhancing it in the future versions.

Get Node’s transform to its ancestor

We have added a new functionality in getNodeToParentTransform API of Node, in v3.7.1, you can pass a ancestor as a parameter to get the node’s transform related to this specific ancestor. Here is an example:

auto parent2 = Node::create();
auto parent1 = Node::create();
auto node = Node::create();
parent2->addChild(parent1);
parent1->addChild(node);
// This will give you the transform of node in parent2's coordinate system
auto transform = node->getNodeToParentTransform(parent2);

This API is also usable in the web engine.

Set background color for web engine

From v3.7.1, you can control the background of your game in the web engine easily. We have provided a new API: cc.director.setClearColor(). The color you passed can be non-transparent or with transparency. Note that if the clear color you want is not transparent, it’s more efficient than creating a background layer. Take a look at the example:

// Solution1: Using colored background layer
var background = cc.LayerColor(cc.color(255, 0, 0));
background.width = cc.winSize.width;
background.height = cc.winSize.height;
// This will give you a red background
scene.addChild(background, 0);

// Solution2: Using setClearColor
// This will give you a red background and much more efficient than solution1
cc.director.setClearColor(cc.color(255, 0, 0));

Besides, you can make your background totally tranparent too.

Widget’s enable state and bright state

In the old Widget API design, setEnabled only controls whether the widget should respond to user input events, while setBright only controls whether the widget’s display should be in gray state (which indicates disable) or bright state (which indicates enable). This is very frustrating for our developers. So from v3.7.1, we decided to synchronise bright state with enable state. That means, once your widghet is disabled via setEnabled(false), its display will also change to gray state.

// In old version, you will do
widget->setEnabled(false);
widget->setBright(false);

// In v3.7.1, you only need to do
widget->setEnabled(false);

Firefox remote debugger support

In v3.7.1, we have enabled Firefox remote debugger support for JSB projects. You only need to follow this documentation, and you can debug your JSB projects with your Firefox browser. Note that it permits you to debug JavaScript code in your JSB project, for native code debugging you should still use Xcode or Visual Studio.

1 Like

Is there any sample code that demonstrates how to create skeletal animations using BoneNode and SkeletonNode with a .csb file in c++?

Few problems with CocosStudio. Create scene and drag something to it, nothing is visible. Whole scene remains black in CocoStudio. If publish, run from XCode, items are there.

Another issue which also previous versions have; create sprite, set anchor point to for example 0,0.5. In xcode, set physics body to sprite. Physics debug draw shows that physics body has anchor point 0.5,0.5. So it is not following sprites anchor point. If in CocosStudio set anchor point to 0.5,0.5, set physics body and then move anchor point to 0,0.5, suddenly all is fine and physics body is where object is.

This same happens if change rotation.

The setEnable not changing button is been bugging me for a long time, glad finally gets changed.

1 Like

how the hell can i add new post hereĂź i mean, not answer an existing one but create a new one!!!
There is nothing like this here, or i am using the wrong browser (chrome)

Is there a conversion process from CocosStudio 1.6 armatures to 2.3.2 skeletons? Also, in the JSON from the 1.6 version there was an root attribute called “content_scale”, which was very helpful in multi-resolution support allowing us to animate at our largest version (@4x) for better pixel alignment, then change this one value to 0.25, and CONTENT_SCALE_FACTOR would handle the higher resolution images. Is there something similar with skeletons, and if so please provide some details?

Thanks.

@DJEclipse
Yep, there is a test case in tests/cpp-tests/Classes/ExtensionsTest/CocosStudioActionTimelineTest/ActionTimelineTestScene.cpp.

@juhana
Could you please create issues here?

@marjan
I don’t have the problem. Have you resolved it?

@hawkwood
I will ask someone to take a look.

1 Like

@hawkwood

  1. use Cocostudio V2.3.2 beta can convert 1.6 armatures to skeleton. (steps, File -> import -> import 1.6 version project in a opened project.)

  2. multi-resolution is not supported now in 2.3.2 skeleton, it need adapt to FrameSize and Resources. we will add this informal features as soon as possible.

thank you very much.

Re: #1 When I tried this, it imported the armature, but did not convert it, meaning I could use the armature and it’s animations as is, but I could not modify the skeleton or animations.

skeleton use ActionTimeline to animate.
open the skeleton csd file that import succesful, and you can continue modify the action timeline in the Animation Panel(Window -> Animation).

I see, I was not drilling down enough. Thanks.

That is most unfortunate about not having multi-resolution support, as that will keep me from using the new skeleton system, and CocosStudio 2.x as well (stuck on 1.6 for this reason). I’ll keep an eye out for when it is added.

running Cocos2d-JS 3.7.1 app, not sure if it is issue or expected behaviour:

cc.rotateBy(this.animSpeed, 90,0);

When do sprite rotation for web, its rotating clockwise, when running for mac it making flip instead of rotating.

Changed to

cc.rotateBy(this.animSpeed, 90);

now it’s rotating on both platforms.

Someone mistyped arguments in bindings?

Hey, I would create a new topic but I cant cause of the lvl 1 restriction…

I cant seem to compile anything for 3.7.1 on VS2015, as I am getting the error that msvcp120.dll is missing.
I tried reinstalling the redistributable package for Vs2015 but still… I think the problem lies on me using Windows 7 64 bits and trying to create a Win32 application, although I understood from most installation guides that this shouldnt be a problem?

Should I be running the solution in the folder proj.win32 or maybe the one in proj.win10, win8.1 -universal?

Cheers,
Lombar

I was running win8.1-universal

@zhangxm

Im not sure where to open this bug but it related to Cocos Studio

  1. if i download the cocos3.7.1 framework from Cocos Store and install it , the CocosStudio doesn’t detect it
    you must change the name of the directory from cocos2d-x-3.7.1 to cocos2d-x-3.7

  2. when creating c++ project via CocosStudio and try to run it im getting error

@zhangxm
Remote debug using Firefox 40.0.3 doesn’t work. on windows using JSB project ( js + native runtime )
following your old documentation : http://www.cocos2d-x.org/docs/manual/framework/native/v3/js-remote-debugger/en

today in the new Firefox there is no WebDeveloper -> debug , there is tool cold WebIDE
The WebIDE manage to connect to the cocos2d-x server as you can see in the picture (2) but doesn’t continue to the debug session and gets timeout ( 1)
as you can see in the image:

by the way the debug is working fine if i download firefox 2.5 from mozilla archives