Hi, i´ve update to 3.16, and i cant add a UI Layer to a scene, i used to do this:
Scene* HelloworldScene::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = HelloworldScene::create();
scene ->addChild(layer);
auto UILayer = Ui::create();
scene ->addChild(UILayer ,1);
// return the scene
return scene;
}
But now the HelloworldScene is a Scene, not a Layer, i can add a layer, but now its a child of HelloworldScene, and its moves with it, UI doesn´t supposed to do that.
How can i do that now?, thanks
pd: i can change HelloworldScene class to public cocos2d::Layer, and its works, but probably there is a reason for be a Scene now.
class HelloWorldScene : public cocos2d::Layer
Scene* HelloWorldScene ::createScene()
{
auto scene = Scene::create();
auto playingLayer = HelloWorldScene ::create();
scene->addChild(playingLayer);
auto uiLayer = Ui::create();
scene->addChild(uiLayer, 1);
return scene;
}
But Now, Since HelloWorldScene is Scene, not Layer :
class HelloWorldScene : public cocos2d::Scene
Scene* HelloWorldScene ::createScene()
{
auto scene = HelloWorldScene ::create();
auto uiLayer = Ui::create();
scene->addChild(uiLayer, 1);
return scene;
}