mirror of https://github.com/axmolengine/axmol.git
40 lines
755 B
C++
40 lines
755 B
C++
|
#include "HelloWorldScene.h"
|
||
|
#include "cocostudio/CocoStudio.h"
|
||
|
#include "ui/CocosGUI.h"
|
||
|
|
||
|
USING_NS_CC;
|
||
|
|
||
|
using namespace cocostudio::timeline;
|
||
|
|
||
|
Scene* HelloWorld::createScene()
|
||
|
{
|
||
|
// 'scene' is an autorelease object
|
||
|
auto scene = Scene::create();
|
||
|
|
||
|
// 'layer' is an autorelease object
|
||
|
auto layer = HelloWorld::create();
|
||
|
|
||
|
// add layer as a child to scene
|
||
|
scene->addChild(layer);
|
||
|
|
||
|
// return the scene
|
||
|
return scene;
|
||
|
}
|
||
|
|
||
|
// on "init" you need to initialize your instance
|
||
|
bool HelloWorld::init()
|
||
|
{
|
||
|
//////////////////////////////
|
||
|
// 1. super init first
|
||
|
if ( !Layer::init() )
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
auto rootNode = CSLoader::createNode("MainScene.csb");
|
||
|
|
||
|
addChild(rootNode);
|
||
|
|
||
|
return true;
|
||
|
}
|