#include <DataVisitorTest.h>
◆ addSprite()
| void PrettyPrinterDemo::addSprite |
( |
| ) |
|
在文件 DataVisitorTest.cpp 第 44 行定义.
48 auto s1 = Sprite::create(
"Images/grossini.png");
49 auto s2 = Sprite::create(
"Images/grossini_dance_01.png");
50 auto s3 = Sprite::create(
"Images/grossini_dance_02.png");
51 auto s4 = Sprite::create(
"Images/grossini_dance_03.png");
52 auto s5 = Sprite::create(
"Images/grossini_dance_04.png");
54 s1->setPosition(50, 50);
55 s2->setPosition(60, 50);
56 s3->setPosition(70, 50);
57 s4->setPosition(80, 50);
58 s5->setPosition(90, 50);
被这些函数引用 onEnter().
◆ CREATE_FUNC()
◆ onEnter()
| void PrettyPrinterDemo::onEnter |
( |
| ) |
|
|
overridevirtual |
重载 TestCase .
在文件 DataVisitorTest.cpp 第 67 行定义.
70 auto s = Director::getInstance()->getWinSize();
72 auto label = Label::createWithTTF(
title().c_str(),
"fonts/arial.ttf", 28);
73 label->setPosition(s.width/2, s.height * 4/5);
74 this->addChild(label, 1);
76 std::string strSubtitle =
subtitle();
77 if(strSubtitle.empty() ==
false)
79 auto subLabel = Label::createWithTTF(strSubtitle.c_str(),
"fonts/Thonburi.ttf", 16);
80 subLabel->setPosition(s.width/2, s.height * 3/5);
81 this->addChild(subLabel, 1);
virtual std::string title() const override
virtual std::string subtitle() const override
virtual void onEnter() override
引用了 addSprite(), TestCase::onEnter(), subtitle() , 以及 title().
◆ subtitle()
| std::string PrettyPrinterDemo::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string PrettyPrinterDemo::title |
( |
| ) |
const |
|
overridevirtual |
◆ _title
| std::string PrettyPrinterDemo::_title |
|
protected |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp