Cocos2d-x v3.10 released

Will it be possible in future versions to import Spine SkeletonNode into Cocos Studio?

I really need that as well. (spine to cocos studio feature)

Is the LabelTTF/ccui.Text newline bug still in 3.10? I mean the bug where when you let pass a long string to the LabelTTF/Text, it will sometimes create newlines such that there is an empty space in the beginning of a line.

Fantastic job on the new Cocos installer! I just moved over my 3.9 source code version to the 3.10 prebuilt and it worked perfectly without a single hitch.

Bug:

  • When I create a new class that inherits UI::Layout class, if I enable Touch on it, the app will crash when I click on the Layout itself.

class NewLayout : public ui::Layout
{
ā€¦
}

//bool init in .cpp file
setBackGroundColorType(Layout::BackGroundColorType::SOLID);
setBackGroundColor(Color3B::BLUE);
setContentSize(Size(50,50));
setTouchEnabled(true);

Do you call the base class in methods like init()?

No. i use NewLayout::create()

Yes but in the overridden init() method do you call the base-class init() method first?

@cdang normally you do not enable touch on an entire layer. But maybe you have a reason I donā€™t understand.

Here is an explanation that might shed some light from one of the develoepers:

I hope that helps.

No, I did not call init() inside the override init(). I added Layout::init() and it works now. Thx.

I need a containment layer because I need to be able to add more customized functions and settings; not just for handling touch or base class features.

Okay, but canā€™t you still add them using the new methods instead of setTouchEnabled?

Also, does it need to be a layer? What about using a Node to catch the events and add your items into the node or above it in the same layer?

I see cocos2d-x v3.10 run Android Studio very good.

I hope admin can build document create type pdf.

Hi there,

So I freshly downloaded the new ā€œCocosā€ product. Iā€™ve successfully got it to compile for XCode using source code only. For the life of me the Precompiled libraries would not work. Iā€™ve got the latest and greatest versions of XCode and OSX. This is starting from scratch (i.e. hitting new project, open in XCode, build and run).

Unfortunately I cannot get Android to work no matter what I try. Again I start from scratch and select ā€œNew Projectā€, C++, no extras, source code. When I open in Android studio it all builds, but when I run on my android device it says:

Unfortunately, libcocos2dx has stopped.

java.lang.UnsatisfiedLinkError: Couldn't load cocos2dcpp from loader dalvik.system.PathClassLoader[dexPath=/data/app/org.cocos2dx.testapp-2.apk,libraryPath=/data/app-lib/org.cocos2dx.testapp-2]: findLibrary returned null

And if I run it on the default emulator: Nexus 5 API 23 x86

Unfortunately, libcocos2dx has stopped.

2-27 14:47:45.103 2445-2445/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process: org.cocos2dx.testapp-2, PID: 2445
                                                 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.cocos2dx.testapp-2-1/base.apk"],nativeLibraryDirectories=[/data/app/org.cocos2dx.testapp-2-1/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libcocos2dcpp.so"
                                                     at java.lang.Runtime.loadLibrary(Runtime.java:367)
                                                     at java.lang.System.loadLibrary(System.java:1076)
                                                     at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:249)
                                                     at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:264)
                                                     at android.app.Activity.performCreate(Activity.java:6237)
                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:148)
                                                     at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Any help would be appreciated. I havenā€™t even begun trying to integrate my actual project ā€“ this is all running with what I assume is a hello world project.

P.S. the name ā€œCocosā€ makes it hard to search for other peopleā€™s issues on google relating to this GUI Project builder since other cocos projects come up first. For the sake of google searches maybe a unique name would help? For instance: Cocoscape or Cocosphere. Just a suggestion.

@jaunt you can currently only run fromAndroid Studio, but not compile. Itā€™s crashing because youā€™re missing your gameā€™s library.

To get it working you have to call the following command in your terminal:

cocos compile -p android --android-studio 

When itā€™s done compiling, you can run your project from Android Studio

Hi, I am having trouble with my Cocos2d-x v3.10. I am unsure of how to setup it and would really appreciate some help. Thanks

I have a problem loading a scene created with Cocos Studio.

If I use the callback feature http://cocos2d-x.org/documentation/editors_and_tools/chapter3/HowToCode/CallBack/en/index.html

auto rootNode = CSLoader::createNodeWithVisibleSize("MainScene.csb");

This always return NULL. But if I left the Advanced > Custom Class field blank, the scene loads normally.

Do you have a reported bug like this? Also a solution?

[SOLVED] Appearently in CSLoader.cpp 1052 the custom class appends the word Reader to find the reader. So if you put that name with the Reader word included (e.g. MyClassReader) it wont work.

        readername.append("Reader");

Can I suggest to update the documentation to make this point clearer. Thanks.

Hey,

did this release break something on the multi-resolution support?
when I try to get the screen resolution using glview->getFrameSize() on a iphone 6 device, it gives me iphone 5 resolution. This problem does not occur on cocos2d-3.9

Thanks,
NG

can you help me with this issue?cocos studio crashed

@newguy make sure you have the right sizes for launch images