PuzzleSDK
SpriteProgressToVertical类 参考

#include <ActionsProgressTest.h>

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

Public 成员函数

 CREATE_FUNC (SpriteProgressToVertical)
 
virtual void onEnter () override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 SpriteDemo
 SpriteDemo ()
 
 ~SpriteDemo ()
 
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 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 ActionsProgressTest.h62 行定义.

成员函数说明

◆ CREATE_FUNC()

SpriteProgressToVertical::CREATE_FUNC ( SpriteProgressToVertical  )

◆ onEnter()

void SpriteProgressToVertical::onEnter ( )
overridevirtual

重载 SpriteDemo .

在文件 ActionsProgressTest.cpp149 行定义.

150{
152
153 auto s = Director::getInstance()->getWinSize();
154
155 auto to1 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
156 auto to2 = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
157
158 auto left = ProgressTimer::create(Sprite::create(s_pathSister1));
159 left->setType(ProgressTimer::Type::BAR);
160
161 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
162 left->setMidpoint(Vec2(0.0f,0.0f));
163 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
164 left->setBarChangeRate(Vec2(0.0f, 1.0f));
165 addChild(left);
166 left->setPosition(100, s.height/2);
167 left->runAction( RepeatForever::create(to1));
168
169 auto right = ProgressTimer::create(Sprite::create(s_pathSister2));
170 right->setType(ProgressTimer::Type::BAR);
171 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
172 right->setMidpoint(Vec2(0, 1));
173 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
174 right->setBarChangeRate(Vec2(0, 1));
175 addChild(right);
176 right->setPosition(s.width-100, s.height/2);
177 right->runAction( RepeatForever::create(to2));
178}
virtual void onEnter() override
static const char s_pathSister1[]
Definition: testResource.h:29
static const char s_pathSister2[]
Definition: testResource.h:30

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

+ 函数调用图:

◆ subtitle()

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

重载 TestCase .

在文件 ActionsProgressTest.cpp180 行定义.

181{
182 return "ProgressTo Vertical";
183}

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