#include <NewRendererTest.h>
◆ CaptureNodeTest()
| CaptureNodeTest::CaptureNodeTest |
( |
| ) |
|
|
protected |
在文件 NewRendererTest.cpp 第 690 行定义.
692 Size s = Director::getInstance()->getWinSize();
693 Vec2 left(s.width / 4, s.height / 2);
694 Vec2 right(s.width / 4 * 3, s.height / 2);
696 auto sp1 = Sprite::create(
"Images/grossini.png");
697 sp1->setPosition(left);
698 auto move1 = MoveBy::create(1, Vec2(s.width / 2, 0.0f));
699 auto seq1 = RepeatForever::create(Sequence::create(move1, move1->reverse(),
nullptr));
701 sp1->runAction(seq1);
702 auto sp2 = Sprite::create(
"Images/grossinis_sister1.png");
703 sp2->setPosition(right);
704 auto move2 = MoveBy::create(1, Vec2(-s.width / 2, 0.0f));
705 auto seq2 = RepeatForever::create(Sequence::create(move2, move2->reverse(),
nullptr));
707 sp2->runAction(seq2);
709 auto label1 = Label::createWithTTF(TTFConfig(
"fonts/arial.ttf"),
"capture this scene");
711 auto menu = Menu::create(mi1,
nullptr);
713 menu->setPosition(s.width / 2, s.height / 4);
void onCaptured(cocos2d::Ref *)
引用了 _filename , 以及 onCaptured().
◆ ~CaptureNodeTest()
| CaptureNodeTest::~CaptureNodeTest |
( |
| ) |
|
|
protected |
◆ CREATE_FUNC()
◆ onCaptured()
| void CaptureNodeTest::onCaptured |
( |
cocos2d::Ref * |
| ) |
|
|
protected |
在文件 NewRendererTest.cpp 第 733 行定义.
735 Director::getInstance()->getTextureCache()->removeTextureForKey(
_filename);
738 _filename = FileUtils::getInstance()->getWritablePath() +
"/CaptureNodeTest.png";
741 auto callback = [&](Image* image){
743 auto sp = Sprite::createWithTexture(Director::getInstance()->getTextureCache()->addImage(image,
_filename));
745 Size s = Director::getInstance()->getWinSize();
746 sp->setPosition(s.width / 2, s.height / 2);
755 auto callbackFunction = std::bind(callback, std::placeholders::_1);
756 utils::captureNode(
this, callbackFunction, 0.5);
static const int childTag
引用了 _filename , 以及 childTag.
被这些函数引用 CaptureNodeTest().
◆ subtitle()
| std::string CaptureNodeTest::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string CaptureNodeTest::title |
( |
| ) |
const |
|
overridevirtual |
◆ _filename
| std::string CaptureNodeTest::_filename |
|
protected |
◆ childTag
| const int CaptureNodeTest::childTag = 120 |
|
staticprivate |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp