PuzzleSDK
LabelStrikethrough类 参考

#include <LabelTestNew.h>

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

Public 成员函数

 CREATE_FUNC (LabelStrikethrough)
 
 LabelStrikethrough ()
 
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.h885 行定义.

构造及析构函数说明

◆ LabelStrikethrough()

LabelStrikethrough::LabelStrikethrough ( )

在文件 LabelTestNew.cpp3231 行定义.

3232{
3233 auto s = Director::getInstance()->getWinSize();
3234
3235 // bmfont
3236 _label1a = Label::createWithBMFont("fonts/bitmapFontTest4.fnt", "hello strikethrough\nand multiline", TextHAlignment::LEFT, s.width);
3237 addChild(_label1a, 0, kTagBitmapAtlas1);
3238 _label1a->setPosition(Vec2(s.width/2, s.height*2/3));
3239 // you can enable underline by calling this method
3240 _label1a->enableStrikethrough();
3241
3242 // ttf
3243 TTFConfig ttfConfig("fonts/arial.ttf",24);
3244 ttfConfig.strikethrough = true;
3245 _label2a = Label::createWithTTF(ttfConfig, "hello\nstrikethrough\nwith multiline", TextHAlignment::RIGHT, s.width);
3246 addChild(_label2a, 0, kTagBitmapAtlas2);
3247 _label2a->setPosition(Vec2(s.width/2, s.height*1/3));
3248
3249 auto menuItem = MenuItemFont::create("disable underline", [&](cocos2d::Ref* sender) {
3250 _label2a->disableEffect(LabelEffect::STRIKETHROUGH);
3251 _label1a->disableEffect(LabelEffect::STRIKETHROUGH);
3252 });
3253 menuItem->setFontSizeObj(12);
3254 auto menu = Menu::createWithItem(menuItem);
3255 addChild(menu);
3256 auto winSize = Director::getInstance()->getWinSize();
3257 menu->setPosition(winSize.width * 0.9, winSize.height * 0.25f);
3258}
@ kTagBitmapAtlas2
@ kTagBitmapAtlas1
cocos2d::Label * _label2a
Definition: LabelTestNew.h:895
cocos2d::Label * _label1a
Definition: LabelTestNew.h:894

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

成员函数说明

◆ CREATE_FUNC()

LabelStrikethrough::CREATE_FUNC ( LabelStrikethrough  )

◆ subtitle()

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

重载 TestCase .

在文件 LabelTestNew.cpp3265 行定义.

3266{
3267 return "Strikethrough on TTF and BMfont with multiline";
3268}

◆ title()

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

重载 TestCase .

在文件 LabelTestNew.cpp3260 行定义.

3261{
3262 return "Testing Strikethrough + multiline";
3263}

类成员变量说明

◆ _label1a

cocos2d::Label* LabelStrikethrough::_label1a

在文件 LabelTestNew.h894 行定义.

被这些函数引用 LabelStrikethrough().

◆ _label2a

cocos2d::Label* LabelStrikethrough::_label2a

在文件 LabelTestNew.h895 行定义.

被这些函数引用 LabelStrikethrough().


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