Cocos2d-x V4.0 released

There is warning in Xcode 11.4
GLKit and OpenGLES is deprecated. Consider migrating to MetalkKit instead

If Cocos Creator do not support Metal, there is no point to migrate.

But then it will be a big issue because who using cocos2d-js have no any option to adopt metal as v4 removed h5 and jsb.

looking forward the migration method and thanks for the help!

We are in a hard spot because Cocos2d-js hasn’t been updated since around the 3.13 days, IIRC. I know it says 3.17 in the API Ref but it hasn’t been updated functionally in quite a while.

There is no upgrade path for Cocos2d-js users to v4.

so best hope is convert to Cocos Creator project with some api adaptation?

Indeed that is the best way. Although the API isn’t identical.

at least Cocos Creator is in javascript and hope to adopt metal.
option to adapt is much better than door closed permanently.

really looking forward to the guide on transition from cocos2d-js to cocos creator.

i remember there are some issue on
ScriptingCore::getInstance()->evalString(string);
for javascript <-> native iOS function calling

had a look on the new Cocos Creator, it looks similar to the old time Cocos.

I have started a Cocos2d-x V4.0 tutorial series, links can be found here Cocos2d-x v4 Tutorial Series - Sonar Systems

1 Like

While using V4.0 on Xcode 11.4, I run the project on a real device works fine, static libs are being generated and placed in ios-build/lib/debug, if I switch over to a simulator device I get some linking errors because it’s the wrong arch. Looks like the libs did not get updated. Anyone else getting this issue? If I delete whats in ios-build/lib/debug then run simulator it works. I tried with hello world app and it’s happening.

ld: warning: ignoring file /Users/ericbouchard/Documents/cocos2d-x/ios-build/lib/Debug/libcocos2d.a, building for iOS Simulator-x86_64 but attempting to link with file built for iOS-arm64

Then a bunch of linking errors.

1 Like

@ericb365 ave you tried switching “build only active architectures” in build settings to “no” for all targets?

1 Like

I tried that but it did not fix the issue. I tried another v4 project I have and I don’t have the same issue. I integrated some sdkbox plugins in this new project, maybe some problems with my CmakeList.txt file

1 Like

Does anyone know how to add a “Run Script Phase” configuration to xcode using cmake?
Basically I want to run a script before building from xcode, but since we are using cmake I must do this from cmake as to not lose it each time the project is generated.

Congrats and Thank You Team

@slackmoehrle @zhangxm
I am facing problem with ParticleSystemQuad particle creation in cocos2dx v4. I am creating particle as
auto particle = ParticleSystemQuad :: create ( “CompToolPar.plist” );
particle-> setPosition (pos);
parent-> addChild (particle, 100 );

error log is like

cocos2d: unsupported image format!
Assert failed: CCParticleSystem: error init image with data
Assertion failed : (isOK), function initWithDictionary,

This Code is working fine & good in v3.17 , but crashing in v4. Can someone look into this & help me out.

I wil take a look tomorrow

Please check image format. In v4 tiff is not supported

i am creating particles with ParticleDesigner https://www.71squared.com/particledesigner .
i am using .png as a texture image of particle. i am not using .tiff. i have checked the plist also, it includes .png format.

did you find anything?

No yet, I can’t export the file since the ParticleDesigner need a license.

sampleParticle.zip (25.6 KB)

You can try this for sample. i am using this particle. image which is use in this particle is .png format. no clue where i am getting it wrong.

It will works well if you did use the png specify in textureFileName. If png is missing then raw data in textureImageData will be used, which is a tiff format, thus cause v4 assert failed due to the unsupported tiff format.
So you can remove the key textureImageData and corresponding value in the plist and make sure the png in textureFileName dose exist.

1 Like

this might be the solution may b my png was not existing will try this. thanks for help. :+1: