PuzzleSDK
NodeTest2类 参考

#include <NodeTest.h>

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

Public 成员函数

 CREATE_FUNC (NodeTest2)
 
virtual void onEnter () override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 TestCocosNodeDemo
virtual std::string title () const 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.h47 行定义.

成员函数说明

◆ CREATE_FUNC()

NodeTest2::CREATE_FUNC ( NodeTest2  )

◆ onEnter()

void NodeTest2::onEnter ( )
overridevirtual

重载 TestCase .

在文件 NodeTest.cpp97 行定义.

98{
100
101 auto s = Director::getInstance()->getWinSize();
102
103 auto sp1 = Sprite::create(s_pathSister1);
104 auto sp2 = Sprite::create(s_pathSister2);
105 auto sp3 = Sprite::create(s_pathSister1);
106 auto sp4 = Sprite::create(s_pathSister2);
107
108 sp1->setPosition(Vec2(100.0f, s.height /2 ));
109 sp2->setPosition(Vec2(380.0f, s.height /2 ));
110 addChild(sp1);
111 addChild(sp2);
112
113 sp3->setScale(0.25f);
114 sp4->setScale(0.25f);
115
116 sp1->addChild(sp3);
117 sp2->addChild(sp4);
118
119 auto a1 = RotateBy::create(2, 360);
120 auto a2 = ScaleBy::create(2, 2);
121
122 auto action1 = RepeatForever::create( Sequence::create(a1, a2, a2->reverse(), nullptr) );
123 auto action2 = RepeatForever::create( Sequence::create(
124 a1->clone(),
125 a2->clone(),
126 a2->reverse(),
127 nullptr)
128 );
129
130 sp2->setAnchorPoint(Vec2(0,0));
131
132 sp1->runAction(action1);
133 sp2->runAction(action2);
134}
virtual void onEnter() override
Definition: BaseTest.cpp:430
static const char s_pathSister1[]
Definition: testResource.h:29
static const char s_pathSister2[]
Definition: testResource.h:30

引用了 TestCase::onEnter(), s_pathSister1 , 以及 s_pathSister2.

+ 函数调用图:

◆ subtitle()

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

重载 TestCase .

在文件 NodeTest.cpp136 行定义.

137{
138 return "anchorPoint and children";
139}

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