PuzzleSDK
Bug624Layer类 参考

#include <Bug-624.h>

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

Public 成员函数

virtual ~Bug624Layer ()
 
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 (Bug624Layer)
 
- 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.h30 行定义.

构造及析构函数说明

◆ ~Bug624Layer()

Bug624Layer::~Bug624Layer ( )
virtual

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

40{
41 Device::setAccelerometerEnabled(false);
42}

成员函数说明

◆ CREATE_FUNC()

Bug624Layer::CREATE_FUNC ( Bug624Layer  )

◆ init()

bool Bug624Layer::init ( )
overridevirtual

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

45{
46 if(BugsTestBase::init())
47 {
48 auto size = Director::getInstance()->getWinSize();
49 auto label = Label::createWithTTF("Layer1", "fonts/Marker Felt.ttf", 36.0f);
50
51 label->setPosition(size.width/2, size.height/2);
52 addChild(label);
53
54 Device::setAccelerometerEnabled(true);
55 auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(Bug624Layer::onAcceleration, this));
56 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
57
58 schedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer), 5.0f);
59
60 return true;
61 }
62
63 return false;
64}
virtual void onAcceleration(cocos2d::Acceleration *acc, cocos2d::Event *event)
Definition: Bug-624.cpp:75
void switchLayer(float dt)
Definition: Bug-624.cpp:66

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

+ 函数调用图:

◆ onAcceleration()

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

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

76{
77 log("Layer1 accel");
78}

被这些函数引用 init().

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

◆ switchLayer()

void Bug624Layer::switchLayer ( float  dt)

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

67{
68 unschedule(CC_SCHEDULE_SELECTOR(Bug624Layer::switchLayer));
69
70 auto scene = Scene::create();
71 scene->addChild(Bug624Layer2::create(), 0);
72 Director::getInstance()->replaceScene(TransitionFade::create(2.0f, scene, Color3B::WHITE));
73}

引用了 switchLayer().

被这些函数引用 init(), switchLayer() , 以及 Bug624Layer2::switchLayer().

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

◆ title()

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

重载 BugsTestBase .

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

37{ return "Bug624";}

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