PuzzleSDK
OpenURLTest类 参考

#include <OpenURLTest.h>

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

Public 成员函数

 CREATE_FUNC (OpenURLTest)
 
 OpenURLTest ()
 
 ~OpenURLTest ()
 
void onTouchesEnded (const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual std::string title () const
 
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
 

Private 属性

cocos2d::Label * _label
 

额外继承的成员函数

- 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
 

详细描述

在文件 OpenURLTest.h33 行定义.

构造及析构函数说明

◆ OpenURLTest()

OpenURLTest::OpenURLTest ( )

在文件 OpenURLTest.cpp34 行定义.

35{
36 auto label = Label::createWithTTF("Open URL Test", "fonts/arial.ttf", 28);
37 addChild(label, 0);
38 label->setPosition(VisibleRect::center().x, VisibleRect::top().y - 50);
39
40 auto listener = EventListenerTouchAllAtOnce::create();
41 listener->onTouchesEnded = CC_CALLBACK_2(OpenURLTest::onTouchesEnded, this);
42 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
43
44 // create a label to display the tip string
45 _label = Label::createWithTTF("Touch the screen to open\nthe cocos2d-x home page", "fonts/arial.ttf", 22);
46 _label->setPosition(VisibleRect::center());
47 addChild(_label, 0);
48
49 _label->retain();
50}
cocos2d::Label * _label
Definition: OpenURLTest.h:42
void onTouchesEnded(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
Definition: OpenURLTest.cpp:52
static cocos2d::Vec2 top()
Definition: VisibleRect.cpp:57
static cocos2d::Vec2 center()
Definition: VisibleRect.cpp:69

引用了 _label, VisibleRect::center(), onTouchesEnded() , 以及 VisibleRect::top().

+ 函数调用图:

◆ ~OpenURLTest()

OpenURLTest::~OpenURLTest ( )

在文件 OpenURLTest.cpp57 行定义.

58{
59 _label->release();
60}

引用了 _label.

成员函数说明

◆ CREATE_FUNC()

OpenURLTest::CREATE_FUNC ( OpenURLTest  )

◆ onTouchesEnded()

void OpenURLTest::onTouchesEnded ( const std::vector< cocos2d::Touch * > &  touches,
cocos2d::Event *  event 
)

在文件 OpenURLTest.cpp52 行定义.

53{
54 Application::getInstance()->openURL("http://www.cocos2d-x.org/");
55}

被这些函数引用 OpenURLTest().

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

类成员变量说明

◆ _label

cocos2d::Label* OpenURLTest::_label
private

在文件 OpenURLTest.h42 行定义.

被这些函数引用 OpenURLTest() , 以及 ~OpenURLTest().


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