在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):cocos2d/creator_to_cocos2dx开源软件地址(OpenSource Url):https://github.com/cocos2d/creator_to_cocos2dx开源编程语言(OpenSource Language):C++ 90.8%开源软件介绍(OpenSource Introduction):Table of Contents generated with DocToc Creator support for Cocos2d-xRequirements
LimitationsGiven that Creator uses a component based model to create its objects, and cocos2d-x has its monolithic structure, it is only possible to support a limited subset of Creator features. Supported nodes:
Supporting JavaScript scripts would be overkill. If you need JavaScript scripting support, just use Creator. Sample projectCan fetch this branch and run Currently support on Mac, iOS, Android and Windows. How to generate the needed files
Options
You will find:
Header search pathFor cpp projects, just add For lua projects, add the following header paths:
If developing for Android, can just use existing
If developing with Lua, then need to add Using it from C++// mygame.cpp
#include "reader/CreatorReader.h"
void some_function()
{
creator::CreatorReader* reader = creator::CreatorReader::createWithFilename("creator/scenes/sprites/CreatorSprites.ccreator");
// will create the needed spritesheets + design resolution
reader->setup();
// get the scene graph
Scene* scene = reader->getSceneGraph();
// ...and use it
Director::getInstance()->replaceScene(scene);
} Using it from luaRegister creator binding codes in c++ #include "reader/lua-bindings/creator_reader_bindings.hpp"
...
register_creator_reader_manual(L); Use in lua local creatorReader = creator.CreatorReader:createWithFilename('creator/CreatorSprites.ccreator')
creatorReader:setup()
local scene = creatorReader:getSceneGraph()
cc.Director:getInstance():replaceScene(scene) How to use ColliderManager
creator::CreatorReader* reader = creator::CreatorReader::createWithFilename("creator/CreatorSprites.ccreator");
// will create the needed spritesheets + design resolution
reader->setup();
// get the scene graph
Scene* scene = reader->getSceneGraph();
auto colliderManager = scene->getColliderManager();
colliderManager->registerCollitionCallback([=](creator::Contract::CollisionType type,
creator::Collider* collider1,
creator::Collider* collider2) {
if (type == creator::Contract::CollisionType::ENTER)
colliderManager->enableDebugDraw(true);
if (type == creator::Contract::CollisionType::EXIT)
colliderManager->enableDebugDraw(false);
}, ""); More features of Use the plugin in your Cocos Creator projectYou can install the released version from Creator, or you can copy |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论