PuzzleSDK
LabelUnderlineMultiline类 参考

#include <LabelTestNew.h>

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

Public 成员函数

 CREATE_FUNC (LabelUnderlineMultiline)
 
 LabelUnderlineMultiline ()
 
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 属性

cocos2d::Label * _label1a
 
cocos2d::Label * _label2a
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 LabelTestNew.h872 行定义.

构造及析构函数说明

◆ LabelUnderlineMultiline()

LabelUnderlineMultiline::LabelUnderlineMultiline ( )

在文件 LabelTestNew.cpp3190 行定义.

3191{
3192 auto s = Director::getInstance()->getWinSize();
3193
3194 // bmfont
3195 _label1a = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "hello underline\nand multiline", TextHAlignment::CENTER, s.width);
3196 addChild(_label1a, 0, kTagBitmapAtlas1);
3197 _label1a->setPosition(Vec2(s.width/2, s.height*2/3));
3198 // you can enable underline by calling this method
3199 _label1a->enableUnderline();
3200
3201 // ttf
3202 TTFConfig ttfConfig("fonts/arial.ttf",24);
3203 ttfConfig.underline = true;
3204 _label2a = Label::createWithTTF(ttfConfig, "hello\nunderline\nwith multiline", TextHAlignment::LEFT, s.width);
3205 addChild(_label2a, 0, kTagBitmapAtlas2);
3206 _label2a->setPosition(Vec2(s.width/2, s.height*1/3));
3207
3208 auto menuItem = MenuItemFont::create("disable underline", [&](cocos2d::Ref* sender) {
3209 _label2a->disableEffect(LabelEffect::UNDERLINE);
3210 _label1a->disableEffect(LabelEffect::UNDERLINE);
3211 });
3212 menuItem->setFontSizeObj(12);
3213 auto menu = Menu::createWithItem(menuItem);
3214 addChild(menu);
3215 auto winSize = Director::getInstance()->getWinSize();
3216 menu->setPosition(winSize.width * 0.9, winSize.height * 0.25f);
3217}
@ kTagBitmapAtlas2
@ kTagBitmapAtlas1
cocos2d::Label * _label2a
Definition: LabelTestNew.h:882
cocos2d::Label * _label1a
Definition: LabelTestNew.h:881

引用了 _label1a, _label2a, kTagBitmapAtlas1 , 以及 kTagBitmapAtlas2.

成员函数说明

◆ CREATE_FUNC()

LabelUnderlineMultiline::CREATE_FUNC ( LabelUnderlineMultiline  )

◆ subtitle()

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

重载 TestCase .

在文件 LabelTestNew.cpp3224 行定义.

3225{
3226 return "Underline on TTF and BMfont with multiline";
3227}

◆ title()

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

重载 TestCase .

在文件 LabelTestNew.cpp3219 行定义.

3220{
3221 return "Testing Underline + multiline";
3222}

类成员变量说明

◆ _label1a

cocos2d::Label* LabelUnderlineMultiline::_label1a

在文件 LabelTestNew.h881 行定义.

被这些函数引用 LabelUnderlineMultiline().

◆ _label2a

cocos2d::Label* LabelUnderlineMultiline::_label2a

在文件 LabelTestNew.h882 行定义.

被这些函数引用 LabelUnderlineMultiline().


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