PuzzleSDK
NodeTest5类 参考

#include <NodeTest.h>

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

Public 成员函数

 CREATE_FUNC (NodeTest5)
 
void addAndRemove (float dt)
 
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
 
virtual void onEnter () override
 

Protected 成员函数

 NodeTest5 ()
 
- Protected 成员函数 继承自 TestCocosNodeDemo
 TestCocosNodeDemo ()
 
virtual ~TestCocosNodeDemo ()
 

额外继承的成员函数

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

详细描述

在文件 NodeTest.h69 行定义.

构造及析构函数说明

◆ NodeTest5()

NodeTest5::NodeTest5 ( )
protected

在文件 NodeTest.cpp189 行定义.

190{
191 auto sp1 = Sprite::create(s_pathSister1);
192 auto sp2 = Sprite::create(s_pathSister2);
193
194 sp1->setPosition(Vec2(100.0f,160.0f));
195 sp2->setPosition(Vec2(380.0f,160.0f));
196
197 auto rot = RotateBy::create(2.0f, 360.0f);
198 auto rot_back = rot->reverse();
199 auto forever = RepeatForever::create(Sequence::create(rot, rot_back, nullptr));
200 auto forever2 = forever->clone();
201 forever->setTag(101);
202 forever2->setTag(102);
203
204 addChild(sp1, 0, kTagSprite1);
205 addChild(sp2, 0, kTagSprite2);
206
207 sp1->runAction(forever);
208 sp2->runAction(forever2);
209
210 schedule(CC_CALLBACK_1(NodeTest5::addAndRemove, this), 2.0f, "add_and_remove_key");
211}
@ kTagSprite2
Definition: NodeTest.cpp:36
@ kTagSprite1
Definition: NodeTest.cpp:35
void addAndRemove(float dt)
Definition: NodeTest.cpp:213
static const char s_pathSister1[]
Definition: testResource.h:29
static const char s_pathSister2[]
Definition: testResource.h:30

引用了 addAndRemove(), kTagSprite1, kTagSprite2, s_pathSister1 , 以及 s_pathSister2.

+ 函数调用图:

成员函数说明

◆ addAndRemove()

void NodeTest5::addAndRemove ( float  dt)

在文件 NodeTest.cpp213 行定义.

214{
215 auto sp1 = getChildByTag(kTagSprite1);
216 auto sp2 = getChildByTag(kTagSprite2);
217
218 sp1->retain();
219 sp2->retain();
220
221 removeChild(sp1, false);
222 removeChild(sp2, true);
223
224 addChild(sp1, 0, kTagSprite1);
225 addChild(sp2, 0, kTagSprite2);
226
227 sp1->release();
228 sp2->release();
229}

引用了 kTagSprite1 , 以及 kTagSprite2.

被这些函数引用 NodeTest5().

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

◆ CREATE_FUNC()

NodeTest5::CREATE_FUNC ( NodeTest5  )

◆ subtitle()

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

重载 TestCase .

在文件 NodeTest.cpp231 行定义.

232{
233 return "remove and cleanup";
234}

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