PuzzleSDK
Issue16100Test类 参考

#include <NodeTest.h>

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

Public 成员函数

 CREATE_FUNC (Issue16100Test)
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
virtual void onEnter () override
 
virtual void onExit () override
 
- 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
 

额外继承的成员函数

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

详细描述

在文件 NodeTest.h334 行定义.

成员函数说明

◆ CREATE_FUNC()

Issue16100Test::CREATE_FUNC ( Issue16100Test  )

◆ onEnter()

void Issue16100Test::onEnter ( )
overridevirtual

重载 TestCase .

在文件 NodeTest.cpp1447 行定义.

1448{
1450
1451 // create user camera
1452 auto s = Director::getInstance()->getWinSize();
1453
1454 auto delay = DelayTime::create(0.1f);
1455 auto f = CallFunc::create([this, s]()
1456 {
1457 auto camera = Camera::createOrthographic(s.width * 2, s.height * 2, -1024, 1024);
1458 camera->setCameraFlag(CameraFlag::USER1);
1459 addChild(camera);
1460 });
1461 this->runAction(Sequence::createWithTwoActions(delay, f));
1462
1463 // grossini using default camera
1464 auto sprite = Sprite::create("Images/grossini.png");
1465 this->addChild(sprite);
1466
1467 sprite->setPosition(-200,s.height/3);
1468 auto moveby = MoveBy::create(2, Vec2(400.0f,0.0f));
1469 auto movebyback = moveby->reverse();
1470 auto seq = Sequence::create(moveby, movebyback, nullptr);
1471 auto forever = RepeatForever::create(seq);
1472
1473 sprite->runAction(forever);
1474
1475 sprite->setCameraMask((int)CameraFlag::DEFAULT);
1476
1477
1478 // grossini's sister using user camera
1479 auto sister = Sprite::create("Images/grossinis_sister1.png");
1480 this->addChild(sister);
1481
1482 sister->setPosition(-200,s.height*2/3);
1483 auto moveby1 = MoveBy::create(2, Vec2(400.0f,0.0f));
1484 auto movebyback1 = moveby1->reverse();
1485 auto seq1 = Sequence::create(moveby1, movebyback1, nullptr);
1486 auto forever1 = RepeatForever::create(seq1);
1487
1488 sister->runAction(forever1);
1489 sister->setCameraMask((int)CameraFlag::USER1);
1490}
virtual void onEnter() override
Definition: BaseTest.cpp:430

引用了 TestCase::onEnter().

+ 函数调用图:

◆ onExit()

void Issue16100Test::onExit ( )
overridevirtual

在文件 NodeTest.cpp1492 行定义.

1493{
1494 TestCocosNodeDemo::onExit();
1495}

◆ subtitle()

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

重载 TestCase .

在文件 NodeTest.cpp1502 行定义.

1503{
1504 return "Sprite should appear on the screen";
1505}

◆ title()

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

重载 TestCocosNodeDemo .

在文件 NodeTest.cpp1497 行定义.

1498{
1499 return "Issue 16100";
1500}

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