if ( !Layer::init() )
{
return false;
}
Size size = Director::getInstance()->getVisibleSize();
//MessageBox("消息内容", "消息标题");
LabelTTF * ttf = LabelTTF::create();
ttf->setString("LabelTTF");
ttf->setColor(Color3B::BLUE);
ttf->setPosition(CCPoint(size.width/2, size.height/2));
addChild(ttf);
//1菜单MenuImage(3个参数,1,2为图片,3为回调函数,此处用了闭包函数)
//2Menu Create的时候把 Image添加进来,可以添加多个MenuImage,在最后添加NULL作结束
auto menu = Menu::create(MenuItemImage::create("normal.png",
"selected.png", [this,tf](Object* ob){ //截取参数
this->removeChild(tf);
}),NULL);
addChild(menu);
return true;