PuzzleSDK
StopActionsByFlagsTest类 参考

#include <ActionManagerTest.h>

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

Public 成员函数

 CREATE_FUNC (StopActionsByFlagsTest)
 
virtual std::string subtitle () const override
 
virtual void onEnter () override
 
void stopAction (float time)
 
- Public 成员函数 继承自 ActionManagerTest
 ActionManagerTest ()
 
 ~ActionManagerTest ()
 
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
 

Protected 属性

const unsigned int kMoveFlag = 0x01
 
const unsigned int kScaleFlag = 0x02
 
const unsigned int kRotateFlag = 0x04
 
const unsigned int kRepeatForeverFlag = 0x08
 
- Protected 属性 继承自 ActionManagerTest
cocos2d::TextureAtlas * _atlas
 
std::string _title
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 

详细描述

在文件 ActionManagerTest.h107 行定义.

成员函数说明

◆ CREATE_FUNC()

StopActionsByFlagsTest::CREATE_FUNC ( StopActionsByFlagsTest  )

◆ onEnter()

void StopActionsByFlagsTest::onEnter ( )
overridevirtual

重载 TestCase .

在文件 ActionManagerTest.cpp326 行定义.

327{
329
330 auto l = Label::createWithTTF("Should stop scale & move after 4 seconds but keep rotate", "fonts/Thonburi.ttf", 16.0f);
331 addChild(l);
332 l->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 75) );
333
334 auto pMove1 = MoveBy::create(2, Vec2(200.0f, 0.0f));
335 auto pMove2 = MoveBy::create(2, Vec2(-200.0f, 0.0f));
336 auto pSequenceMove = Sequence::createWithTwoActions(pMove1, pMove2);
337 auto pRepeatMove = RepeatForever::create(pSequenceMove);
338 pRepeatMove->setFlags(kMoveFlag | kRepeatForeverFlag);
339
340 auto pScale1 = ScaleBy::create(2, 1.5f);
341 auto pScale2 = ScaleBy::create(2, 1.0f/1.5f);
342 auto pSequenceScale = Sequence::createWithTwoActions(pScale1, pScale2);
343 auto pRepeatScale = RepeatForever::create(pSequenceScale);
344 pRepeatScale->setFlags(kScaleFlag | kRepeatForeverFlag);
345
346 auto pRotate = RotateBy::create(2, 360);
347 auto pRepeatRotate = RepeatForever::create(pRotate);
348 pRepeatRotate->setFlags(kRotateFlag | kRepeatForeverFlag);
349
350 auto pChild = Sprite::create(s_pathGrossini);
351 pChild->setPosition( VisibleRect::center() );
352
353 addChild(pChild, 1, kTagGrossini);
354 pChild->runAction(pRepeatMove);
355 pChild->runAction(pRepeatScale);
356 pChild->runAction(pRepeatRotate);
357 this->scheduleOnce((SEL_SCHEDULE)&StopActionsByFlagsTest::stopAction, 4);
358}
@ kTagGrossini
const unsigned int kRepeatForeverFlag
const unsigned int kScaleFlag
const unsigned int kMoveFlag
const unsigned int kRotateFlag
virtual void onEnter() override
Definition: BaseTest.cpp:430
static cocos2d::Vec2 top()
Definition: VisibleRect.cpp:57
static cocos2d::Vec2 center()
Definition: VisibleRect.cpp:69
static const char s_pathGrossini[]
Definition: testResource.h:28

引用了 VisibleRect::center(), kMoveFlag, kRepeatForeverFlag, kRotateFlag, kScaleFlag, kTagGrossini, TestCase::onEnter(), s_pathGrossini, stopAction() , 以及 VisibleRect::top().

+ 函数调用图:

◆ stopAction()

void StopActionsByFlagsTest::stopAction ( float  time)

在文件 ActionManagerTest.cpp360 行定义.

361{
362 auto sprite = getChildByTag(kTagGrossini);
363 sprite->stopActionsByFlags(kMoveFlag | kScaleFlag);
364}

引用了 kMoveFlag, kScaleFlag , 以及 kTagGrossini.

被这些函数引用 onEnter().

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

◆ subtitle()

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

重载 ActionManagerTest .

在文件 ActionManagerTest.cpp366 行定义.

367{
368 return "Stop All Actions By Flags Test";
369}

类成员变量说明

◆ kMoveFlag

const unsigned int StopActionsByFlagsTest::kMoveFlag = 0x01
protected

在文件 ActionManagerTest.h116 行定义.

被这些函数引用 onEnter() , 以及 stopAction().

◆ kRepeatForeverFlag

const unsigned int StopActionsByFlagsTest::kRepeatForeverFlag = 0x08
protected

在文件 ActionManagerTest.h119 行定义.

被这些函数引用 onEnter().

◆ kRotateFlag

const unsigned int StopActionsByFlagsTest::kRotateFlag = 0x04
protected

在文件 ActionManagerTest.h118 行定义.

被这些函数引用 onEnter().

◆ kScaleFlag

const unsigned int StopActionsByFlagsTest::kScaleFlag = 0x02
protected

在文件 ActionManagerTest.h117 行定义.

被这些函数引用 onEnter() , 以及 stopAction().


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