PuzzleSDK
SpriteProgressWithSpriteFrame类 参考

#include <ActionsProgressTest.h>

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

Public 成员函数

 CREATE_FUNC (SpriteProgressWithSpriteFrame)
 
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.h98 行定义.

成员函数说明

◆ CREATE_FUNC()

SpriteProgressWithSpriteFrame::CREATE_FUNC ( SpriteProgressWithSpriteFrame  )

◆ onEnter()

void SpriteProgressWithSpriteFrame::onEnter ( )
overridevirtual

重载 SpriteDemo .

在文件 ActionsProgressTest.cpp351 行定义.

352{
354
355 auto s = Director::getInstance()->getWinSize();
356
357 auto to = Sequence::createWithTwoActions(ProgressTo::create(6, 100), ProgressTo::create(0, 0));
358
359 SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini.plist");
360
361 auto left = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_01.png"));
362 left->setType(ProgressTimer::Type::BAR);
363 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
364 left->setMidpoint(Vec2(0.5f, 0.5f));
365 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
366 left->setBarChangeRate(Vec2(1.0f, 0.0f));
367 addChild(left);
368 left->setPosition(100, s.height/2);
369 left->runAction(RepeatForever::create(to->clone()));
370
371 auto middle = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_02.png"));
372 middle->setType(ProgressTimer::Type::BAR);
373 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
374 middle->setMidpoint(Vec2(0.5f, 0.5f));
375 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
376 middle->setBarChangeRate(Vec2(1, 1));
377 addChild(middle);
378 middle->setPosition(s.width/2, s.height/2);
379 middle->runAction(RepeatForever::create(to->clone()));
380
381 auto right = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_03.png"));
382 right->setType(ProgressTimer::Type::RADIAL);
383 // Setup for a bar starting from the bottom since the midpoint is 0 for the y
384 right->setMidpoint(Vec2(0.5f, 0.5f));
385 // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
386 right->setBarChangeRate(Vec2(0, 1));
387 addChild(right);
388 right->setPosition(s.width-100, s.height/2);
389 right->runAction(RepeatForever::create(to->clone()));
390}
virtual void onEnter() override

引用了 SpriteDemo::onEnter().

+ 函数调用图:

◆ subtitle()

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

重载 TestCase .

在文件 ActionsProgressTest.cpp392 行定义.

393{
394 return "Progress With Sprite Frame";
395}

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