Cocos Creator的C++和Lua支持:0.4版发布

插件的 readme,和文档,都有写

LOCAL_STATIC_LIBRARIES 要加上插件的,具体参见:

http://cocos2d-x.org/docs/cocos2d-x/zh/editors_and_tools/creator_to_cocos2dx.html

creator_to_cocos2dx/README.md

确实,最终这样子就可以了,感谢

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2dlua_shared

LOCAL_MODULE_FILENAME := libcocos2dlua

LOCAL_SRC_FILES :=
…/…/…/Classes/AppDelegate.cpp
hellolua/main.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/…/Classes
#_COCOS_HEADER_ANDROID_BEGIN

COCOSHEADER_ANDROID_END

LOCAL_STATIC_LIBRARIES := cocos2d_lua_static
LOCAL_STATIC_LIBRARIES += creator_reader_lua
LOCAL_STATIC_LIBRARIES += creator_reader

COCOSLIB_ANDROID_BEGIN

COCOSLIB_ANDROID_END

include $(BUILD_SHARED_LIBRARY)

(call import-add-path, (LOCAL_PATH)/…/…/…/…/cocos2d-x)
(call import-module, cocos/scripting/lua-bindings/proj.android) (call import-module, …/runtime-src/Classes/reader)

COCOSLIB_IMPORT_ANDROID_BEGIN

COCOSLIB_IMPORT_ANDROID_END

1赞

添加了LOCAL_STATIC_LIBRARIES += creator_reader_lua # for lua project
这段后,提示‘Cause: executing external native build for ndkBuild ’
请问是什么原因?我确定我的ndk设置没有错误,build其他程序是没问题的

creator to cocos2d-x目前还在维护迭代版本么?下一个版本计划会什么时候发布?

编译错误, 求助大神!
苹果电脑mac
xcode10.1
cocos2dx 3.17.1
creator 2.0.9
c++插件 0.4
xcode 提示link错误:
/clang:-1: linker command failed with exit code 1 (use -v to see invocation)
export IPHONEOS_DEPLOYMENT_TARGET=6.0
Undefined symbols for architecture x86_64:

昨天搞到半夜三点多, 求大神帮助! 是不是我的环境太新啊?

搞通了, 这里记录一下给各位:
环境:
mac
xcode10.1
cocos2dx3.17.1
creator1.9.3(上面好像说不支持2.0以上)

xcode10.1会提示 reader/dragonbones/下面的android.mk和CMakeLists.txt重复, 将其改名通过(我未测试安卓和使用这个目录的功能)

xcode头文件搜索增加:$(SRCROOT)/…/Classes/reader

framework增加:MediaPlayer.framework (否则link错误)

cpp增加场景写法(hellowword.cpp):
#include “reader/CreatorReader.h”

Scene* HelloWorld::createScene()
{
creator::CreatorReader* reader = creator::CreatorReader::createWithFilename(“creator/Scene/helloworld.ccreator”);

// will create the needed spritesheets + design resolution
reader->setup();

// get the scene graph
Scene* scene = reader->getSceneGraph();

return scene;
//return HelloWorld::create();

}

大概就这样了 跑起来了, 还没试验控制组件, 稍后继续报道

仓库里同时支持 Cocos Creator 1.93 和 2.09,只支持win32的
https://github.com/Kuovane/creator_to_cocos2dx
支持大多数控件
修改,更新,使用情况详情,请看
https://github.com/Kuovane/creator_to_cocos2dx/blob/master/Update.md

欢迎各位同学使用此仓库的插件,此插件已用于项目中。

是自己维护增加功能了么 大佬

导出的功能跟 creator 上看到的效果一致,并没有增加功能,只是以前的插件有些功能没支持到位。

我试验了一下好像还是不支持2.0.9,我是苹果mac电脑,存盘输出工程提示错误. 请正式发布一个0.5版吧,拜托了.

这个插件停更了吗?

请问prefab预制体怎么读取啊?

1赞

这是个人项目还是官方?

个人的

类似这样 tx_bigwin.prefab.ccreator

早就停更了吧,可以使用fairygui进行布局

确定CMAKE构建是编译通过的吗?
dragonbones目录下的文件纷纷引用了cocos2dx引擎里的东西,造成了
…/…/…/…/…/…/Classes/reader\dragonbones/parsers/JSONDataParser.h:5:10: fatal error: ‘json/document.h’ file not found
在dragonbones内的CMakeLists.txt
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/…
${COCOS2DX_ROOT_PATH}/external
)
加入了这行才不报这个错了,结果开始报
…/…/…/…/…/…/Classes/reader/dragonbones/cocos2dx/CCFactory.h:5:10: fatal error: ‘cocos2d.h’ file not found
这次加了${COCOS2DX_ROOT_PATH}/cocos也不好使
cmake构建真是蛋疼呀 官方还强烈推荐cmake 没人遇到问题吗?

目前没有遇到这样的问题,你可以看一下我的dragonbones的配置 https://github.com/zhongfq/cocos-lua/blob/v4/frameworks/libdragonbones/CMakeLists.txt

Hi,
I want to create a C++ game using cocos2dx, but I need user-friendly editor.
Could you please tell me if you know:

  1. Will this plugin be updated?
  2. Is there a way to run the created in CocosCreator javascript code from the C++ project?
  3. Is there any other way (except this plugin) to use CocosCreator as an editor for a C++ project?
  4. Are there any other good editors that can be used to create cocos2dx game using C++?
    Thanks in advance!

You can use cocos studio in Windows, or other third party UI system, such as fairygui https://en.fairygui.com/ (I never try, just for your information.)

1赞