本文整理汇总了C++中spActor::getFirstChild方法的典型用法代码示例。如果您正苦于以下问题:C++ spActor::getFirstChild方法的具体用法?C++ spActor::getFirstChild怎么用?C++ spActor::getFirstChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spActor
的用法示例。
在下文中一共展示了spActor::getFirstChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDescendants
void getDescendants(spActor actor, std::vector<spActor> &actors)
{
actors.push_back(actor);
spActor child = actor->getFirstChild();
while (child)
{
getDescendants(child, actors);
child = child->getNextSibling();
}
//actor->removeChildren();
}
示例2: init
void TreeInspectorPage::init(spActor item)
{
OX_ASSERT(item);
setSize(Vector2(0,0));
_line = new TreeInspectorLine();
_line->setPosition(Vector2(5, 5));
_line->init(this, item);
addChild(_line);
float y = _line->getHeight() + _line->getY() + 5.0f;
if (item->getFirstChild())
{
spButton button;
if (_parentPage)// && item->getFirstChild() != item->getLastChild())
{
button = new Button();
button->setResAnim(_tree->_resSystem->getResAnim("checkbox"));
button->setPosition(Vector2(15.0f, y));
button->addEventListener(TouchEvent::CLICK, CLOSURE(this, &TreeInspectorPage::_onMinMaxClick));
addChild(button);
}
_pages = new Actor();
_pages->setInputEnabled(false);
_pages->setX(-15);
_pages->setY((float)y);
spActor child = item->getFirstChild();
while (child)
{
if (!child->isName("tree_inspector") && !child->isName("debug_actor"))
{
spTreeInspectorPage page = new TreeInspectorPage(_tree, this);
page->init(child);
_pages->addChild(page);
}
child = child->getNextSibling();
}
if (item->getVisible())
{
addChild(_pages);
if (button)
button->setRow(1);
}
else
{
if (button)
button->setRow(0);
}
}
updateInternalSize();
}