PuzzleSDK
LabelCharMapColorTest类 参考

#include <LabelTestNew.h>

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

Public 成员函数

 CREATE_FUNC (LabelCharMapColorTest)
 
 LabelCharMapColorTest ()
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
void step (float dt)
 
void actionFinishCallback ()
 
- 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 属性

float _time
 

额外继承的成员函数

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

构造及析构函数说明

◆ LabelCharMapColorTest()

LabelCharMapColorTest::LabelCharMapColorTest ( )

在文件 LabelTestNew.cpp1462 行定义.

1463{
1464 auto label1 = Label::createWithCharMap( "fonts/tuffy_bold_italic-charmap.plist");
1465 addChild(label1, 0, kTagSprite1);
1466 label1->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT);
1467 label1->setPosition( Vec2(10,100) );
1468 label1->setOpacity( 200 );
1469
1470 auto label2 = Label::createWithCharMap("fonts/tuffy_bold_italic-charmap.plist");
1471 addChild(label2, 0, kTagSprite2);
1472 label2->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT);
1473 label2->setPosition( Vec2(10,200) );
1474 label2->setColor( Color3B::RED );
1475
1476 auto fade = FadeOut::create(1.0f);
1477 auto fade_in = fade->reverse();
1478 auto cb = CallFunc::create(CC_CALLBACK_0(LabelCharMapColorTest::actionFinishCallback, this));
1479 auto seq = Sequence::create(fade, fade_in, cb, nullptr);
1480 auto repeat = RepeatForever::create( seq );
1481 label2->runAction( repeat );
1482
1483 _time = 0;
1484
1485 schedule(CC_CALLBACK_1(LabelCharMapColorTest::step, this), "step_key");
1486}
@ kTagSprite2
@ kTagSprite1

引用了 _time, actionFinishCallback(), kTagSprite1, kTagSprite2 , 以及 step().

+ 函数调用图:

成员函数说明

◆ actionFinishCallback()

void LabelCharMapColorTest::actionFinishCallback ( )

在文件 LabelTestNew.cpp1488 行定义.

1489{
1490 CCLOG("Action finished");
1491}

被这些函数引用 LabelCharMapColorTest().

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

◆ CREATE_FUNC()

LabelCharMapColorTest::CREATE_FUNC ( LabelCharMapColorTest  )

◆ step()

void LabelCharMapColorTest::step ( float  dt)

在文件 LabelTestNew.cpp1493 行定义.

1494{
1495 _time += dt;
1496 char string[12] = {0};
1497 sprintf(string, "%2.2f Test", _time);
1498 auto label1 = (Label*)getChildByTag(kTagSprite1);
1499 label1->setString(string);
1500
1501 auto label2 = (Label*)getChildByTag(kTagSprite2);
1502 sprintf(string, "%d", (int)_time);
1503 label2->setString( string );
1504}

引用了 _time, kTagSprite1 , 以及 kTagSprite2.

被这些函数引用 LabelCharMapColorTest().

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

◆ subtitle()

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

重载 TestCase .

在文件 LabelTestNew.cpp1511 行定义.

1512{
1513 return "Opacity + Color should work at the same time";
1514}

◆ title()

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

重载 TestCase .

在文件 LabelTestNew.cpp1506 行定义.

1507{
1508 return "New Label + CharMap";
1509}

类成员变量说明

◆ _time

float LabelCharMapColorTest::_time
private

在文件 LabelTestNew.h397 行定义.

被这些函数引用 LabelCharMapColorTest() , 以及 step().


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