I’m newbie in Cocos2d-x.
I have a ABCScene, in this, i want to display a dialog or something else to tell player that they finish the game level.It also have button “Replay” + “Next” How can i do that.
Any idea will be appreciate. Thanks for all your help.
As far as I know, there is no build-in dialogs in cocos2dx. You have to write your own dialogs classes to display messages. It can be a CCNode with some background sprite and buttons as children.
I don’t know if cocos has built in dialogues but what about a having a layer with the text / buttons on.
>
You either create it up front and keep it hidden or just create it when you need it.
>
You can place it on top of the other layers and center it.
I’n newbie, could you please create a simple sample code for that layer
CCMenuItemSprite *menuItem = CCMenuItemSprite::create(menuItemBtn, menuItemHvr, this, menu_selector(HelloWorld::menuCloseCallback));
menuItem~~>setTag;
menuItem~~>setPosition(ccp(gameOverBg~~>getContentSize.width/2~~ 100,gameOverBg~~>getContentSize.height/2+100 ));
gameOverBg~~>addChild(menuItem);
But the button not work, and the Scene behind stills work when i tought.