当前位置: 首页>>代码示例>>C++>>正文


C++ CCLayer::getChildByTag方法代码示例

本文整理汇总了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());
    }
}
开发者ID:pdpdds,项目名称:cocos2dx-dev,代码行数:10,代码来源:NovelScene.cpp

示例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());
    }
}
开发者ID:pdpdds,项目名称:cocos2dx-dev,代码行数:10,代码来源:NovelScene.cpp

示例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;
	}
}
开发者ID:crocodev,项目名称:Croco,代码行数:33,代码来源:GroupCustomization.cpp

示例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;
}
开发者ID:GITHZZ,项目名称:Cocos2dx_AI,代码行数:18,代码来源:TileMap.cpp

示例5: getTileMap

CCTMXTiledMap* TileMap::getTileMap(){
    CCLayer *layer = this->getLayer();
    CCTMXTiledMap *tileMap = dynamic_cast<CCTMXTiledMap*>(layer->getChildByTag(tilemap_tag));
    return tileMap;
}
开发者ID:GITHZZ,项目名称:Cocos2dx_AI,代码行数:5,代码来源:TileMap.cpp


注:本文中的CCLayer::getChildByTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。