本文整理汇总了C++中CCDirector::popScene方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDirector::popScene方法的具体用法?C++ CCDirector::popScene怎么用?C++ CCDirector::popScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCDirector
的用法示例。
在下文中一共展示了CCDirector::popScene方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ccTouchesBegan
void GameLayer::ccTouchesBegan(CCSet* pTouch, CCEvent* pEvent){
//check if the backIcon is pressed
CCTouch *touch = (CCTouch*)pTouch->anyObject();
CCPoint location = touch->getLocation();
CCDirector* pDirector = CCDirector::sharedDirector();
CCSize winSize = pDirector->getWinSize();
float icon_radius = backIcon->getContentSize().height / 2;
//distance from icon target to center of the sprite
float distanceSQ = ccpDistanceSQ(location, backIcon->getPosition());
if (distanceSQ <= icon_radius * icon_radius){
//change the icon to pressed
//MapLayer::getMap()->unlockNextLevel();
pDirector->popScene();
return;
}
//back button checking ended
//gesture detection initiate
ccp_last = touch->getLocationInView();
ccp_last = pDirector->convertToGL(ccp_last);
b_click = true;
b_rect = false;
b_circle = false;
count_order = 0;
gd_direction = kGDirectionNo;
for (int i = 0; i < 4; i++){
cache_deirectionshape[i] = false;
}
//gesture detection ended
}
示例2: pop
void SceneManager::pop()
{
CCDirector* director = CCDirector::sharedDirector();
if (director->getRunningScene())
{
director->popScene();
}
}