@linqqhh 写道:
在DEBUG模式下用的CCLOG输出,但是点击按钮后没有CCLOG输出的内容.
代码:
bool HelloWorldLayer::init() {
if (!Layer::init()) {
return false;
}
Size size = Director::getInstance()->getVisibleSize();
Label* label = Label::createWithTTF("helloworld","fonts/Marker Felt.ttf",24);
label->setPosition(Vec2(size.width/2,size.height*3/4));
this->addChild(label);
auto sprite = Sprite::create("HelloWorld.png");
sprite->setPosition(Vec2(size.width/2,size.height/2));
this->addChild(sprite);
auto closeItem = MenuItemImage::create("CloseNormal.png","CloseSelected.png",CC_CALLBACK_1(HelloWorldLayer::menuCloseCallBack,this));
closeItem->setPosition(Vec2(400,100));
auto menu = Menu::create(closeItem,NULL);
menu->setPosition(Point::ZERO);
this->addChild(menu);
return true;
}
void HelloWorldLayer::menuCloseCallBack(Ref* pSender) {
CCLOG("menuCloseCallBack");
}
帖子: 1
参与者: 1