PuzzleSDK
LabelFNTandTTFEmpty类 参考

#include <LabelTestNew.h>

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

Public 成员函数

 CREATE_FUNC (LabelFNTandTTFEmpty)
 
 LabelFNTandTTFEmpty ()
 
void updateStrings (float dt)
 
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
 

Private 属性

bool setEmpty
 

额外继承的成员函数

- 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.h130 行定义.

构造及析构函数说明

◆ LabelFNTandTTFEmpty()

LabelFNTandTTFEmpty::LabelFNTandTTFEmpty ( )

在文件 LabelTestNew.cpp458 行定义.

459{
460 auto s = Director::getInstance()->getWinSize();
461
462 // LabelBMFont
463 auto label1 = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "", TextHAlignment::CENTER, s.width);
464 addChild(label1, 0, kTagBitmapAtlas1);
465 label1->setPosition(Vec2(s.width/2, s.height - 100));
466
467 // LabelTTF
468 TTFConfig ttfConfig("fonts/arial.ttf",24);
469 auto label2 = Label::createWithTTF(ttfConfig,"", TextHAlignment::CENTER,s.width);
470 addChild(label2, 0, kTagBitmapAtlas2);
471 label2->setPosition(Vec2(s.width/2, s.height / 2));
472
473 auto label3 = Label::createWithCharMap("fonts/tuffy_bold_italic-charmap.plist");
474 addChild(label3, 0, kTagBitmapAtlas3);
475 label3->setPosition(Vec2(s.width/2, 100.0f));
476
477 schedule(CC_CALLBACK_1(LabelFNTandTTFEmpty::updateStrings, this), 1.0f, "update_strings_key");
478
479 setEmpty = false;
480}
@ kTagBitmapAtlas3
@ kTagBitmapAtlas2
@ kTagBitmapAtlas1
void updateStrings(float dt)

引用了 kTagBitmapAtlas1, kTagBitmapAtlas2, kTagBitmapAtlas3, setEmpty , 以及 updateStrings().

+ 函数调用图:

成员函数说明

◆ CREATE_FUNC()

LabelFNTandTTFEmpty::CREATE_FUNC ( LabelFNTandTTFEmpty  )

◆ subtitle()

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

重载 TestCase .

在文件 LabelTestNew.cpp511 行定义.

512{
513 return "Testing empty string.";
514}

◆ title()

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

重载 TestCase .

在文件 LabelTestNew.cpp506 行定义.

507{
508 return "New Label + FNT/TTF/CharMap";
509}

◆ updateStrings()

void LabelFNTandTTFEmpty::updateStrings ( float  dt)

在文件 LabelTestNew.cpp482 行定义.

483{
484 auto label1 = static_cast<Label*>( getChildByTag(kTagBitmapAtlas1) );
485 auto label2 = static_cast<Label*>( getChildByTag(kTagBitmapAtlas2) );
486 auto label3 = static_cast<Label*>( getChildByTag(kTagBitmapAtlas3) );
487
488 if( ! setEmpty )
489 {
490 label1->setString("not empty");
491 label2->setString("not empty");
492 label3->setString("hi");
493
494 setEmpty = true;
495 }
496 else
497 {
498 label1->setString("");
499 label2->setString("");
500 label3->setString("");
501
502 setEmpty = false;
503 }
504}

引用了 kTagBitmapAtlas1, kTagBitmapAtlas2, kTagBitmapAtlas3 , 以及 setEmpty.

被这些函数引用 LabelFNTandTTFEmpty().

+ 这是这个函数的调用关系图:

类成员变量说明

◆ setEmpty

bool LabelFNTandTTFEmpty::setEmpty
private

在文件 LabelTestNew.h141 行定义.

被这些函数引用 LabelFNTandTTFEmpty() , 以及 updateStrings().


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