2012-03-26 16:46:23 +08:00
|
|
|
/****************************************************************************
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2009 Lam Pham
|
2012-09-24 21:22:20 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2012 Ricardo Quesada
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
https://axys1.github.io/
|
2012-03-26 16:46:23 +08:00
|
|
|
|
|
|
|
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 __CCTRANSITIONPROGRESS_H__
|
|
|
|
#define __CCTRANSITIONPROGRESS_H__
|
|
|
|
|
2014-05-01 10:09:13 +08:00
|
|
|
#include "2d/CCTransition.h"
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
class ProgressTimer;
|
|
|
|
class RenderTexture;
|
2012-03-26 16:46:23 +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
|
|
|
* @{
|
|
|
|
*/
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionProgress
|
|
|
|
* @brief A base class of progress transition.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TransitionProgress : public TransitionScene
|
2012-03-26 16:46:23 +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 An autoreleased TransitionProgress object.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
static TransitionProgress* create(float t, Scene* scene);
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
TransitionProgress();
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~TransitionProgress() {}
|
2014-07-14 14:25:36 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
protected:
|
|
|
|
virtual void sceneOrder() override;
|
|
|
|
|
2012-03-26 16:46:23 +08:00
|
|
|
protected:
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture);
|
2012-03-26 16:46:23 +08:00
|
|
|
virtual void setupTransition();
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
protected:
|
2013-06-15 14:03:30 +08:00
|
|
|
float _to;
|
|
|
|
float _from;
|
2013-06-20 14:13:12 +08:00
|
|
|
Scene* _sceneToBeModified;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionProgressRadialCCW
|
|
|
|
* @brief TransitionRadialCCW transition.
|
2012-09-17 15:02:24 +08:00
|
|
|
A counter clock-wise radial transition to the next scene
|
2012-03-26 16:46:23 +08:00
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TransitionProgressRadialCCW : public TransitionProgress
|
2012-03-26 16:46:23 +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 An autoreleased TransitionProgressRadialCCW object.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
static TransitionProgressRadialCCW* create(float t, Scene* scene);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
TransitionProgressRadialCCW() {}
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~TransitionProgressRadialCCW() {}
|
2014-07-14 14:25:36 +08:00
|
|
|
|
2012-03-26 16:46:23 +08:00
|
|
|
protected:
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionProgressRadialCW
|
|
|
|
* @brief TransitionRadialCW transition.
|
|
|
|
A counter clock-wise radial transition to the next scene.
|
2012-03-26 16:46:23 +08:00
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TransitionProgressRadialCW : public TransitionProgress
|
2012-03-26 16:46:23 +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 An autoreleased TransitionProgressRadialCW object.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
static TransitionProgressRadialCW* create(float t, Scene* scene);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
TransitionProgressRadialCW() {}
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~TransitionProgressRadialCW() {}
|
2014-07-14 14:25:36 +08:00
|
|
|
|
2012-03-26 16:46:23 +08:00
|
|
|
protected:
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionProgressHorizontal
|
|
|
|
* @brief TransitionProgressHorizontal transition.
|
2012-09-17 15:02:24 +08:00
|
|
|
A clock-wise radial transition to the next scene
|
2012-03-26 16:46:23 +08:00
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TransitionProgressHorizontal : public TransitionProgress
|
2012-03-26 16:46:23 +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 An autoreleased TransitionProgressHorizontal object.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
static TransitionProgressHorizontal* create(float t, Scene* scene);
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
TransitionProgressHorizontal() {}
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~TransitionProgressHorizontal() {}
|
2014-07-14 14:25:36 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
protected:
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionProgressVertical
|
|
|
|
* @brief TransitionProgressVertical transition.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TransitionProgressVertical : public TransitionProgress
|
2012-03-26 16:46:23 +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 An autoreleased TransitionProgressVertical object.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
static TransitionProgressVertical* create(float t, Scene* scene);
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
TransitionProgressVertical() {}
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~TransitionProgressVertical() {}
|
2014-07-14 14:25:36 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
protected:
|
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionProgressInOut
|
|
|
|
* @brief TransitionProgressInOut transition.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TransitionProgressInOut : public TransitionProgress
|
2012-03-26 16:46:23 +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 An autoreleased TransitionProgressInOut object.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
static TransitionProgressInOut* create(float t, Scene* scene);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
TransitionProgressInOut() {}
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~TransitionProgressInOut() {}
|
2014-07-14 14:25:36 +08:00
|
|
|
|
2012-03-26 16:46:23 +08:00
|
|
|
protected:
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
|
|
|
|
virtual void sceneOrder() override;
|
|
|
|
virtual void setupTransition() override;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2015-03-21 18:02:56 +08:00
|
|
|
/** @class TransitionProgressOutIn
|
|
|
|
* @brief TransitionProgressOutIn transition.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TransitionProgressOutIn : public TransitionProgress
|
2012-03-26 16:46:23 +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 An autoreleased TransitionProgressOutIn object.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
static TransitionProgressOutIn* create(float t, Scene* scene);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
2022-03-18 21:46:07 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
|
|
|
TransitionProgressOutIn() {}
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual ~TransitionProgressOutIn() {}
|
2014-07-14 14:25:36 +08:00
|
|
|
|
2012-03-26 16:46:23 +08:00
|
|
|
protected:
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
|
2012-03-26 16:46:23 +08:00
|
|
|
};
|
|
|
|
|
2015-03-24 10:34:41 +08:00
|
|
|
// end of _2d group
|
2012-06-20 18:09:11 +08:00
|
|
|
/// @}
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|
2012-03-26 16:46:23 +08:00
|
|
|
|
|
|
|
#endif /* __CCTRANSITIONPROGRESS_H__ */
|