Migrating cocos2dx using migration tool #1882
Replies: 5 comments 12 replies
-
You haven't mentioned which version of Cocos2d-x your existing project is using.
I'm not sure about the migration tool, as I've never used it myself, but migrating over manually is not overly time consuming, although it does depend on which version of Cocos2d-x your project is using. Axmol is based on Cocos2d-x v4, so if your project was based on that version of Cocos2d-x, then the migration is straightforward. If your project is based on an older version of Cocos2d-x, such as v3, then the migration may be a little more involved, as it may be if moving from Cocos2d-x v3 to v4. In some cases, it may even make sense to get a project working with Cocos2d-x v4 before migrating over to Axmol, especially if the existing project is not already using cmake.
Opening up For the namespace, replacing
Check the wiki to see if the info in there can help. If there is any information you think should be added to the wiki in order to ease migration from Cocos2d-x, then put up a post about it here, and someone may be able to address that issue.
Spine, along with other extensions, are enabled via cmake, which you can read about on the wiki here. It's already part of the engine source, so you don't need to follow the Esoteric guide on integrating it. Just enable it as per the wiki instructions. Axmol has its own version of the Spine runtime too, which you can find at https://github.com/axmolengine/spine-axmol. The runtimes for Spine v3.6, 3.7, 3.8, 4.0 and 4.1 all work with Axmol, and are located in their respective branch in that repo. |
Beta Was this translation helpful? Give feedback.
-
Thanks, this is great. I just have a simple cocos2dx project that uses spine, no shaders. Question on manually migrating - do I need to make a new hello world axmol project and then move my source files into it and change the namespace, or do I literally just change the namespace on my old existing project? How would it repoint to say the axmol spine instead of cocos2dx spine if I leave it in the old folder? Its not updating the cmake file or anything which is manually pointing at cocos2dx spine? I plan to do some experimenting today, make a fresh cocos2dx hello world and try both ways, and then make one with one spine thing and try both ways just to see if I can understand better what it is doing. I finally absorbed what you said above (just change namespace and thats it) so maybe it will be simpler than I am thinking. Having a duplicate cocos2dx.h that points to all the xmol functions instead is awesome, I had been commenting that out and puttting axmol.h in everywhere instead (whoops). I'll post here what I find. |
Beta Was this translation helpful? Give feedback.
-
Thanks! I'll look look at cocos2d.h more closely |
Beta Was this translation helpful? Give feedback.
-
What namespace do i use for Spine, or how do I include it (everything i can find says its already enabled in axmol). I do see a spine.h way down in extensions/runtime/includes? |
Beta Was this translation helpful? Give feedback.
-
Update - I think this is because I added new .h and .cpp files to the source folder but never told andriod studio. How do I include them in the build files for the project? It's still looking for MainScene.cpp which I am not using anymore so I know it hasn't been updated. Do I have to add my new source files to the cmake or build scripts somehow? When I search files in android SDK I see the original two source files from the project in the compile commands but not my new source files. They do show up in the 'sources' tab on the left though. This is a result of making an axmol hello world and then swapping the source files behind the SDK's back from what I can tell. I can see the wrong files and not my new source files below: |
Beta Was this translation helpful? Give feedback.
-
Question on axmol-migrate, when I run "./build_x64/bin/Release/axmol-migrate source --fuzzy --source-dir path/to/your/project/sources/folder" and point it to my source folder (called classes) or the project folder or any folder containing my .h and .cpp files, it prints out "axmol-migrate version 1.1.1" but changes no files. Am I missing something obvious?
Some headers like #include "ui/CocosGUI.h" isn't obvious what to replace it with. I also had a ton of cocos2d:: stuff that is littered all over, do I change all those to ax:: . Is there a list somewhere of common things that need to change, the migrating guide just says to change the namespace and that's it, but clearly there is more :)
More questions - in the default axmol hello world, what do I have to change to add spine, it seems to be different than in cocos2d. Do I still need to follow the spine cocos2dx integration direction of modifying the cmakelists.txt prior to building the project and IDE files.
Thanks! Sorry for newbie conversion questions
Beta Was this translation helpful? Give feedback.
All reactions