本文整理汇总了C++中BaseSprite::setBeganTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseSprite::setBeganTarget方法的具体用法?C++ BaseSprite::setBeganTarget怎么用?C++ BaseSprite::setBeganTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseSprite
的用法示例。
在下文中一共展示了BaseSprite::setBeganTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initBg
void ClassicScene::initBg()
{
CCSprite *bg = SPRITE(images/stage_classic/stage_bg_RETINA.png);
bg->setPosition(VisibleRect::center());
addChild(bg);
CCSprite *bgWood = SPRITE(images/stage_classic/stage_tree_RETINA.png);
CCSprite *floor = SPRITE(images/stage_classic/stage_tree_grass_RETINA.png);
floor->setPosition(ccp(VisibleRect::center().x,44));
bgWood->setPosition(ccp(VisibleRect::center().x,-400));
CCActionInterval *moveAct = CCMoveTo::create(0.6f,ccp(VisibleRect::center().x,400));
CCCallFunc *showBirdLayerHandler = CCCallFunc::create(this,callfunc_selector(ClassicScene::showBirdLayer));
bgWood->runAction(CCSequence::create(moveAct,showBirdLayerHandler,NULL));
addChild(bgWood);
birdLayer = BirdLayer::create();
birdLayer->setPosition(ccp(VisibleRect::center().x,-400));
addChild(birdLayer);
addChild(floor);
BaseSprite *pauseBtn = BaseSprite::createFromFile("images/stage_classic/stage_dimm2_RETINA.png","sounds/SFX/pausebuttonclick.mp3");
pauseBtn->setPosition(ccp(50,VisibleRect::top().y-50));
pauseBtn->setOpacity(0);
pauseBtn->setBeganTarget(this,menu_selector(ClassicScene::pauseGame));
addChild(pauseBtn);
}