PuzzleSDK
Bug458Layer类 参考

#include <Bug-458.h>

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

Public 成员函数

 CREATE_FUNC (Bug458Layer)
 
virtual bool init () override
 
void selectAnswer (cocos2d::Ref *sender)
 
- Public 成员函数 继承自 BugsTestBase
virtual std::string title () const override
 
- 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-458.h30 行定义.

成员函数说明

◆ CREATE_FUNC()

Bug458Layer::CREATE_FUNC ( Bug458Layer  )

◆ init()

bool Bug458Layer::init ( )
overridevirtual

在文件 Bug-458.cpp35 行定义.

36{
37 if(BugsTestBase::init())
38 {
39 // ask director the the window size
40 auto size = Director::getInstance()->getWinSize();
41
42 auto question = new (std::nothrow) QuestionContainerSprite();
43 auto question2 = new (std::nothrow) QuestionContainerSprite();
44 question->init();
45 question2->init();
46
47// [question setContentSize:CGSizeMake(50,50)];
48// [question2 setContentSize:CGSizeMake(50,50)];
49
50 auto sprite = MenuItemSprite::create(question2, question, CC_CALLBACK_1(Bug458Layer::selectAnswer, this) );
51 auto layer = LayerColor::create(Color4B(0,0,255,255), 100, 100);
52 question->release();
53 question2->release();
54
55 auto layer2 = LayerColor::create(Color4B(255,0,0,255), 100, 100);
56 auto sprite2 = MenuItemSprite::create(layer, layer2, CC_CALLBACK_1(Bug458Layer::selectAnswer, this) );
57 auto menu = Menu::create(sprite, sprite2, nullptr);
58 menu->alignItemsVerticallyWithPadding(100);
59 menu->setPosition(size.width / 2, size.height / 2);
60
61 // add the label as a child to this Layer
62 addChild(menu);
63
64 return true;
65 }
66 return false;
67}
void selectAnswer(cocos2d::Ref *sender)
Definition: Bug-458.cpp:69
virtual bool init() override

引用了 QuestionContainerSprite::init() , 以及 selectAnswer().

+ 函数调用图:

◆ selectAnswer()

void Bug458Layer::selectAnswer ( cocos2d::Ref *  sender)

在文件 Bug-458.cpp69 行定义.

70{
71 log("Selected");
72}

被这些函数引用 init().

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

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