PuzzleSDK
LabelOutlineAndGlowTest类 参考

#include <LabelTestNew.h>

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

Public 成员函数

 CREATE_FUNC (LabelOutlineAndGlowTest)
 
 LabelOutlineAndGlowTest ()
 
virtual std::string title () const override
 
virtual std::string subtitle () 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
 
virtual void onEnter () override
 

额外继承的成员函数

- 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
 

详细描述

在文件 LabelTestNew.h337 行定义.

构造及析构函数说明

◆ LabelOutlineAndGlowTest()

LabelOutlineAndGlowTest::LabelOutlineAndGlowTest ( )

在文件 LabelTestNew.cpp1272 行定义.

1273{
1274 auto size = Director::getInstance()->getWinSize();
1275
1276 auto bg = LayerColor::create(Color4B(200,191,231,255));
1277 this->addChild(bg);
1278
1279 TTFConfig ttfConfig("fonts/arial.ttf", 40, GlyphCollection::DYNAMIC,nullptr,true);
1280
1281 auto label1 = Label::createWithTTF(ttfConfig,"Glow", TextHAlignment::CENTER, size.width);
1282 label1->setPosition( Vec2(size.width/2, size.height*0.7) );
1283 label1->setTextColor( Color4B::GREEN );
1284 label1->enableGlow(Color4B::YELLOW);
1285 addChild(label1);
1286
1287 ttfConfig.outlineSize = 1;
1288 auto label2 = Label::createWithTTF(ttfConfig,"Outline", TextHAlignment::CENTER, size.width);
1289 label2->setPosition( Vec2(size.width/2, size.height*0.6) );
1290 label2->setTextColor( Color4B::RED );
1291 label2->enableOutline(Color4B::BLUE);
1292 addChild(label2);
1293
1294 ttfConfig.outlineSize = 2;
1295 auto label3 = Label::createWithTTF(ttfConfig,"Outline", TextHAlignment::CENTER, size.width);
1296 label3->setPosition( Vec2(size.width/2, size.height*0.48) );
1297 label3->setTextColor( Color4B::RED );
1298 label3->enableOutline(Color4B::BLUE);
1299 addChild(label3);
1300
1301 ttfConfig.outlineSize = 3;
1302 auto label4 = Label::createWithTTF(ttfConfig,"Outline", TextHAlignment::CENTER, size.width);
1303 label4->setPosition( Vec2(size.width/2, size.height*0.36) );
1304 label4->setTextColor( Color4B::RED );
1305 label4->enableOutline(Color4B::BLUE);
1306 addChild(label4);
1307}

成员函数说明

◆ CREATE_FUNC()

LabelOutlineAndGlowTest::CREATE_FUNC ( LabelOutlineAndGlowTest  )

◆ subtitle()

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

重载 TestCase .

在文件 LabelTestNew.cpp1314 行定义.

1315{
1316 return "Testing outline and glow of label";
1317}

◆ title()

std::string LabelOutlineAndGlowTest::title ( ) const
overridevirtual

重载 TestCase .

在文件 LabelTestNew.cpp1309 行定义.

1310{
1311 return "New Label + .TTF";
1312}

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