PuzzleSDK
SpriteProgressBarTintAndFade类 参考

#include <ActionsProgressTest.h>

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

Public 成员函数

 CREATE_FUNC (SpriteProgressBarTintAndFade)
 
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.h89 行定义.

成员函数说明

◆ CREATE_FUNC()

SpriteProgressBarTintAndFade::CREATE_FUNC ( SpriteProgressBarTintAndFade  )

◆ onEnter()

void SpriteProgressBarTintAndFade::onEnter ( )
overridevirtual

重载 SpriteDemo .

在文件 ActionsProgressTest.cpp284 行定义.

285{
287
288 auto s = Director::getInstance()->getWinSize();
289
290 auto to = Sequence::createWithTwoActions(ProgressTo::create(6, 100), ProgressTo::create(0, 0));
291 auto tint = Sequence::create(TintTo::create(1, 255, 0, 0),
292 TintTo::create(1, 0, 255, 0),
293 TintTo::create(1, 0, 0, 255),
294 nullptr);
295 auto fade = Sequence::create(FadeTo::create(1.0f, 0),
296 FadeTo::create(1.0f, 255),
297 nullptr);
298
299 auto left = ProgressTimer::create(Sprite::create(s_pathSister1));
300 left->setType(ProgressTimer::Type::BAR);
301
302 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
303 left->setMidpoint(Vec2(0.5f, 0.5f));
304 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
305 left->setBarChangeRate(Vec2(1.0f, 0.0f));
306 addChild(left);
307 left->setPosition(100, s.height/2);
308 left->runAction(RepeatForever::create(to->clone()));
309 left->runAction(RepeatForever::create(tint->clone()));
310
311 left->addChild(Label::createWithTTF("Tint", "fonts/Marker Felt.ttf", 20.0f));
312
313 auto middle = ProgressTimer::create(Sprite::create(s_pathSister2));
314 middle->setType(ProgressTimer::Type::BAR);
315 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
316 middle->setMidpoint(Vec2(0.5f, 0.5f));
317 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
318 middle->setBarChangeRate(Vec2(1, 1));
319 addChild(middle);
320 middle->setPosition(s.width/2, s.height/2);
321 middle->runAction(RepeatForever::create(to->clone()));
322 middle->runAction(RepeatForever::create(fade->clone()));
323
324 middle->addChild(Label::createWithTTF("Fade", "fonts/Marker Felt.ttf", 20.0f));
325
326 auto right = ProgressTimer::create(Sprite::create(s_pathSister2));
327 right->setType(ProgressTimer::Type::BAR);
328 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
329 right->setMidpoint(Vec2(0.5f, 0.5f));
330 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
331 right->setBarChangeRate(Vec2(0, 1));
332 addChild(right);
333 right->setPosition(s.width-100, s.height/2);
334 right->runAction(RepeatForever::create(to->clone()));
335 right->runAction(RepeatForever::create(tint->clone()));
336 right->runAction(RepeatForever::create(fade->clone()));
337
338 right->addChild(Label::createWithTTF("Tint and Fade", "fonts/Marker Felt.ttf", 20.0f));
339}
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 SpriteProgressBarTintAndFade::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 ActionsProgressTest.cpp341 行定义.

342{
343 return "ProgressTo Bar Mid";
344}

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