LUA AND C++ SUPPORT ADDED TO COCOS CREATOR

Post Reply
User avatar
admin
Site Admin
Posts: 29
Joined: Nov 24th, '23, 09:57

LUA AND C++ SUPPORT ADDED TO COCOS CREATOR

Post by admin »

Cocos Creator is a full game engine and editor powered by JavaScript created by the team behind the Cocos2d-x project. If you want to learn more about the Cocos Creator project be sure to check out our hands on video. Today Cocos Creator learned a new trick in the form of C++ and Lua support for creator alpha zero. This doesn’t actually add C++ or Lua language support to Cocos Creator editor. Instead it’s a pair of new features. First Cocos Creator is now capable of exporting projects in .ccreator file format. Second they have provided a reader enabling Lua and C++ Cocos2d-x projects to read and use ccreator files. Essentially this enables Cocos Creator to be an editor for your C++/Lua Cocos games. Loading the scene in C++ is simple as illustrated by this code:

Code: Select all

#include "reader/CreatorReader.h"

void some_function()
{
    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();

    // ...and use it
    Director::getInstance()->replaceScene(scene);
}
Details from the Cocos Creator forum:

What's C++ and lua support for creator
It includes two parts:
  1. First, it is a Cocos Creator plugin that can export scenes generated by Cocos Creator into .ccreator files.
  2. Second, it has a reader that can parse .ccreator files. The reader can be used in cocos2d-x c++/lua project.
Download
There are two ways to get the plugin
  1. clone the repo29
  2. download the zip file8
Post Reply