PuzzleSDK
Bug624Layer2类 参考

#include <Bug-624.h>

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

Public 成员函数

virtual ~Bug624Layer2 ()
 
virtual bool init () override
 
void switchLayer (float dt)
 
virtual void onAcceleration (cocos2d::Acceleration *acc, cocos2d::Event *event)
 
virtual std::string title () const override
 
 CREATE_FUNC (Bug624Layer2)
 
- 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-624.h42 行定义.

构造及析构函数说明

◆ ~Bug624Layer2()

Bug624Layer2::~Bug624Layer2 ( )
virtual

在文件 Bug-624.cpp85 行定义.

86{
87 Device::setAccelerometerEnabled(false);
88}

成员函数说明

◆ CREATE_FUNC()

Bug624Layer2::CREATE_FUNC ( Bug624Layer2  )

◆ init()

bool Bug624Layer2::init ( )
overridevirtual

在文件 Bug-624.cpp90 行定义.

91{
92 if(BugsTestBase::init())
93 {
94 auto size = Director::getInstance()->getWinSize();
95 auto label = Label::createWithTTF("Layer2", "fonts/Marker Felt.ttf", 36.0f);
96
97 label->setPosition(size.width/2, size.height/2);
98 addChild(label);
99
100 Device::setAccelerometerEnabled(true);
101 auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(Bug624Layer2::onAcceleration, this));
102 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
103
104
105 schedule(CC_SCHEDULE_SELECTOR(Bug624Layer2::switchLayer), 5.0f);
106
107 return true;
108 }
109
110 return false;
111}
void switchLayer(float dt)
Definition: Bug-624.cpp:113
virtual void onAcceleration(cocos2d::Acceleration *acc, cocos2d::Event *event)
Definition: Bug-624.cpp:122

引用了 onAcceleration() , 以及 switchLayer().

+ 函数调用图:

◆ onAcceleration()

void Bug624Layer2::onAcceleration ( cocos2d::Acceleration *  acc,
cocos2d::Event *  event 
)
virtual

在文件 Bug-624.cpp122 行定义.

123{
124 log("Layer2 accel");
125}

被这些函数引用 init().

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

◆ switchLayer()

void Bug624Layer2::switchLayer ( float  dt)

在文件 Bug-624.cpp113 行定义.

114{
115 unschedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer));
116
117 auto scene = Scene::create();
118 scene->addChild(Bug624Layer::create(), 0);
119 Director::getInstance()->replaceScene(TransitionFade::create(2.0f, scene, Color3B::RED));
120}
void switchLayer(float dt)
Definition: Bug-624.cpp:66

引用了 Bug624Layer::switchLayer().

被这些函数引用 init().

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

◆ title()

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

重载 BugsTestBase .

在文件 Bug-624.h49 行定义.

49{ return "Bug624-2";}

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