#include <SpriteTest.h>
◆ SpriteBatchNodeReorder()
| SpriteBatchNodeReorder::SpriteBatchNodeReorder |
( |
| ) |
|
在文件 SpriteTest.cpp 第 679 行定义.
682 auto asmtest = SpriteBatchNode::create(
"animations/ghosts.png");
684 for(
int i=0; i<10; i++)
686 auto s1 = Sprite::createWithTexture(asmtest->getTexture(), Rect(0.0f, 0.0f, 50.0f, 50.0f));
688 asmtest->addChild(s1, 10);
691 for(
int i=0; i<10; i++)
695 asmtest->reorderChild(
static_cast<Node*
>(a.at(i)), 9 );
699 ssize_t CC_UNUSED prev = -1;
701 auto& children = asmtest->getChildren();
703 for(
const auto &obj : children) {
704 auto child =
static_cast<Sprite*
>(obj);
706 ssize_t currentIndex = child->getAtlasIndex();
707 CCASSERT( prev == currentIndex-1,
"Child order failed");
713 auto& descendants = asmtest->getDescendants();
714 for(
const auto &sprite : descendants) {
715 ssize_t currentIndex = sprite->getAtlasIndex();
716 CCASSERT( prev == currentIndex-1,
"Child order failed");
◆ CREATE_FUNC()
◆ subtitle()
| std::string SpriteBatchNodeReorder::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string SpriteBatchNodeReorder::title |
( |
| ) |
const |
|
overridevirtual |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp