本文整理汇总了C++中CCLayerColor::getChildByTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLayerColor::getChildByTag方法的具体用法?C++ CCLayerColor::getChildByTag怎么用?C++ CCLayerColor::getChildByTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLayerColor
的用法示例。
在下文中一共展示了CCLayerColor::getChildByTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SingleElementWidth
ScreenProgressBar::ScreenProgressBar()
:_nodeBase(NULL), _layerFrame(NULL), _layerProgressBar(NULL), _controller(NULL)
{
{
CCSize size;
size.width = SingleElementWidth();
size.height = CCDirector::sharedDirector()->getWinSize().height;
setContentSize(size);
}
{
CCLayerColor* layerN = CCLayerColor::create(normalColor(), SingleElementWidth(), 30);
CCLabelTTF *label = CCLabelTTF::create("Loading. Please stand by.", MAX_DEFAULT_FONT, 10);
label->setTag(BUTTON_LABEL_TAG);
label->setColor(MAX_COLOR_WHITE);
CCSize sz = layerN->getContentSize();
sz.height /= 2;
label->setPosition(ccp((int)(sz.width * 0.25), (int)(sz.height * 0.25)));
sz.width *= CCDirector::sharedDirector()->getContentScaleFactor();
sz.height *= CCDirector::sharedDirector()->getContentScaleFactor();
label->setContentSize(sz);
label->setAnchorPoint(ccp(0, 0));
layerN->addChild(label);
CocosHelper::MoveNode(layerN->getChildByTag(11), ccp(15, 5));
addChild(layerN);
_buttons->addObject(layerN);
}
if (!_nodeBase)
{
_nodeBase = CCNode::create();
_nodeBase->setContentSize(CCSizeMake(SingleElementWidth(), SingleElementHeight()));
_nodeBase->setAnchorPoint(ccp(0, 0));
_nodeBase->setPosition(ccp(0, 0));
addChild(_nodeBase);
_buttons->addObject(_nodeBase);
}
ccColor4B color;
color = normalColor();
if (!_layerFrame)
{
_layerFrame = CCLayerColor::create(color, SingleElementWidth(), 50);
_layerFrame->setAnchorPoint(ccp(0, 0));
_layerFrame->setPosition(ccp(0, 0));
_nodeBase->addChild(_layerFrame);
}
color = selectedColor();
if (!_layerProgressBar)
{
_layerProgressBar = CCLayerColor::create(color, 0, 50);
_layerProgressBar->setAnchorPoint(ccp(0, 0));
_layerProgressBar->setPosition(ccp(0, 0));
_nodeBase->addChild(_layerProgressBar);
}
SetProgress(0.0);
}