Adam Reed wrote:
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
I tried create layer like this:
CCSize winsize = CCDirector::sharedDirector()
CCSprite *gameOverBg = CCSprite::create;
CCSprite menuItemBtn = CCSprite::create;
CCSpritemenuItemHvr = CCSprite::create(“CloseNormal.png”);
CCMenuItemSprite *menuItem = CCMenuItemSprite::create(menuItemBtn, menuItemHvr, this, menu_selector(HelloWorld::menuCloseCallback));
menuItem~~>setPosition(ccp(gameOverBg~~>getContentSize.width/2~~ 100,gameOverBg~~>getContentSize.height/2+100 ));
But the button not work, and the Scene behind stills work when i tought.
I don’t know why.
Thanks you very much