PuzzleSDK
UILoadingBarTest_Right_Scale9类 参考

#include <UILoadingBarTest.h>

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

Public 成员函数

 CREATE_FUNC (UILoadingBarTest_Right_Scale9)
 
 UILoadingBarTest_Right_Scale9 ()
 
 ~UILoadingBarTest_Right_Scale9 ()
 
virtual bool init () override
 
void update (float delta) override
 
- Public 成员函数 继承自 UIScene
 UIScene ()
 
 ~UIScene ()
 
virtual void onEnter () override
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual std::string title () const
 
virtual std::string subtitle () const
 
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 属性

int _count
 
- Protected 属性 继承自 UIScene
cocos2d::Layer * _uiLayer
 
cocos2d::ui::Layout * _widget
 
cocos2d::ui::Text * _sceneTitle
 
- 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
 

详细描述

在文件 UILoadingBarTest.h77 行定义.

构造及析构函数说明

◆ UILoadingBarTest_Right_Scale9()

UILoadingBarTest_Right_Scale9::UILoadingBarTest_Right_Scale9 ( )

在文件 UILoadingBarTest.cpp252 行定义.

253: _count(0)
254{
255
256}

◆ ~UILoadingBarTest_Right_Scale9()

UILoadingBarTest_Right_Scale9::~UILoadingBarTest_Right_Scale9 ( )

在文件 UILoadingBarTest.cpp258 行定义.

259{
260 unscheduleUpdate();
261}

成员函数说明

◆ CREATE_FUNC()

UILoadingBarTest_Right_Scale9::CREATE_FUNC ( UILoadingBarTest_Right_Scale9  )

◆ init()

bool UILoadingBarTest_Right_Scale9::init ( )
overridevirtual

重载 UIScene .

在文件 UILoadingBarTest.cpp263 行定义.

264{
265 if (UIScene::init())
266 {
267 scheduleUpdate();
268
269 Size widgetSize = _widget->getContentSize();
270
271 // Add the alert
272 Text *alert = Text::create("LoadingBar right scale9 render", "fonts/Marker Felt.ttf", 20);
273 alert->setColor(Color3B(159, 168, 176));
274 alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getContentSize().height * 2.7f));
275 _uiLayer->addChild(alert);
276
277 // Create the loading bar
278 LoadingBar* loadingBar = LoadingBar::create("cocosui/slider_bar_active_9patch.png");
279 loadingBar->setTag(0);
280 loadingBar->setScale9Enabled(true);
281 loadingBar->setCapInsets(Rect(0, 0, 0, 0));
282 loadingBar->setContentSize(Size(300, 13));
283 loadingBar->setDirection(LoadingBar::Direction::RIGHT);
284
285 loadingBar->setPosition(Vec2(widgetSize.width / 2.0f,
286 widgetSize.height / 2.0f + loadingBar->getContentSize().height / 4.0f));
287
288 _uiLayer->addChild(loadingBar);
289
290 return true;
291 }
292 return false;
293}
cocos2d::Layer * _uiLayer
Definition: UIScene.h:44
virtual bool init() override
Definition: UIScene.cpp:46
cocos2d::ui::Layout * _widget
Definition: UIScene.h:45

引用了 UIScene::_uiLayer, UIScene::_widget , 以及 UIScene::init().

+ 函数调用图:

◆ update()

void UILoadingBarTest_Right_Scale9::update ( float  delta)
override

在文件 UILoadingBarTest.cpp295 行定义.

296{
297 _count++;
298 if (_count > 100)
299 {
300 _count = 0;
301 }
302 LoadingBar* loadingBar = static_cast<LoadingBar*>(_uiLayer->getChildByTag(0));
303 loadingBar->setPercent(_count);
304}

引用了 _count , 以及 UIScene::_uiLayer.

类成员变量说明

◆ _count

int UILoadingBarTest_Right_Scale9::_count
protected

在文件 UILoadingBarTest.h88 行定义.

被这些函数引用 update().


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