Question

I get HelloWorldScene.h instead of HelloWorldLayer when I create a new project from cocos2d iOS template. How to get HelloWorldLayer? I'm using Xcode 5.5.1 and cocos2d 3.0.0.

Was it helpful?

Solution

If you are using Xcode 5.5.1, then nobody can help you because that would be under Apple Developer NDA (it is unreleased). If 5.5.1 is a typo maybe you are using 5.1.1 or 5.1?

in the HelloWork example, please look at HelloWorkdScene.cpp for:

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;
}

There is your layer that is created and added to the scene. I'm not sure what you mean by How to get HelloWorldLayer?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top