本文整理汇总了C++中CCLayer::getChildByTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLayer::getChildByTag方法的具体用法?C++ CCLayer::getChildByTag怎么用?C++ CCLayer::getChildByTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLayer
的用法示例。
在下文中一共展示了CCLayer::getChildByTag方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dispName
void NovelScene::dispName(string name)
{
CCLayer* pLayer = (CCLayer*) this->getChildByTag(kTag_TextLayer_name);
if (pLayer)
{
//텍스트를 진행한다
CCLabelTTF* nameTextLabel = (CCLabelTTF*) pLayer->getChildByTag(kTag_TextLayer_nameTextLabel);
nameTextLabel->setString(name.c_str());
}
}
示例2: dispText
void NovelScene::dispText(string text)
{
CCLayer* pLayer = (CCLayer*) this->getChildByTag(kTag_TextLayer);
if (pLayer)
{
//텍스트를 진행한다
CCLabelTTF* textLabel = (CCLabelTTF*) pLayer->getChildByTag(kTag_TextLayer_textLabel);
textLabel->setString(text.c_str());
}
}
示例3: setContentAccess
//SetContentAccess
//state
//1 - active
//2 - passive
void CurrentGroupLayer::setContentAccess(bool state)
{
CCLayer* spr = (CCLayer*)this->getChildByTag(ID_CONTROLLAYER);
spr->stopAllActions();
CCActionInterval* scalein = CCScaleTo::actionWithDuration(0.2f,1.2f,1.2f);
CCActionInterval* scaleout = CCScaleTo::actionWithDuration(0.2f,1.0f,1.0f);
CCActionInterval* fadetoin = CCFadeTo::actionWithDuration(0.2f,255);
CCActionInterval* fadetoout = CCFadeTo::actionWithDuration(0.2f,180);
if(state)
{
((CCSprite*)(spr->getChildByTag(ID_TEXTFIELD)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoin->copy()->autorelease(),2.0f));
((CCSprite*)(spr->getChildByTag(ID_COLORBOX)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoin->copy()->autorelease(),2.0f));
((CCSprite*)(spr->getChildByTag(ID_STRIPE)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoin->copy()->autorelease(),2.0f));
spr->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)scalein->copy()->autorelease(),2.0f));
m_isAccessable = true;
} else {
((CCSprite*)(spr->getChildByTag(ID_TEXTFIELD)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoout->copy()->autorelease(),2.0f));
((CCSprite*)(spr->getChildByTag(ID_COLORBOX)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoout->copy()->autorelease(),2.0f));
((CCSprite*)(spr->getChildByTag(ID_STRIPE)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoout->copy()->autorelease(),2.0f));
spr->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)scaleout->copy()->autorelease(),2.0f));
//hide keyboard
this->onClickTrackNode(0);
m_isAccessable = false;
}
}
示例4: canPassedCOLROW
bool TileMap::canPassedCOLROW(cocos2d::CCPoint pos){
CCLayer *layer = this->getLayer();
CCTMXTiledMap *tileMap = dynamic_cast<CCTMXTiledMap*>(layer->getChildByTag(tilemap_tag));
//获得block层
CCTMXLayer *block = tileMap->layerNamed("block");
//获得砖块(根据某个位置)
int tileGID = block->tileGIDAt(pos);
if (tileGID) {
CCDictionary *properties = tileMap->propertiesForGID(tileGID);
if (properties) {
const CCString *collion = properties->valueForKey("blockTiled");
if (collion&&collion->compare("1")) {
return true;
}
}
}
return true;
}
示例5: getTileMap
CCTMXTiledMap* TileMap::getTileMap(){
CCLayer *layer = this->getLayer();
CCTMXTiledMap *tileMap = dynamic_cast<CCTMXTiledMap*>(layer->getChildByTag(tilemap_tag));
return tileMap;
}