基本上和js一样,先创建Label,然后Item,Menu,添加,只不过写法不同罢了,在此感叹一下发个博客
下面为代码部分:
auto backLabel = Label::createWithTTF("Again", "fonts/Marker Felt.ttf", 36);
backLabel->setColor(Color3B::BLACK);
auto backItem = MenuItemLabel::create(backLabel);
backItem->setTarget(this, menu_selector(GameOverScene::reBackGame));
auto menu = Menu::create(backItem, nullptr);
addChild(menu);