PuzzleSDK
Bug1159Layer类 参考

#include <Bug-1159.h>

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

Public 成员函数

virtual bool init () override
 
virtual void onExit () override
 
virtual std::string title () const override
 
void callBack (cocos2d::Ref *sender)
 
 CREATE_FUNC (Bug1159Layer)
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual std::string subtitle () const
 
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 类型 继承自 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
 

详细描述

在文件 Bug-1159.h30 行定义.

成员函数说明

◆ callBack()

void Bug1159Layer::callBack ( cocos2d::Ref *  sender)

在文件 Bug-1159.cpp66 行定义.

67{
68 Director::getInstance()->replaceScene(TransitionPageTurn::create(1.0f, Bug1159Layer::create(), false));
69}

被这些函数引用 init().

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

◆ CREATE_FUNC()

Bug1159Layer::CREATE_FUNC ( Bug1159Layer  )

◆ init()

bool Bug1159Layer::init ( )
overridevirtual

在文件 Bug-1159.cpp29 行定义.

30{
31 if (BugsTestBase::init())
32 {
33 auto s = Director::getInstance()->getWinSize();
34
35 auto background = LayerColor::create(Color4B(255, 0, 255, 255));
36 addChild(background);
37
38 auto sprite_a = LayerColor::create(Color4B(255, 0, 0, 255), 700, 700);
39 sprite_a->setAnchorPoint(Vec2(0.5f, 0.5f));
40 sprite_a->setIgnoreAnchorPointForPosition(false);
41 sprite_a->setPosition(0.0f, s.height/2);
42 addChild(sprite_a);
43
44 sprite_a->runAction(RepeatForever::create(Sequence::create(
45 MoveTo::create(1.0f, Vec2(1024.0f, 384.0f)),
46 MoveTo::create(1.0f, Vec2(0.0f, 384.0f)),
47 nullptr)));
48
49 auto sprite_b = LayerColor::create(Color4B(0, 0, 255, 255), 400, 400);
50 sprite_b->setAnchorPoint(Vec2(0.5f, 0.5f));
51 sprite_b->setIgnoreAnchorPointForPosition(false);
52 sprite_b->setPosition(s.width/2, s.height/2);
53 addChild(sprite_b);
54
55 auto label = MenuItemLabel::create(Label::createWithSystemFont("Flip Me", "Helvetica", 24), CC_CALLBACK_1(Bug1159Layer::callBack, this) );
56 auto menu = Menu::create(label, nullptr);
57 menu->setPosition(s.width - 200.0f, 50.0f);
58 addChild(menu);
59
60 return true;
61 }
62
63 return false;
64}
void callBack(cocos2d::Ref *sender)
Definition: Bug-1159.cpp:66

引用了 callBack().

+ 函数调用图:

◆ onExit()

void Bug1159Layer::onExit ( )
overridevirtual

在文件 Bug-1159.cpp71 行定义.

72{
73 BugsTestBase::onExit();
74}

◆ title()

virtual std::string Bug1159Layer::title ( ) const
inlineoverridevirtual

重载 BugsTestBase .

在文件 Bug-1159.h35 行定义.

35{ return "Bug1159";}

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