PuzzleSDK
Issue12249类 参考

#include <UIButtonTest.h>

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

Public 成员函数

 CREATE_FUNC (Issue12249)
 
 Issue12249 ()
 
virtual bool init () 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 属性

cocos2d::ui::Text * _displayValueLabel
 
- 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
 

详细描述

在文件 UIButtonTest.h253 行定义.

构造及析构函数说明

◆ Issue12249()

Issue12249::Issue12249 ( )

在文件 UIButtonTest.cpp1166 行定义.

1167: _displayValueLabel(nullptr)
1168{
1169
1170}
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:263

成员函数说明

◆ CREATE_FUNC()

Issue12249::CREATE_FUNC ( Issue12249  )

◆ init()

bool Issue12249::init ( )
overridevirtual

重载 UIScene .

在文件 UIButtonTest.cpp1172 行定义.

1173{
1174 if (UIScene::init())
1175 {
1176 Size widgetSize = _widget->getContentSize();
1177
1178 // Add a label in which the button events will be displayed
1179 _displayValueLabel = Text::create("Test Issue 12249", "fonts/Marker Felt.ttf",32);
1180 _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f));
1181 _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f,
1182 widgetSize.height / 2.0f));
1183 _uiLayer->addChild(_displayValueLabel);
1184
1185 // Add the alert
1186 Text* alert = Text::create("This test case two buttons should seem to be same!",
1187 "fonts/Marker Felt.ttf",20);
1188 alert->setColor(Color3B(159, 168, 176));
1189
1190 alert->setPosition(Vec2(widgetSize.width / 2.0f,
1191 widgetSize.height / 2.0f
1192 - alert->getContentSize().height * 2.0f));
1193
1194 _uiLayer->addChild(alert);
1195
1196 // Create the button 1
1197 Button* button = nullptr, *button2 = nullptr;
1198 float btnWidth = 100;
1199 button = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png");
1200 button->setScale9Enabled(true);
1201 button->setContentSize(Size(btnWidth, button->getContentSize().height));
1202 button->setTitleText("Scale9 Button 1");
1203 button->setPosition(Vec2(widgetSize.width / 2.0f - btnWidth, widgetSize.height / 2.0f));
1204 _uiLayer->addChild(button);
1205
1206 // create button 2, load texture after button creation
1207 button2 = Button::create();
1208 button2->setScale9Enabled(true);
1209 button2->loadTextures("cocosui/button.png", "cocosui/buttonHighlighted.png", "");
1210 button2->setContentSize(Size(btnWidth, button2->getContentSize().height));
1211 button2->setTitleText("Scale9 Button 2");
1212 button2->setPosition(Vec2(widgetSize.width / 2.0f + btnWidth, widgetSize.height / 2.0f));
1213 _uiLayer->addChild(button2);
1214
1215 return true;
1216 }
1217 return false;
1218}
cocos2d::Layer * _uiLayer
Definition: UIScene.h:44
virtual bool init() override
Definition: UIScene.cpp:46
cocos2d::ui::Layout * _widget
Definition: UIScene.h:45

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

+ 函数调用图:

类成员变量说明

◆ _displayValueLabel

cocos2d::ui::Text* Issue12249::_displayValueLabel
protected

在文件 UIButtonTest.h263 行定义.

被这些函数引用 init().


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