PuzzleSDK
UIS9EnableScale9FalseTest类 参考

#include <UIScale9SpriteTest.h>

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

Public 成员函数

 CREATE_FUNC (UIS9EnableScale9FalseTest)
 
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
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- 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
 

详细描述

在文件 UIScale9SpriteTest.h307 行定义.

成员函数说明

◆ CREATE_FUNC()

UIS9EnableScale9FalseTest::CREATE_FUNC ( UIS9EnableScale9FalseTest  )

◆ init()

bool UIS9EnableScale9FalseTest::init ( )
overridevirtual

重载 UIScene .

在文件 UIScale9SpriteTest.cpp1102 行定义.

1103{
1104 if (UIScene::init()) {
1105
1106 auto winSize = Director::getInstance()->getWinSize();
1107 float x = winSize.width / 2 + 50;
1108 float y = 0 + (winSize.height / 2 + 10);
1109
1110 auto label = Label::createWithSystemFont("Only the yellow block intersect with the green one.", "Arial", 15);
1111 label->setPosition(Vec2(winSize.width/2, winSize.height - 60));
1112 this->addChild(label);
1113
1114 auto blocks = ui::Scale9Sprite::create("Images/blocks9.png");
1115 blocks->setScale9Enabled(false);
1116 blocks->setPosition(Vec2(x, y));
1117 blocks->setPreferredSize(Size(96*2.0f, 96.0f));
1118 blocks->setColor(Color3B::RED);
1119 blocks->setGlobalZOrder(1);
1120 this->addChild(blocks);
1121
1122
1123 auto blocks2 = ui::Scale9Sprite::create("Images/blocks9.png");
1124 blocks2->setScale9Enabled(false);
1125 blocks2->setPosition(Vec2(0.0f, 0.0f));
1126 blocks2->setPreferredSize(Size(96*1.5f, 96.0f));
1127 blocks2->setGlobalZOrder(0);
1128 blocks2->setColor(Color3B::GREEN);
1129 blocks->addChild(blocks2);
1130
1131 auto blocks3 = ui::Scale9Sprite::create("Images/blocks9.png");
1132 blocks3->setScale9Enabled(false);
1133 blocks3->setPosition(Vec2(0.0f, 0.0f));
1134 blocks3->setPreferredSize(Size(96.0f, 96.0f));
1135 blocks3->setGlobalZOrder(2);
1136 blocks3->setColor(Color3B::YELLOW);
1137 blocks2->addChild(blocks3);
1138
1139
1140 return true;
1141 }
1142 return false;
1143}
virtual bool init() override
Definition: UIScene.cpp:46

引用了 UIScene::init().

+ 函数调用图:

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