当前位置: 动力学知识库 > 问答 > 编程问答 >

IDE for Cocos2dx on Linux

问题描述:

I'm normaly using QtCreator for c++ and I have Linux. I want to write a game in Cocos2dx. I installed Cocos2dx without problem, created HelloWorld using "cocos new", opened it with QTC and builded it. Everything is ok. BUT Cocos2dx uses cmake. When I create new class in project in Qt Creator I can't see it. So which ide is useable for cocos2dx? I tried VS 2013 but i don't like Windows.

(pls sorry for my bad English, I hope you will understand)

网友答案:

In QTCreator you need to add new sources to your project's root CMakeLists.txt and then run cmake again. After doing this you can see your new classes.

Suppose we have AppDelegate.cpp and MainMenuScene.cpp and want to add NewScene class (defined in NewScene.h and NewScene.cpp). Then in MyGame/CMakeLists.txt find "set(GAME_SRC" and add NewScene.cpp and NewScene.h files as below:

set(GAME_SRC
  Classes/AppDelegate.cpp
  Classes/MainMenuScene.cpp
  Classes/NewScene.cpp
  ${PLATFORM_SPECIFIC_SRC}
)

set(GAME_HEADERS
  Classes/AppDelegate.h
  Classes/MainMenuScene.h
  Classes/NewScene.h
  ${PLATFORM_SPECIFIC_HEADERS}
)

Then run CMake using "Build>Run CMake" menu. New files will apear in Project's hierarchy.

网友答案:

Instead of QTCreator you can use CLion. Clion is cross-platform C++ IDE from JetBrains. This IDE have default support CMake. Setup the build system is very easy. I use this for development my game on the cocos2d-x engine - it's good tool.

分享给朋友:
您可能感兴趣的文章:
随机阅读: