PuzzleSDK
SpriteBatchNodeReorderSameIndex类 参考

#include <SpriteTest.h>

+ 类 SpriteBatchNodeReorderSameIndex 继承关系图:
+ SpriteBatchNodeReorderSameIndex 的协作图:

Public 成员函数

 CREATE_FUNC (SpriteBatchNodeReorderSameIndex)
 
 SpriteBatchNodeReorderSameIndex ()
 SpriteBatchNodeReorderSameIndex 更多...
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
void reorderSprite (float dt)
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 
virtual void onEnter () override
 

Private 属性

cocos2d::SpriteBatchNode * _batchNode
 
cocos2d::Sprite * _sprite1
 
cocos2d::Sprite * _sprite2
 
cocos2d::Sprite * _sprite3
 
cocos2d::Sprite * _sprite4
 
cocos2d::Sprite * _sprite5
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 SpriteTestDemo
std::string _title
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 SpriteTest.h673 行定义.

构造及析构函数说明

◆ SpriteBatchNodeReorderSameIndex()

SpriteBatchNodeReorderSameIndex::SpriteBatchNodeReorderSameIndex ( )

SpriteBatchNodeReorderSameIndex

在文件 SpriteTest.cpp4344 行定义.

4345{
4346 _batchNode = SpriteBatchNode::create("Images/piece.png", 15);
4347 addChild(_batchNode, 1, 0);
4348
4349 _sprite1 = Sprite::createWithTexture(_batchNode->getTexture(), Rect(128.0f,0.0f,64.0f,64.0f));
4350 _sprite1->setPosition(Vec2(100.0f,160.0f));
4351 _batchNode->addChild(_sprite1, 3, 1);
4352
4353 _sprite2= Sprite::createWithTexture(_batchNode->getTexture(), Rect(128.0f,0.0f,64.0f,64.0f));
4354 _sprite2->setPosition(Vec2(164.0f,160.0f));
4355 _batchNode->addChild(_sprite2, 4, 2);
4356
4357 _sprite3 = Sprite::createWithTexture(_batchNode->getTexture(), Rect(128.0f,0.0f,64.0f,64.0f));
4358 _sprite3->setPosition(Vec2(228.0f,160.0f));
4359 _batchNode->addChild(_sprite3, 4, 3);
4360
4361 _sprite4 = Sprite::createWithTexture(_batchNode->getTexture(), Rect(128.0f,0.0f,64.0f,64.0f));
4362 _sprite4->setPosition(Vec2(292.0f,160.0f));
4363 _batchNode->addChild(_sprite4, 5, 4);
4364
4365 _sprite5 = Sprite::createWithTexture(_batchNode->getTexture(), Rect(128.0f,0.0f,64.0f,64.0f));
4366 _sprite5->setPosition(Vec2(356.0f,160.0f));
4367 _batchNode->addChild(_sprite5, 6, 5);
4368
4369
4370 scheduleOnce(CC_CALLBACK_1(SpriteBatchNodeReorderSameIndex::reorderSprite, this), 2, "reorder_sprite_key");
4371}
cocos2d::Sprite * _sprite5
Definition: SpriteTest.h:689
cocos2d::SpriteBatchNode * _batchNode
Definition: SpriteTest.h:684
cocos2d::Sprite * _sprite3
Definition: SpriteTest.h:687
cocos2d::Sprite * _sprite1
Definition: SpriteTest.h:685
cocos2d::Sprite * _sprite4
Definition: SpriteTest.h:688
cocos2d::Sprite * _sprite2
Definition: SpriteTest.h:686

引用了 _batchNode, _sprite1, _sprite2, _sprite3, _sprite4, _sprite5 , 以及 reorderSprite().

+ 函数调用图:

成员函数说明

◆ CREATE_FUNC()

SpriteBatchNodeReorderSameIndex::CREATE_FUNC ( SpriteBatchNodeReorderSameIndex  )

◆ reorderSprite()

void SpriteBatchNodeReorderSameIndex::reorderSprite ( float  dt)

在文件 SpriteTest.cpp4383 行定义.

4384{
4385 _batchNode->reorderChild(_sprite4, 4);
4386 _batchNode->reorderChild(_sprite5, 4);
4387 _batchNode->reorderChild(_sprite1, 4);
4388
4389 _batchNode->sortAllChildren();
4390
4391 for(const auto &sprite : _batchNode->getDescendants()) {
4392 log("tag %i", sprite->getTag() );
4393 }
4394}

引用了 _batchNode, _sprite1, _sprite4 , 以及 _sprite5.

被这些函数引用 SpriteBatchNodeReorderSameIndex().

+ 这是这个函数的调用关系图:

◆ subtitle()

std::string SpriteBatchNodeReorderSameIndex::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 SpriteTest.cpp4378 行定义.

4379{
4380 return "tag order in console should be 2,3,4,5,1";
4381}

◆ title()

std::string SpriteBatchNodeReorderSameIndex::title ( ) const
overridevirtual

重载 TestCase .

在文件 SpriteTest.cpp4373 行定义.

4374{
4375 return "SpriteBatchNodeReorder same index";
4376}

类成员变量说明

◆ _batchNode

cocos2d::SpriteBatchNode* SpriteBatchNodeReorderSameIndex::_batchNode
private

在文件 SpriteTest.h684 行定义.

被这些函数引用 reorderSprite() , 以及 SpriteBatchNodeReorderSameIndex().

◆ _sprite1

cocos2d::Sprite* SpriteBatchNodeReorderSameIndex::_sprite1
private

在文件 SpriteTest.h685 行定义.

被这些函数引用 reorderSprite() , 以及 SpriteBatchNodeReorderSameIndex().

◆ _sprite2

cocos2d::Sprite* SpriteBatchNodeReorderSameIndex::_sprite2
private

在文件 SpriteTest.h686 行定义.

被这些函数引用 SpriteBatchNodeReorderSameIndex().

◆ _sprite3

cocos2d::Sprite* SpriteBatchNodeReorderSameIndex::_sprite3
private

在文件 SpriteTest.h687 行定义.

被这些函数引用 SpriteBatchNodeReorderSameIndex().

◆ _sprite4

cocos2d::Sprite* SpriteBatchNodeReorderSameIndex::_sprite4
private

在文件 SpriteTest.h688 行定义.

被这些函数引用 reorderSprite() , 以及 SpriteBatchNodeReorderSameIndex().

◆ _sprite5

cocos2d::Sprite* SpriteBatchNodeReorderSameIndex::_sprite5
private

在文件 SpriteTest.h689 行定义.

被这些函数引用 reorderSprite() , 以及 SpriteBatchNodeReorderSameIndex().


该类的文档由以下文件生成: