PuzzleSDK
TransitionsTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2012 cocos2d-x.org
3 Copyright (c) 2013-2016 Chukong Technologies Inc.
4 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
5
6 http://www.cocos2d-x.org
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE SOFTWARE.
25 ****************************************************************************/
26
27#ifndef _TRANSITIONS_TEST_H_
28#define _TRANSITIONS_TEST_H_
29
30#include "../BaseTest.h"
31
32
33DEFINE_TEST_SUITE(TransitionsTests);
34
36{
37public:
39};
40
41class TestLayer1 : public cocos2d::Layer
42{
43public:
44 static TestLayer1* create(const std::string& transitionName);
45
46 TestLayer1(const std::string& transitionName);
48
49 void step(float dt);
50
51 virtual void onEnter() override;
52 virtual void onEnterTransitionDidFinish() override;
53 virtual void onExitTransitionDidStart() override;
54 virtual void onExit() override;
55};
56
57class TestLayer2 : public cocos2d::Layer
58{
59public:
60 static TestLayer2* create(const std::string& transitionName);
61
62 TestLayer2(const std::string& transitionName);
64
65 void step(float dt);
66
67 virtual void onEnter() override;
68 virtual void onEnterTransitionDidFinish() override;
69 virtual void onExitTransitionDidStart() override;
70 virtual void onExit() override;
71};
72
73#endif
DEFINE_TEST_SUITE(TransitionsTests)
static TestLayer1 * create(const std::string &transitionName)
virtual void onExitTransitionDidStart() override
void step(float dt)
virtual void onExit() override
virtual void onEnter() override
virtual void onEnterTransitionDidFinish() override
TestLayer1(const std::string &transitionName)
virtual void onExit() override
virtual void onExitTransitionDidStart() override
virtual void onEnter() override
static TestLayer2 * create(const std::string &transitionName)
virtual void onEnterTransitionDidFinish() override
TestLayer2(const std::string &transitionName)
void step(float dt)
CREATE_FUNC(TransitionsTest)