本文整理汇总了C++中GraphicLayer::getChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicLayer::getChildren方法的具体用法?C++ GraphicLayer::getChildren怎么用?C++ GraphicLayer::getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicLayer
的用法示例。
在下文中一共展示了GraphicLayer::getChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: linkInputLabels
void linkInputLabels()
{
GraphicLayer* layer = GraphicLayer::sharedLayer();
CCArray* children = layer->getChildren();
if(children != NULL)
{
for(int i = 0 ; i < children->count(); i++)
{
RawObject* child = (RawObject*)children->objectAtIndex(i);
//Force actualization of content size and fontSize after everything is loaded because the nodeToWorldTransform is only right after
if(isKindOfClass(child, InputLabel))
{
InputLabel* input = (InputLabel*)child;
child->getNode()->setContentSize(child->getNode()->getContentSize());
if(input->getOriginalInfos() != NULL)
{
((ui::EditBox*)child->getNode())->setFontSize(input->getOriginalInfos()->getFontSize());
}
}
if((isKindOfClass(child, InputLabel)) && child->getEventInfos()->objectForKey("LinkTo") != NULL && isKindOfClass(child->getEventInfos()->objectForKey("LinkTo"), CCString))
{
InputLabel* input = (InputLabel*)child;
if(input->getLinkTo() == NULL)
{
CCString* linkTo = (CCString*)child->getEventInfos()->objectForKey("LinkTo");
CCArray* matchs = layer->allObjectsWithName(linkTo);
for(long j = 0; j < matchs->count(); j++)
{
RawObject* match = (RawObject*)matchs->objectAtIndex(j);
if(isKindOfClass(match, LabelTTF))
{
input->setLinkTo((LabelTTF*)match);
j = matchs->count();
}
}
}
}
else if((isKindOfClass(child, DropDownList)) && child->getEventInfos()->objectForKey("LinkTo") != NULL && isKindOfClass(child->getEventInfos()->objectForKey("LinkTo"), CCString))
{
DropDownList* dropDownList = (DropDownList*)child;
if(dropDownList->getLinkTo() == NULL)
{
CCString* linkTo = (CCString*)child->getEventInfos()->objectForKey("LinkTo");
CCArray* matchs = layer->allObjectsWithName(linkTo);
for(long j = 0; j < matchs->count(); j++)
{
RawObject* match = (RawObject*)matchs->objectAtIndex(j);
if(isKindOfClass(match, LabelTTF))
{
dropDownList->setLinkTo((LabelTTF*)match);
j = matchs->count();
}
}
}
}
}
}
}
示例2: reorderZindex
void reorderZindex()
{
GraphicLayer* layer = GraphicLayer::sharedLayer();
CCArray* children = layer->getChildren();
if(children != NULL)
{
for(int i = 0 ; i < children->count(); i++)
{
RawObject* child = (RawObject*)children->objectAtIndex(i);
if(child->getZOrder() != 0)
{
layer->reorderChild(child, child->getZOrder());
}
}
}
}