PuzzleSDK
LabelSystemFontColor类 参考

#include <LabelTestNew.h>

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

Public 成员函数

 CREATE_FUNC (LabelSystemFontColor)
 
 LabelSystemFontColor ()
 
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.h561 行定义.

构造及析构函数说明

◆ LabelSystemFontColor()

LabelSystemFontColor::LabelSystemFontColor ( )

在文件 LabelTestNew.cpp1939 行定义.

1940{
1941 auto size = Director::getInstance()->getWinSize();
1942
1943 auto label1 = Label::createWithSystemFont("Color4B::Red", "fonts/arial.ttf", 20);
1944 label1->setPosition(Vec2(size.width / 2, size.height * 0.3f));
1945 label1->setTextColor(Color4B::RED);
1946 addChild(label1);
1947
1948 auto label2 = Label::createWithSystemFont("Color4B::Green", "fonts/arial.ttf", 20);
1949 label2->setPosition(Vec2(size.width / 2, size.height * 0.4f));
1950 label2->setTextColor(Color4B::GREEN);
1951 addChild(label2);
1952
1953 auto label3 = Label::createWithSystemFont("Color4B::Blue", "fonts/arial.ttf", 20);
1954 label3->setPosition(Vec2(size.width / 2, size.height * 0.5f));
1955 label3->setTextColor(Color4B::BLUE);
1956 addChild(label3);
1957
1958 auto label4 = Label::createWithSystemFont("Color4B(0, 0, 255, 100)", "fonts/arial.ttf", 20);
1959 label4->setPosition(Vec2(size.width / 2, size.height * 0.6f));
1960 label4->setTextColor(Color4B(0, 0, 255, 100));
1961 addChild(label4);
1962}

成员函数说明

◆ CREATE_FUNC()

LabelSystemFontColor::CREATE_FUNC ( LabelSystemFontColor  )

◆ subtitle()

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

重载 TestCase .

在文件 LabelTestNew.cpp1969 行定义.

1970{
1971 return "Testing text color of system font";
1972}

◆ title()

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

重载 TestCase .

在文件 LabelTestNew.cpp1964 行定义.

1965{
1966 return "New Label + system font";
1967}

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