PuzzleSDK
SpriteProgressBarVarious类 参考

#include <ActionsProgressTest.h>

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

Public 成员函数

 CREATE_FUNC (SpriteProgressBarVarious)
 
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.h80 行定义.

成员函数说明

◆ CREATE_FUNC()

SpriteProgressBarVarious::CREATE_FUNC ( SpriteProgressBarVarious  )

◆ onEnter()

void SpriteProgressBarVarious::onEnter ( )
overridevirtual

重载 SpriteDemo .

在文件 ActionsProgressTest.cpp234 行定义.

235{
237
238 auto s = Director::getInstance()->getWinSize();
239
240 auto to = Sequence::createWithTwoActions(ProgressTo::create(2, 100), ProgressTo::create(0, 0));
241
242 auto left = ProgressTimer::create(Sprite::create(s_pathSister1));
243 left->setType(ProgressTimer::Type::BAR);
244
245 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
246 left->setMidpoint(Vec2(0.5f, 0.5f));
247 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
248 left->setBarChangeRate(Vec2(1.0f, 0.0f));
249 addChild(left);
250 left->setPosition(100, s.height/2);
251 left->runAction(RepeatForever::create(to->clone()));
252
253 auto middle = ProgressTimer::create(Sprite::create(s_pathSister2));
254 middle->setType(ProgressTimer::Type::BAR);
255 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
256 middle->setMidpoint(Vec2(0.5f, 0.5f));
257 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
258 middle->setBarChangeRate(Vec2(1,1));
259 addChild(middle);
260 middle->setPosition(s.width/2, s.height/2);
261 middle->runAction(RepeatForever::create(to->clone()));
262
263 auto right = ProgressTimer::create(Sprite::create(s_pathSister2));
264 right->setType(ProgressTimer::Type::BAR);
265 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
266 right->setMidpoint(Vec2(0.5f, 0.5f));
267 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
268 right->setBarChangeRate(Vec2(0, 1));
269 addChild(right);
270 right->setPosition(s.width-100, s.height/2);
271 right->runAction(RepeatForever::create(to->clone()));
272}
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 SpriteProgressBarVarious::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 ActionsProgressTest.cpp274 行定义.

275{
276 return "ProgressTo Bar Mid";
277}

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