PuzzleSDK
SceneTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
3
4 http://www.cocos2d-x.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 THE SOFTWARE.
23 ****************************************************************************/
24
25#ifndef _SCENE_TEST_H_
26#define _SCENE_TEST_H_
27
29#include "../BaseTest.h"
30
32
33class SceneTestLayer1 : public cocos2d::Layer
34{
35public:
37
40
41 virtual void onEnter() override;
42 virtual void onEnterTransitionDidFinish() override;
43
44 void testDealloc(float dt);
45 void onPushScene(cocos2d::Ref* sender);
46 void onPushSceneTran(cocos2d::Ref* sender);
47 void onQuit(cocos2d::Ref* sender);
48} ;
49
50class SceneTestLayer2 : public cocos2d::Layer
51{
53public:
55
57
58 void testDealloc(float dt);
59 void onGoBack(cocos2d::Ref* sender);
60 void onReplaceScene(cocos2d::Ref* sender);
61 void onReplaceSceneTran(cocos2d::Ref* sender);
62} ;
63
64class SceneTestLayer3 : public cocos2d::LayerColor
65{
66public:
68
70
71 virtual bool init() override;
72 virtual void testDealloc(float dt);
73 void item0Clicked(cocos2d::Ref* sender);
74 void item1Clicked(cocos2d::Ref* sender);
75 void item2Clicked(cocos2d::Ref* sender);
76 void item3Clicked(cocos2d::Ref* sender);
77} ;
78
80{
81public:
82 static SceneTestScene* create(int testIndex = 1);
83};
84
85#endif
DEFINE_TEST_SUITE(SceneTests)
virtual void onEnterTransitionDidFinish() override
Definition: SceneTest.cpp:83
void testDealloc(float dt)
Definition: SceneTest.cpp:72
void onQuit(cocos2d::Ref *sender)
Definition: SceneTest.cpp:107
void onPushSceneTran(cocos2d::Ref *sender)
Definition: SceneTest.cpp:100
CREATE_FUNC(SceneTestLayer1)
void onPushScene(cocos2d::Ref *sender)
Definition: SceneTest.cpp:94
virtual void onEnter() override
Definition: SceneTest.cpp:77
void onReplaceSceneTran(cocos2d::Ref *sender)
Definition: SceneTest.cpp:166
void onReplaceScene(cocos2d::Ref *sender)
Definition: SceneTest.cpp:160
void onGoBack(cocos2d::Ref *sender)
Definition: SceneTest.cpp:155
void testDealloc(float dt)
Definition: SceneTest.cpp:148
CREATE_FUNC(SceneTestLayer2)
float _timeCounter
Definition: SceneTest.h:52
virtual bool init() override
Definition: SceneTest.cpp:183
void item1Clicked(cocos2d::Ref *sender)
Definition: SceneTest.cpp:224
void item3Clicked(cocos2d::Ref *sender)
Definition: SceneTest.cpp:234
virtual void testDealloc(float dt)
Definition: SceneTest.cpp:211
void item0Clicked(cocos2d::Ref *sender)
Definition: SceneTest.cpp:216
void item2Clicked(cocos2d::Ref *sender)
Definition: SceneTest.cpp:229
CREATE_FUNC(SceneTestLayer3)
static SceneTestScene * create(int testIndex=1)
Definition: SceneTest.cpp:239