2011-03-19 10:59:01 +08:00
|
|
|
/****************************************************************************
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2009-2010 Ricardo Quesada
|
2012-09-24 21:22:20 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2011-07-01 11:26:26 +08:00
|
|
|
Copyright (c) 2011 Zynga Inc.
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2011-03-19 10:59:01 +08:00
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __CCTRANSITION_H__
|
|
|
|
#define __CCTRANSITION_H__
|
|
|
|
|
2014-05-01 10:09:13 +08:00
|
|
|
#include "2d/CCScene.h"
|
2012-04-18 18:43:45 +08:00
|
|
|
|
|
|
|
NS_CC_BEGIN
|
2011-03-19 10:59:01 +08:00
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
/**
|
2015-03-24 10:34:41 +08:00
|
|
|
* @addtogroup _2d
|
2012-06-20 18:09:11 +08:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
// static creation function macro
|
|
|
|
// c/c++ don't support object creation of using class name
|
|
|
|
// so, all classes need creation method.
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
class ActionInterval;
|
|
|
|
class Node;
|
2013-12-16 14:21:05 +08:00
|
|
|
class NodeGrid;
|
2011-03-19 10:59:01 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionEaseScene
|
|
|
|
* @brief TransitionEaseScene can ease the actions of the scene protocol.
|
2010-07-08 18:11:08 +08:00
|
|
|
@since v0.8.2
|
2015-03-23 20:27:13 +08:00
|
|
|
@js NA
|
2010-07-08 18:11:08 +08:00
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionEaseScene // : public Ref
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-09-28 12:14:12 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Constructor.
|
|
|
|
*/
|
2013-11-20 08:57:23 +08:00
|
|
|
virtual ~TransitionEaseScene() {}
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Returns the Ease action that will be performed on a linear action.
|
2012-04-19 14:35:52 +08:00
|
|
|
@since v0.8.2
|
2015-03-21 18:02:56 +08:00
|
|
|
*
|
|
|
|
* @param action A given interval action.
|
|
|
|
* @return The Ease action that will be performed on a linear action.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) = 0;
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
2011-03-19 10:59:01 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionScene
|
|
|
|
* @brief Base class for Transition scenes.
|
2021-12-25 10:04:45 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionScene : public Scene
|
2011-03-19 10:59:01 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Orientation Type used by some transitions.
|
2013-07-25 20:50:39 +08:00
|
|
|
*/
|
2013-07-26 05:49:43 +08:00
|
|
|
enum class Orientation
|
2013-07-25 20:50:39 +08:00
|
|
|
{
|
|
|
|
/// An horizontal orientation where the Left is nearer
|
2013-07-26 05:49:43 +08:00
|
|
|
LEFT_OVER = 0,
|
2013-07-25 20:50:39 +08:00
|
|
|
/// An horizontal orientation where the Right is nearer
|
2013-07-26 05:49:43 +08:00
|
|
|
RIGHT_OVER = 1,
|
2013-07-25 20:50:39 +08:00
|
|
|
/// A vertical orientation where the Up is nearer
|
2013-07-26 05:49:43 +08:00
|
|
|
UP_OVER = 0,
|
2013-07-25 20:50:39 +08:00
|
|
|
/// A vertical orientation where the Bottom is nearer
|
2013-07-26 05:49:43 +08:00
|
|
|
DOWN_OVER = 1,
|
2013-07-25 20:50:39 +08:00
|
|
|
};
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a base transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionScene object.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
static TransitionScene* create(float t, Scene* scene);
|
2010-07-08 18:11:08 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Called after the transition finishes.
|
|
|
|
*/
|
2019-07-22 09:38:46 +08:00
|
|
|
void finish();
|
2010-07-08 18:11:08 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Used by some transitions to hide the outer scene.
|
|
|
|
*/
|
2019-07-22 09:38:46 +08:00
|
|
|
void hideOutShowIn();
|
2011-03-19 10:59:01 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
Scene* getInScene() const { return _inScene; }
|
2015-04-03 11:49:15 +08:00
|
|
|
float getDuration() const { return _duration; }
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual void cleanup() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionScene();
|
2013-11-15 08:21:49 +08:00
|
|
|
virtual ~TransitionScene();
|
2014-03-21 13:44:29 +08:00
|
|
|
|
2013-11-15 08:21:49 +08:00
|
|
|
/** initializes a transition with duration and incoming scene */
|
2021-12-25 10:04:45 +08:00
|
|
|
bool initWithDuration(float t, Scene* scene);
|
|
|
|
|
2014-03-21 13:44:29 +08:00
|
|
|
protected:
|
2013-11-15 08:21:49 +08:00
|
|
|
virtual void sceneOrder();
|
2012-06-08 13:55:28 +08:00
|
|
|
void setNewScene(float dt);
|
2011-03-19 10:59:01 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
Scene* _inScene;
|
|
|
|
Scene* _outScene;
|
2013-11-23 07:07:58 +08:00
|
|
|
float _duration;
|
|
|
|
bool _isInSceneOnTop;
|
|
|
|
bool _isSendCleanupToScene;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionScene);
|
2011-03-19 10:59:01 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionSceneOriented
|
|
|
|
* @brief A Transition that supports orientation like.
|
|
|
|
* Possible orientation: LeftOver, RightOver, UpOver, DownOver
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionSceneOriented : public TransitionScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration, incoming scene and orientation.
|
2021-12-25 10:04:45 +08:00
|
|
|
*
|
2015-03-21 18:02:56 +08:00
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @param orientation A given orientation: LeftOver, RightOver, UpOver, DownOver.
|
|
|
|
* @return A autoreleased TransitionSceneOriented object.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
static TransitionSceneOriented* create(float t, Scene* scene, Orientation orientation);
|
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSceneOriented();
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual ~TransitionSceneOriented();
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
/** initializes a transition with duration and incoming scene */
|
2021-12-25 10:04:45 +08:00
|
|
|
bool initWithDuration(float t, Scene* scene, Orientation orientation);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
2014-03-21 13:44:29 +08:00
|
|
|
protected:
|
2013-07-25 20:50:39 +08:00
|
|
|
Orientation _orientation;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented);
|
2011-03-19 10:59:01 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionRotoZoom
|
|
|
|
* @brief TransitionRotoZoom:
|
2021-12-25 10:04:45 +08:00
|
|
|
Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming
|
2010-07-08 18:11:08 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionRotoZoom : public TransitionScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionRotoZoom object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionRotoZoom* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionRotoZoom();
|
2013-11-15 08:21:49 +08:00
|
|
|
virtual ~TransitionRotoZoom();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionRotoZoom);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionJumpZoom
|
|
|
|
* @brief TransitionJumpZoom:
|
2021-12-25 10:04:45 +08:00
|
|
|
Zoom out and jump the outgoing scene, and then jump and zoom in the incoming
|
2010-07-08 18:11:08 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionJumpZoom : public TransitionScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionJumpZoom object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionJumpZoom* create(float t, Scene* scene);
|
2010-08-20 14:35:37 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionJumpZoom();
|
2013-11-15 08:21:49 +08:00
|
|
|
virtual ~TransitionJumpZoom();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionMoveInL
|
|
|
|
* @brief TransitionMoveInL:
|
2010-07-08 18:11:08 +08:00
|
|
|
Move in from to the left the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionMoveInL object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionMoveInL* create(float t, Scene* scene);
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
/** Returns the action that will be performed.
|
|
|
|
*
|
2015-03-21 18:02:56 +08:00
|
|
|
* @return The action that will be performed.
|
|
|
|
*/
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual ActionInterval* action();
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionMoveInL();
|
2013-11-15 08:21:49 +08:00
|
|
|
virtual ~TransitionMoveInL();
|
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2013-11-23 07:07:58 +08:00
|
|
|
/** initializes the scenes */
|
|
|
|
virtual void initScenes();
|
|
|
|
|
2013-11-15 08:21:49 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionMoveInR
|
|
|
|
* @brief TransitionMoveInR:
|
2010-07-08 18:11:08 +08:00
|
|
|
Move in from to the right the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionMoveInR : public TransitionMoveInL
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionMoveInR object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionMoveInR* create(float t, Scene* scene);
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionMoveInR();
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~TransitionMoveInR();
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual void initScenes();
|
|
|
|
|
2013-11-15 08:21:49 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionMoveInT
|
|
|
|
* @brief TransitionMoveInT:
|
2010-07-08 18:11:08 +08:00
|
|
|
Move in from to the top the incoming scene.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionMoveInT : public TransitionMoveInL
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionMoveInT object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionMoveInT* create(float t, Scene* scene);
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionMoveInT();
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~TransitionMoveInT();
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual void initScenes();
|
|
|
|
|
2013-11-15 08:21:49 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionMoveInB
|
|
|
|
* @brief TransitionMoveInB:
|
2010-07-08 18:11:08 +08:00
|
|
|
Move in from to the bottom the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionMoveInB : public TransitionMoveInL
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionMoveInB object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionMoveInB* create(float t, Scene* scene);
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionMoveInB();
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~TransitionMoveInB();
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual void initScenes();
|
|
|
|
|
2013-11-15 08:21:49 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionSlideInL
|
|
|
|
* @brief TransitionSlideInL:
|
2010-07-08 18:11:08 +08:00
|
|
|
Slide in the incoming scene from the left border.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSlideInL object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionSlideInL* create(float t, Scene* scene);
|
2010-07-09 18:24:08 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2013-07-16 03:43:22 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Returns the action that will be performed by the incoming and outgoing scene.
|
|
|
|
*
|
|
|
|
* @return The action that will be performed by the incoming and outgoing scene.
|
|
|
|
*/
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual ActionInterval* action();
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSlideInL();
|
2013-11-15 08:21:49 +08:00
|
|
|
virtual ~TransitionSlideInL();
|
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2013-11-23 07:07:58 +08:00
|
|
|
/** initializes the scenes */
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual void initScenes();
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void sceneOrder() override;
|
2013-11-15 08:21:49 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionSlideInR
|
|
|
|
*@brief TransitionSlideInR:
|
2010-07-08 18:11:08 +08:00
|
|
|
Slide in the incoming scene from the right border.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionSlideInR : public TransitionSlideInL
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSlideInR object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionSlideInR* create(float t, Scene* scene);
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Returns the action that will be performed by the incoming and outgoing scene. */
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual ActionInterval* action() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSlideInR();
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~TransitionSlideInR();
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** initializes the scenes */
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual void initScenes() override;
|
2010-08-20 14:35:37 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void sceneOrder() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionSlideInB
|
|
|
|
* @brief TransitionSlideInB:
|
2010-07-08 18:11:08 +08:00
|
|
|
Slide in the incoming scene from the bottom border.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionSlideInB : public TransitionSlideInL
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSlideInB object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionSlideInB* create(float t, Scene* scene);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2012-09-17 15:02:24 +08:00
|
|
|
/** returns the action that will be performed by the incoming and outgoing scene */
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual ActionInterval* action() override;
|
2010-08-20 14:35:37 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSlideInB();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionSlideInB();
|
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2013-11-23 07:07:58 +08:00
|
|
|
/** initializes the scenes */
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void initScenes() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void sceneOrder() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionSlideInT
|
|
|
|
* @brief TransitionSlideInT:
|
2010-07-08 18:11:08 +08:00
|
|
|
Slide in the incoming scene from the top border.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionSlideInT : public TransitionSlideInL
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSlideInT object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionSlideInT* create(float t, Scene* scene);
|
2013-11-23 07:07:58 +08:00
|
|
|
|
|
|
|
/** returns the action that will be performed by the incoming and outgoing scene */
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual ActionInterval* action() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSlideInT();
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~TransitionSlideInT();
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** initializes the scenes */
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual void initScenes() override;
|
2010-08-20 14:35:37 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void sceneOrder() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionShrinkGrow
|
2021-12-25 10:04:45 +08:00
|
|
|
* @brief Shrink the outgoing scene while grow the incoming scene
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionShrinkGrow : public TransitionScene, public TransitionEaseScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionShrinkGrow object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionShrinkGrow* create(float t, Scene* scene);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-11-23 07:07:58 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionShrinkGrow();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionShrinkGrow();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionFlipX
|
|
|
|
* @brief TransitionFlipX:
|
2010-07-08 18:11:08 +08:00
|
|
|
Flips the screen horizontally.
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionFlipX : public TransitionSceneOriented
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration, incoming scene and orientation.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @param o A given orientation.
|
|
|
|
* @return A autoreleased TransitionFlipX object.
|
|
|
|
*/
|
2013-07-25 20:50:39 +08:00
|
|
|
static TransitionFlipX* create(float t, Scene* s, Orientation o);
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionFlipX object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionFlipX* create(float t, Scene* s);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFlipX();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionFlipX();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionFlipY
|
|
|
|
* @brief TransitionFlipY:
|
2010-07-08 18:11:08 +08:00
|
|
|
Flips the screen vertically.
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionFlipY : public TransitionSceneOriented
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration, incoming scene and orientation.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @param o A given orientation.
|
|
|
|
* @return A autoreleased TransitionFlipY object.
|
|
|
|
*/
|
2013-07-25 20:50:39 +08:00
|
|
|
static TransitionFlipY* create(float t, Scene* s, Orientation o);
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionFlipY object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionFlipY* create(float t, Scene* s);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFlipY();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionFlipY();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionFlipAngular
|
|
|
|
* @brief TransitionFlipAngular:
|
2010-07-08 18:11:08 +08:00
|
|
|
Flips the screen half horizontally and half vertically.
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionFlipAngular : public TransitionSceneOriented
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration, incoming scene and orientation.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @param o A given orientation.
|
|
|
|
* @return A autoreleased TransitionFlipAngular object.
|
|
|
|
*/
|
2013-07-25 20:50:39 +08:00
|
|
|
static TransitionFlipAngular* create(float t, Scene* s, Orientation o);
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionFlipAngular object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionFlipAngular* create(float t, Scene* s);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFlipAngular();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionFlipAngular();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionZoomFlipX
|
|
|
|
* @brief TransitionZoomFlipX:
|
2010-07-08 18:11:08 +08:00
|
|
|
Flips the screen horizontally doing a zoom out/in
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionZoomFlipX : public TransitionSceneOriented
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration, incoming scene and orientation.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @param o A given orientation.
|
|
|
|
* @return A autoreleased TransitionZoomFlipX object.
|
|
|
|
*/
|
2013-07-25 20:50:39 +08:00
|
|
|
static TransitionZoomFlipX* create(float t, Scene* s, Orientation o);
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionZoomFlipX object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionZoomFlipX* create(float t, Scene* s);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionZoomFlipX();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionZoomFlipX();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionZoomFlipY
|
|
|
|
* @brief TransitionZoomFlipY:
|
2010-07-08 18:11:08 +08:00
|
|
|
Flips the screen vertically doing a little zooming out/in
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionZoomFlipY : public TransitionSceneOriented
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration, incoming scene and orientation.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @param o A given orientation.
|
|
|
|
* @return A autoreleased TransitionZoomFlipY object.
|
|
|
|
*/
|
2013-07-25 20:50:39 +08:00
|
|
|
static TransitionZoomFlipY* create(float t, Scene* s, Orientation o);
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionZoomFlipY object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionZoomFlipY* create(float t, Scene* s);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionZoomFlipY();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionZoomFlipY();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionZoomFlipAngular
|
|
|
|
* @brief TransitionZoomFlipAngular:
|
2010-07-08 18:11:08 +08:00
|
|
|
Flips the screen half horizontally and half vertically doing a little zooming out/in.
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionZoomFlipAngular : public TransitionSceneOriented
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration, incoming scene and orientation.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @param o A given orientation.
|
|
|
|
* @return A autoreleased TransitionZoomFlipAngular object.
|
|
|
|
*/
|
2013-07-25 20:50:39 +08:00
|
|
|
static TransitionZoomFlipAngular* create(float t, Scene* s, Orientation o);
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionZoomFlipAngular object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionZoomFlipAngular* create(float t, Scene* s);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionZoomFlipAngular();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionZoomFlipAngular();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionFade
|
|
|
|
* @brief TransitionFade:
|
2010-07-08 18:11:08 +08:00
|
|
|
Fade out the outgoing scene and then fade in the incoming scene.'''
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionFade : public TransitionScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates the transition with a duration and with an RGB color
|
|
|
|
* Example: FadeTransition::create(2, scene, Color3B(255,0,0); // red color
|
|
|
|
*
|
|
|
|
* @param duration Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @param color A given transition color.
|
|
|
|
* @return A autoreleased TransitionFade object.
|
|
|
|
*/
|
2013-11-23 07:07:58 +08:00
|
|
|
static TransitionFade* create(float duration, Scene* scene, const Color3B& color);
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates the transition with a duration.
|
|
|
|
*
|
|
|
|
* @param duration Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFade object.
|
|
|
|
*/
|
2013-11-23 07:07:58 +08:00
|
|
|
static TransitionFade* create(float duration, Scene* scene);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFade();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionFade();
|
|
|
|
|
|
|
|
/** initializes the transition with a duration and with an RGB color */
|
2021-12-25 10:04:45 +08:00
|
|
|
bool initWithDuration(float t, Scene* scene, const Color3B& color);
|
2013-11-23 07:07:58 +08:00
|
|
|
bool initWithDuration(float t, Scene* scene);
|
|
|
|
|
2014-03-21 13:44:29 +08:00
|
|
|
protected:
|
2013-11-23 07:07:58 +08:00
|
|
|
Color4B _color;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFade);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
class RenderTexture;
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionCrossFade
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief TransitionCrossFade:
|
|
|
|
Cross fades two scenes using the RenderTexture object.
|
2010-07-08 18:11:08 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionCrossFade : public TransitionScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionCrossFade object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionCrossFade* create(float t, Scene* scene);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-11-23 07:07:58 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onExit() override;
|
2010-08-20 14:35:37 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionCrossFade();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionCrossFade();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionTurnOffTiles
|
|
|
|
* @brief TransitionTurnOffTiles:
|
2010-07-08 18:11:08 +08:00
|
|
|
Turn off the tiles of the outgoing scene in random order
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionTurnOffTiles : public TransitionScene, public TransitionEaseScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionTurnOffTiles object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionTurnOffTiles* create(float t, Scene* scene);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2015-03-23 20:27:13 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
*/
|
2013-12-12 14:56:06 +08:00
|
|
|
virtual void onExit() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
*/
|
|
|
|
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
|
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionTurnOffTiles();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionTurnOffTiles();
|
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void sceneOrder() override;
|
2013-12-16 14:21:05 +08:00
|
|
|
NodeGrid* _outSceneProxy;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionSplitCols
|
|
|
|
* @brief TransitionSplitCols:
|
2010-07-08 18:11:08 +08:00
|
|
|
The odd columns goes upwards while the even columns goes downwards.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionSplitCols : public TransitionScene, public TransitionEaseScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSplitCols object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionSplitCols* create(float t, Scene* scene);
|
2010-07-09 18:24:08 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Returns the action that will be performed.
|
|
|
|
*
|
|
|
|
* @return The action that will be performed.
|
|
|
|
*/
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ActionInterval* action();
|
2012-12-06 18:51:33 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2013-12-12 14:56:06 +08:00
|
|
|
virtual void onExit() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
|
2014-07-14 14:25:06 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSplitCols();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionSplitCols();
|
2014-07-14 14:25:06 +08:00
|
|
|
|
|
|
|
protected:
|
2013-12-12 14:56:06 +08:00
|
|
|
void switchTargetToInscene();
|
2013-12-16 14:21:05 +08:00
|
|
|
NodeGrid* _gridProxy;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2013-11-23 07:07:58 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionSplitRows
|
|
|
|
* @brief TransitionSplitRows:
|
2010-07-08 18:11:08 +08:00
|
|
|
The odd rows goes to the left while the even rows goes to the right.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionSplitRows : public TransitionSplitCols
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSplitRows object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionSplitRows* create(float t, Scene* scene);
|
2010-07-12 17:56:06 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2019-07-22 09:38:46 +08:00
|
|
|
virtual ActionInterval* action() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSplitRows();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionSplitRows();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionFadeTR
|
|
|
|
* @brief TransitionFadeTR:
|
2010-07-08 18:11:08 +08:00
|
|
|
Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionFadeTR : public TransitionScene, public TransitionEaseScene
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFadeTR object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionFadeTR* create(float t, Scene* scene);
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Returns the action that will be performed with size.
|
|
|
|
*
|
|
|
|
* @param size A given size.
|
|
|
|
* @return The action that will be performed.
|
|
|
|
*/
|
2021-10-23 23:27:14 +08:00
|
|
|
virtual ActionInterval* actionWithSize(const Vec2& size);
|
2010-08-20 14:35:37 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void onEnter() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2013-12-12 14:56:06 +08:00
|
|
|
virtual void onExit() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
|
2014-07-14 14:25:06 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFadeTR();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionFadeTR();
|
|
|
|
|
2014-07-14 14:25:06 +08:00
|
|
|
protected:
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void sceneOrder() override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2013-12-16 14:21:05 +08:00
|
|
|
NodeGrid* _outSceneProxy;
|
2013-12-12 14:56:06 +08:00
|
|
|
|
2013-11-23 07:07:58 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionFadeBL
|
|
|
|
* @brief TransitionFadeBL:
|
2010-07-08 18:11:08 +08:00
|
|
|
Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionFadeBL : public TransitionFadeTR
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFadeBL object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionFadeBL* create(float t, Scene* scene);
|
2010-08-20 14:35:37 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2021-10-23 23:27:14 +08:00
|
|
|
virtual ActionInterval* actionWithSize(const Vec2& size) override;
|
2012-12-06 18:51:33 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFadeBL();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionFadeBL();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionFadeUp
|
|
|
|
* @brief TransitionFadeUp:
|
2021-12-25 10:04:45 +08:00
|
|
|
* Fade the tiles of the outgoing scene from the bottom to the top.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionFadeUp : public TransitionFadeTR
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFadeUp object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionFadeUp* create(float t, Scene* scene);
|
2012-12-06 18:51:33 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2021-10-23 23:27:14 +08:00
|
|
|
virtual ActionInterval* actionWithSize(const Vec2& size) override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFadeUp();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionFadeUp();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionFadeDown
|
|
|
|
* @brief TransitionFadeDown:
|
2021-12-25 10:04:45 +08:00
|
|
|
* Fade the tiles of the outgoing scene from the top to the bottom.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TransitionFadeDown : public TransitionFadeTR
|
2010-07-08 18:11:08 +08:00
|
|
|
{
|
2010-07-09 18:24:08 +08:00
|
|
|
public:
|
2015-03-21 18:02:56 +08:00
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFadeDown object.
|
|
|
|
*/
|
2013-07-16 03:43:22 +08:00
|
|
|
static TransitionFadeDown* create(float t, Scene* scene);
|
2010-08-20 14:35:37 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2021-10-23 23:27:14 +08:00
|
|
|
virtual ActionInterval* actionWithSize(const Vec2& size) override;
|
2013-11-23 07:07:58 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFadeDown();
|
2013-11-23 07:07:58 +08:00
|
|
|
virtual ~TransitionFadeDown();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown);
|
2010-07-08 18:11:08 +08:00
|
|
|
};
|
2012-04-18 18:43:45 +08:00
|
|
|
|
2015-03-24 10:34:41 +08:00
|
|
|
// end of _2d group
|
2012-06-20 18:09:11 +08:00
|
|
|
/// @}
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_END
|
2010-07-08 18:11:08 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
#endif // __CCTRANSITION_H__
|