本文整理汇总了C++中CCLayer::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLayer::setVisible方法的具体用法?C++ CCLayer::setVisible怎么用?C++ CCLayer::setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLayer
的用法示例。
在下文中一共展示了CCLayer::setVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onBattleSummary
void BattleScene::onBattleSummary(CCObject* obj) {
this->removeChildByTag(BATTLE_LAYER_TAG);
//// 战斗结算层
CCLayer* pSummary = BattleSummary::create();
this->addChild(pSummary, 100, BATTLESUMMARY_TAG);
pSummary->setVisible(true);
BgOfMainSceneLayer* pBgOfMainSceneLayer = BgOfMainSceneLayer::create();
this->addChild(pBgOfMainSceneLayer, 10000);
}
示例2: checkLayersVisiable
void UIScrollLayer::checkLayersVisiable()
{
CCSize contentSize = getContentSize();
bool isMoving = false;
float offset = 0;
if (m_ScrollDir == ESD_Horizontal)
{
offset = m_baseLayer->getPosition().x + m_CurPage * m_obContentSize.width - m_ptCenter.x;
}
else
{
offset = m_baseLayer->getPosition().y + m_CurPage * m_obContentSize.height - m_ptCenter.y;
}
if(std::abs(offset) < 1.0)
{
isMoving = false;
}
else
{
isMoving = true;
}
/*if((ptbaselayer.x - m_ptCenter.x) % contentSize.width != 0)
{
isMoving = true;
}
if((ptbaselayer.y - m_ptCenter.y) % contentSize.width != 0)
{
isMoving = true;
}*/
if(m_PageLayer)
{
for(int i = 0; i < (int)m_PageLayer->count(); i++)
{
CCLayer* layer = (CCLayer*)m_PageLayer->objectAtIndex(i);
if(layer)
{
if(isMoving)
{
if(i >= m_CurPage-1 && i<= m_CurPage +1)
{
layer->setVisible(true);
}
else
{
layer->setVisible(false);
}
}
else
{
if(i == m_CurPage)
{
layer->setVisible(true);
}
else
{
layer->setVisible(false);
}
}
}
}
}
}
示例3: option
void Demo::option() {
CCLayer* l = (CCLayer*)this->getChildByTag(100);
l->setTouchEnabled(true);
l->setVisible(true);
}