2019-11-23 20:27:39 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2009-2010 Ricardo Quesada
|
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
|
|
|
Copyright (c) 2011 Zynga Inc.
|
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
|
|
|
|
|
|
|
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__
|
|
|
|
|
|
|
|
#include "2d/CCScene.h"
|
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @addtogroup _2d
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
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.
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
class ActionInterval;
|
|
|
|
class Node;
|
|
|
|
class NodeGrid;
|
|
|
|
|
|
|
|
/** @class TransitionEaseScene
|
|
|
|
* @brief TransitionEaseScene can ease the actions of the scene protocol.
|
|
|
|
@since v0.8.2
|
|
|
|
@js NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionEaseScene // : public Ref
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Constructor.
|
|
|
|
*/
|
|
|
|
virtual ~TransitionEaseScene() {}
|
|
|
|
|
|
|
|
/** Returns the Ease action that will be performed on a linear action.
|
|
|
|
@since v0.8.2
|
|
|
|
*
|
|
|
|
* @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;
|
2019-11-23 20:27:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionScene
|
|
|
|
* @brief Base class for Transition scenes.
|
2021-12-25 10:04:45 +08:00
|
|
|
*/
|
2019-11-23 20:27:39 +08:00
|
|
|
class CC_DLL TransitionScene : public Scene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Orientation Type used by some transitions.
|
|
|
|
*/
|
|
|
|
enum class Orientation
|
|
|
|
{
|
|
|
|
/// An horizontal orientation where the Left is nearer
|
|
|
|
LEFT_OVER = 0,
|
|
|
|
/// An horizontal orientation where the Right is nearer
|
|
|
|
RIGHT_OVER = 1,
|
|
|
|
/// A vertical orientation where the Up is nearer
|
|
|
|
UP_OVER = 0,
|
|
|
|
/// A vertical orientation where the Bottom is nearer
|
|
|
|
DOWN_OVER = 1,
|
|
|
|
};
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +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);
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
/** Called after the transition finishes.
|
|
|
|
*/
|
|
|
|
void finish();
|
|
|
|
|
|
|
|
/** Used by some transitions to hide the outer scene.
|
|
|
|
*/
|
|
|
|
void hideOutShowIn();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
Scene* getInScene() const { return _inScene; }
|
2019-11-23 20:27:39 +08:00
|
|
|
float getDuration() const { return _duration; }
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
|
2019-11-23 20:27:39 +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();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionScene();
|
|
|
|
|
|
|
|
/** initializes a transition with duration and incoming scene */
|
2021-12-25 10:04:45 +08:00
|
|
|
bool initWithDuration(float t, Scene* scene);
|
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
protected:
|
|
|
|
virtual void sceneOrder();
|
|
|
|
void setNewScene(float dt);
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
Scene* _inScene;
|
|
|
|
Scene* _outScene;
|
2019-11-23 20:27:39 +08:00
|
|
|
float _duration;
|
|
|
|
bool _isInSceneOnTop;
|
|
|
|
bool _isSendCleanupToScene;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionScene);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionSceneOriented
|
|
|
|
* @brief A Transition that supports orientation like.
|
|
|
|
* Possible orientation: LeftOver, RightOver, UpOver, DownOver
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionSceneOriented : public TransitionScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration, incoming scene and orientation.
|
2021-12-25 10:04:45 +08:00
|
|
|
*
|
2019-11-23 20:27:39 +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();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionSceneOriented();
|
|
|
|
|
|
|
|
/** initializes a transition with duration and incoming scene */
|
2021-12-25 10:04:45 +08:00
|
|
|
bool initWithDuration(float t, Scene* scene, Orientation orientation);
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
Orientation _orientation;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @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
|
2019-11-23 20:27:39 +08:00
|
|
|
*/
|
|
|
|
class CC_DLL TransitionRotoZoom : public TransitionScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionRotoZoom object.
|
|
|
|
*/
|
|
|
|
static TransitionRotoZoom* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionRotoZoom();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionRotoZoom();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionRotoZoom);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @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
|
2019-11-23 20:27:39 +08:00
|
|
|
*/
|
|
|
|
class CC_DLL TransitionJumpZoom : public TransitionScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionJumpZoom object.
|
|
|
|
*/
|
|
|
|
static TransitionJumpZoom* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionJumpZoom();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionJumpZoom();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionMoveInL
|
|
|
|
* @brief TransitionMoveInL:
|
|
|
|
Move in from to the left the incoming scene.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionMoveInL object.
|
|
|
|
*/
|
|
|
|
static TransitionMoveInL* create(float t, Scene* scene);
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
/** Returns the action that will be performed.
|
|
|
|
*
|
2019-11-23 20:27:39 +08:00
|
|
|
* @return The action that will be performed.
|
|
|
|
*/
|
|
|
|
virtual ActionInterval* action();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionMoveInL();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionMoveInL();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/** initializes the scenes */
|
|
|
|
virtual void initScenes();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionMoveInR
|
|
|
|
* @brief TransitionMoveInR:
|
|
|
|
Move in from to the right the incoming scene.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionMoveInR : public TransitionMoveInL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionMoveInR object.
|
|
|
|
*/
|
|
|
|
static TransitionMoveInR* create(float t, Scene* scene);
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionMoveInR();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionMoveInR();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void initScenes();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionMoveInT
|
|
|
|
* @brief TransitionMoveInT:
|
|
|
|
Move in from to the top the incoming scene.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionMoveInT : public TransitionMoveInL
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionMoveInT object.
|
|
|
|
*/
|
|
|
|
static TransitionMoveInT* create(float t, Scene* scene);
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionMoveInT();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionMoveInT();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void initScenes();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionMoveInB
|
|
|
|
* @brief TransitionMoveInB:
|
|
|
|
Move in from to the bottom the incoming scene.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionMoveInB : public TransitionMoveInL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionMoveInB object.
|
|
|
|
*/
|
|
|
|
static TransitionMoveInB* create(float t, Scene* scene);
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionMoveInB();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionMoveInB();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void initScenes();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionSlideInL
|
|
|
|
* @brief TransitionSlideInL:
|
|
|
|
Slide in the incoming scene from the left border.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSlideInL object.
|
|
|
|
*/
|
|
|
|
static TransitionSlideInL* create(float t, Scene* scene);
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2019-11-23 20:27:39 +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.
|
|
|
|
*/
|
|
|
|
virtual ActionInterval* action();
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSlideInL();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionSlideInL();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/** initializes the scenes */
|
|
|
|
virtual void initScenes();
|
|
|
|
|
|
|
|
virtual void sceneOrder() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionSlideInR
|
|
|
|
*@brief TransitionSlideInR:
|
|
|
|
Slide in the incoming scene from the right border.
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
class CC_DLL TransitionSlideInR : public TransitionSlideInL
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSlideInR object.
|
|
|
|
*/
|
|
|
|
static TransitionSlideInR* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
/** Returns the action that will be performed by the incoming and outgoing scene. */
|
|
|
|
virtual ActionInterval* action() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSlideInR();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionSlideInR();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/** initializes the scenes */
|
|
|
|
virtual void initScenes() override;
|
|
|
|
|
|
|
|
virtual void sceneOrder() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionSlideInB
|
|
|
|
* @brief TransitionSlideInB:
|
|
|
|
Slide in the incoming scene from the bottom border.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionSlideInB : public TransitionSlideInL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSlideInB object.
|
|
|
|
*/
|
|
|
|
static TransitionSlideInB* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
/** returns the action that will be performed by the incoming and outgoing scene */
|
|
|
|
virtual ActionInterval* action() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSlideInB();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionSlideInB();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/** initializes the scenes */
|
|
|
|
virtual void initScenes() override;
|
|
|
|
|
|
|
|
virtual void sceneOrder() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionSlideInT
|
|
|
|
* @brief TransitionSlideInT:
|
|
|
|
Slide in the incoming scene from the top border.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionSlideInT : public TransitionSlideInL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSlideInT object.
|
|
|
|
*/
|
|
|
|
static TransitionSlideInT* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
/** returns the action that will be performed by the incoming and outgoing scene */
|
|
|
|
virtual ActionInterval* action() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSlideInT();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionSlideInT();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/** initializes the scenes */
|
|
|
|
virtual void initScenes() override;
|
|
|
|
|
|
|
|
virtual void sceneOrder() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @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
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionShrinkGrow object.
|
|
|
|
*/
|
|
|
|
static TransitionShrinkGrow* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionShrinkGrow();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionShrinkGrow();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionFlipX
|
|
|
|
* @brief TransitionFlipX:
|
|
|
|
Flips the screen horizontally.
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionFlipX : public TransitionSceneOriented
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
static TransitionFlipX* create(float t, Scene* s, Orientation o);
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionFlipX object.
|
|
|
|
*/
|
|
|
|
static TransitionFlipX* create(float t, Scene* s);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFlipX();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionFlipX();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionFlipY
|
|
|
|
* @brief TransitionFlipY:
|
|
|
|
Flips the screen vertically.
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionFlipY : public TransitionSceneOriented
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
static TransitionFlipY* create(float t, Scene* s, Orientation o);
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionFlipY object.
|
|
|
|
*/
|
|
|
|
static TransitionFlipY* create(float t, Scene* s);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFlipY();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionFlipY();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionFlipAngular
|
|
|
|
* @brief TransitionFlipAngular:
|
|
|
|
Flips the screen half horizontally and half vertically.
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionFlipAngular : public TransitionSceneOriented
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
static TransitionFlipAngular* create(float t, Scene* s, Orientation o);
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionFlipAngular object.
|
|
|
|
*/
|
|
|
|
static TransitionFlipAngular* create(float t, Scene* s);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFlipAngular();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionFlipAngular();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionZoomFlipX
|
|
|
|
* @brief TransitionZoomFlipX:
|
|
|
|
Flips the screen horizontally doing a zoom out/in
|
|
|
|
The front face is the outgoing scene and the back face is the incoming scene.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionZoomFlipX : public TransitionSceneOriented
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
static TransitionZoomFlipX* create(float t, Scene* s, Orientation o);
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionZoomFlipX object.
|
|
|
|
*/
|
|
|
|
static TransitionZoomFlipX* create(float t, Scene* s);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionZoomFlipX();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionZoomFlipX();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionZoomFlipY
|
|
|
|
* @brief TransitionZoomFlipY:
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionZoomFlipY : public TransitionSceneOriented
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
static TransitionZoomFlipY* create(float t, Scene* s, Orientation o);
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionZoomFlipY object.
|
|
|
|
*/
|
|
|
|
static TransitionZoomFlipY* create(float t, Scene* s);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionZoomFlipY();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionZoomFlipY();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionZoomFlipAngular
|
|
|
|
* @brief TransitionZoomFlipAngular:
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionZoomFlipAngular : public TransitionSceneOriented
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
static TransitionZoomFlipAngular* create(float t, Scene* s, Orientation o);
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param s A given scene.
|
|
|
|
* @return A autoreleased TransitionZoomFlipAngular object.
|
|
|
|
*/
|
|
|
|
static TransitionZoomFlipAngular* create(float t, Scene* s);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionZoomFlipAngular();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionZoomFlipAngular();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionFade
|
|
|
|
* @brief TransitionFade:
|
|
|
|
Fade out the outgoing scene and then fade in the incoming scene.'''
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionFade : public TransitionScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** 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.
|
|
|
|
*/
|
|
|
|
static TransitionFade* create(float duration, Scene* scene, const Color3B& color);
|
|
|
|
/** Creates the transition with a duration.
|
|
|
|
*
|
|
|
|
* @param duration Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFade object.
|
|
|
|
*/
|
|
|
|
static TransitionFade* create(float duration, Scene* scene);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onExit() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFade();
|
2019-11-23 20:27:39 +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);
|
2019-11-23 20:27:39 +08:00
|
|
|
bool initWithDuration(float t, Scene* scene);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Color4B _color;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFade);
|
|
|
|
};
|
|
|
|
|
|
|
|
class RenderTexture;
|
|
|
|
/** @class TransitionCrossFade
|
|
|
|
@brief TransitionCrossFade:
|
|
|
|
Cross fades two scenes using the RenderTexture object.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionCrossFade : public TransitionScene
|
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
public:
|
2019-11-23 20:27:39 +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.
|
|
|
|
*/
|
|
|
|
static TransitionCrossFade* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onExit() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionCrossFade();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionCrossFade();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionTurnOffTiles
|
|
|
|
* @brief TransitionTurnOffTiles:
|
|
|
|
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
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
public:
|
2019-11-23 20:27:39 +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.
|
|
|
|
*/
|
|
|
|
static TransitionTurnOffTiles* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
*/
|
|
|
|
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();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionTurnOffTiles();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void sceneOrder() override;
|
|
|
|
NodeGrid* _outSceneProxy;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionSplitCols
|
|
|
|
* @brief TransitionSplitCols:
|
|
|
|
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
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSplitCols object.
|
|
|
|
*/
|
|
|
|
static TransitionSplitCols* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
/** Returns the action that will be performed.
|
|
|
|
*
|
|
|
|
* @return The action that will be performed.
|
|
|
|
*/
|
|
|
|
virtual ActionInterval* action();
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2019-11-23 20:27:39 +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;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSplitCols();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionSplitCols();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void switchTargetToInscene();
|
|
|
|
NodeGrid* _gridProxy;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionSplitRows
|
|
|
|
* @brief TransitionSplitRows:
|
|
|
|
The odd rows goes to the left while the even rows goes to the right.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionSplitRows : public TransitionSplitCols
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionSplitRows object.
|
|
|
|
*/
|
|
|
|
static TransitionSplitRows* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual ActionInterval* action() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionSplitRows();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionSplitRows();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionFadeTR
|
|
|
|
* @brief TransitionFadeTR:
|
|
|
|
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
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFadeTR object.
|
|
|
|
*/
|
|
|
|
static TransitionFadeTR* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
/** 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);
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
|
|
|
virtual void onEnter() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ActionInterval* easeActionWithAction(ActionInterval* action) override;
|
2019-11-23 20:27:39 +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;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFadeTR();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionFadeTR();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void sceneOrder() override;
|
|
|
|
|
|
|
|
NodeGrid* _outSceneProxy;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @class TransitionFadeBL
|
|
|
|
* @brief TransitionFadeBL:
|
|
|
|
Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.
|
|
|
|
*/
|
|
|
|
class CC_DLL TransitionFadeBL : public TransitionFadeTR
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFadeBL object.
|
|
|
|
*/
|
|
|
|
static TransitionFadeBL* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2021-10-23 23:27:14 +08:00
|
|
|
virtual ActionInterval* actionWithSize(const Vec2& size) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFadeBL();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionFadeBL();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @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.
|
|
|
|
*/
|
2019-11-23 20:27:39 +08:00
|
|
|
class CC_DLL TransitionFadeUp : public TransitionFadeTR
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFadeUp object.
|
|
|
|
*/
|
|
|
|
static TransitionFadeUp* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2021-10-23 23:27:14 +08:00
|
|
|
virtual ActionInterval* actionWithSize(const Vec2& size) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFadeUp();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionFadeUp();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @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.
|
|
|
|
*/
|
2019-11-23 20:27:39 +08:00
|
|
|
class CC_DLL TransitionFadeDown : public TransitionFadeTR
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Creates a transition with duration and incoming scene.
|
|
|
|
*
|
|
|
|
* @param t Duration time, in seconds.
|
|
|
|
* @param scene A given scene.
|
|
|
|
* @return A autoreleased TransitionFadeDown object.
|
|
|
|
*/
|
|
|
|
static TransitionFadeDown* create(float t, Scene* scene);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
2021-10-23 23:27:14 +08:00
|
|
|
virtual ActionInterval* actionWithSize(const Vec2& size) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
CC_CONSTRUCTOR_ACCESS : TransitionFadeDown();
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual ~TransitionFadeDown();
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown);
|
|
|
|
};
|
|
|
|
|
|
|
|
// end of _2d group
|
|
|
|
/// @}
|
|
|
|
|
|
|
|
NS_CC_END
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
#endif // __CCTRANSITION_H__
|