PuzzleSDK
TileDemo类 参考

#include <TileMapTest.h>

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

Public 成员函数

 TileDemo ()
 
virtual ~TileDemo ()
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
virtual void onExit () override
 
void onTouchesMoved (const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
 
- 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
 

额外继承的成员函数

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

详细描述

在文件 TileMapTest.h32 行定义.

构造及析构函数说明

◆ TileDemo()

TileDemo::TileDemo ( )

在文件 TileMapTest.cpp85 行定义.

86{
87 // fix bug #486, #419.
88 // "test" is the default value in Director::setGLDefaultValues()
89 // but TransitionTest may setDepthTest(false), we should revert it here
90 Director::getInstance()->getRenderer()->setDepthTest(true);
91 Director::getInstance()->getRenderer()->setDepthWrite(true);
92 Director::getInstance()->getRenderer()->setDepthCompareFunction(backend::CompareFunction::LESS_EQUAL);
93
94 auto listener = EventListenerTouchAllAtOnce::create();
95 listener->onTouchesMoved = CC_CALLBACK_2(TileDemo::onTouchesMoved, this);
96 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
97}
void onTouchesMoved(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)

引用了 onTouchesMoved().

+ 函数调用图:

◆ ~TileDemo()

TileDemo::~TileDemo ( )
virtual

在文件 TileMapTest.cpp99 行定义.

100{
101}

成员函数说明

◆ onExit()

void TileDemo::onExit ( )
overridevirtual

TMXOrthoTest, TMXStaggeredTest, TMXIsoZorder, TMXIsoVertexZ , 以及 TMXOrthoVertexZ 重载.

在文件 TileMapTest.cpp113 行定义.

114{
115 TestCase::onExit();
116 Director::getInstance()->getRenderer()->setDepthTest(false);
117 Director::getInstance()->getRenderer()->setDepthWrite(false);
118}

被这些函数引用 TMXOrthoTest::onExit(), TMXStaggeredTest::onExit(), TMXIsoZorder::onExit(), TMXIsoVertexZ::onExit() , 以及 TMXOrthoVertexZ::onExit().

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

◆ onTouchesMoved()

void TileDemo::onTouchesMoved ( const std::vector< cocos2d::Touch * > &  touches,
cocos2d::Event *  event 
)

在文件 TileMapTest.cpp120 行定义.

121{
122 auto touch = touches[0];
123
124 auto diff = touch->getDelta();
125 auto node = getChildByTag(kTagTileMap);
126 auto currentPos = node->getPosition();
127 node->setPosition(currentPos + diff);
128}
@ kTagTileMap
Definition: TileMapTest.cpp:33

引用了 kTagTileMap.

被这些函数引用 TileDemo().

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

◆ subtitle()

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

◆ title()


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