Cocos2d framework share across all project, changes on the Cocos2d framework will take place on all project and it save disk space.
Cocos2d framework will copied to the new project, each project can have different Cocos2d framework.
Currently, project created by Cocos v2.3.1 is in framework mode with Cocos2d v3.7.
Which one is better is depend on how you use the Cocos2d framework.
Do you need different version or modification on the Cocos2d framework across project?
If not, you can use framework mode.
Does Cocos2d 3.7 work with Code IDE?
Cocos Code IDE 1.2.0 can’t work with v3.7 as the folder structure changed.
However, Cocos Code IDE 2.0.0 beta work with v3.7 but i think it just can use to debug the code but not compile.
Cocos Studio should can help on the compile and publish.
If not just use Cocos console.
I’m not sure the proper way to create a new project with v3.7.
So i create the same project 2 times, 1 with Cocos Code IDE and 1 with Cocos.
Then i copy the file needed to open by Cocos Code IDE to Cocos project.
.idea folder for folder based
.ipr for file based
Cocos is already fairly hard to get into but I have to admit that I’m completely lost right now.
I’m using IntelliJ with the Cocos plugin, which should be the same functionality as Code IDE? At least with 3.6.1 I can compile and run. I need to right click on any file in the project and chose Cocos Tools -> Add Native Codes Support.
This seems to add all which is needed to compile, which can then be done by command line as usual. However, I’m only able to compile the PrebuiltRuntime.apk, so I guess there is some configuration wrong.
And I’m not sure if this will work with 3.7 at all. So I’m hesitate to update.
Everything very confusing to me. Especially as the Clipping doesn’t work with 3.6.1, which I need, but I’m not even sure if it does in 3.7. So I don’t know what to do.
I just tried the regular Cocos 3.7 download and making a new project from console command, but it does NOT work with Code IDE/IntelliJ Plugin. Or at least I wouldn’t know how. I can’t set the new engine or framework paths in the plugin, because there is no cocos2d-x-3.7/frameworks path. Neither would I know how to compile the PrebuiltRuntimes.
This is how i create v3.7 project in Mac
You may need to configure Cocos Code IDE about the Cocos framework v3.7.
Preferences->Other Settings->Cocos Framework->Framework Mode Framework = /Applications/Cocos/frameworks/cocos2d-x-3.7 Simulator = /Applications/Cocos/cocos-simulator-bin
You can now code and debug with Cocos Code IDE or Xcode.
Hope this help.
Thanks a lot. This works for IntelliJ with Cocos Plugin as well. Seems it’s important to download the framework version with Cocos, instead of the version from the website download.
I’m gonna use Framework for sure, less disk space and I want the same up-to-date framework on all projects. I am currently using Code IDE 1.2.0 but now I know Cocos Framework 3.7 won’t work without updating to Code IDE 2.0.0 beta but I don’t want to use the beta version since I can’t compile/publish with it.
I’m not really familiar with how to use the Cocos Console. As for Cocos Studio I guess I can figure that out by playing around with it.
I’m thinking of switching from Cocos Code IDE to using IntelliJ with Cocos Plugin now and there’s also WebStorm. I really do want to be able to create a project, compile/test and also publish on mobile platforms.
Any tips on which approach/IDE I should use guys? Thanks again guys for your input.
As far as I know, the Plugin doesn’t work with Webstorm. You need the full IntelliJ Ultimate - but you can test it for 30 days, if I remember correctly. Testing works fine, at least in theory as the Android runtime from 3.7 keeps crashing on me (including freezing IntelliJ).
I haven’t tried to make an apk for publishing yet, so I don’t know if this will work - but there is a good chance it won’t. Worst case you can make a copy in a second project directory with the command line tools and compile it there. I actually even prefer them over a full IDE, as the command line procedure doesn’t change every other week, like the IDE stuff seems to.
I see. That is pretty insightful but it seems that there are a lot of crashes going on with Android.
So what’s the proper process that many other developers use then? How do they test on Android? I’m new to Cocos and I’m trying to figure out the best practice to build a simple game.
I’ll do some reading online about it too but just thought I’d ask you guys here.
@Zinitter thanks for the step by step procedure on building a cocos project/game but here’s my dilemma: Code IDE 1.2 has code-completion but doesn’t work with framework 3.7 then Code IDE 2.0 works with framework 3.7 but from what I read it does not have working code-completion.
For current moment, i still using Code IDE 1.2.0 with framework v3.6.1 for debug and testing.
If the coding is complete, then i just copy those source files to the v3.7 project and test.
I do found some crash with v3.7 but not v3.6.1 on
cc.DrawNode.drawSegment by passing NaN value into the function. Other than that, my project working fine in both version.
I’m not good in debug Android. But what version of framework you using with your project before v3.7?
It don’t have the crash problems?
To publish with Cocos Console, you can read my other post
I have lots of issues with 3.7.
IntelliJ and iOS simulator crashes after 5 seconds - even with an empty project.
Android Device with simulator works one time. Stopping and restarting crashes Android device and freezes IntelliJ. Even with an empty project.
Running a project with Clipping Nodes in Chrome occasionally even crashes my Mac completely.
Only the Mac version works fine without any issues.
So 3.7. is pretty much not usable for me.
I didn’t test with empty project, but my projects are working fine in Mac/Android/iOS.
I suggest you code with Cocos framework v3.6.1 if that version work fine.
I’m also currently using Code IDE 1.2.0 with Cocos2d-JS framework v3.6.1. I’m having some issues running it and debugging so maybe I’ll copy the src files into a framework 3.7 project like you do and see if that works. I’m trying to follow the Parkour Tutorial but run into an issue when I complete step 4.
@CitizenK is cmd procedure the same as Cocos console? Or are those 2 different things?
It’s the same. 3.6.1 works very well with IntelliJ & Plugin btw. Just the clipping nodes are bugged in 3.6.1, which is quite a pain as I need them. But they are bugged in 3.7 as well, so the update wouldn’t help me anyway.
What problem are you facing with the clipping node?
I do found that clipping node crashed on iOS but i don’t know why it crashed.
I get lots of crashes related to clipping. Running it in intelliJ with Chrome even managed to crash and reboot my Mac, with 3.7.
In 3.6.1 (and 3.7) the positioning of clippings doesn’t work. The stencil will always stay at 0,0. As I would like to use clippings to make some background animations with rotating primitives, it’s currently a no go. While the sprites can be positioned, rotated and moved, any clipping always remains at 0,0.
I don’t mean to be super picky but there are two different Cocos2d-x v3.7 frameworks in the Cocos Store. There’s “Cocos Framework 3.7” Size 257MB and then there’s “Cocos2d-x v3.7” Size 365MB.
I just wanna make sure I don’t download the wrong one and then as a result run into other issues that will take me time to work around.