123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- /****************************************************************************
- Copyright (c) 2009 Lam Pham
- Copyright (c) 2010-2012 cocos2d-x.org
- Copyright (c) 2012 Ricardo Quesada
- 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 __CCTRANSITIONPROGRESS_H__
- #define __CCTRANSITIONPROGRESS_H__
- #include "2d/CCTransition.h"
- NS_CC_BEGIN
- class ProgressTimer;
- class RenderTexture;
- /**
- * @addtogroup _2d
- * @{
- */
- /** @class TransitionProgress
- * @brief A base class of progress transition.
- */
- class CC_DLL TransitionProgress : public TransitionScene
- {
- public:
- /** Creates a transition with duration and incoming scene.
- *
- * @param t Duration time, in seconds.
- * @param scene A given scene.
- * @return An autoreleased TransitionProgress object.
- */
- static TransitionProgress* create(float t, Scene* scene);
- //
- // Overrides
- //
- virtual void onEnter() override;
- virtual void onExit() override;
- CC_CONSTRUCTOR_ACCESS:
- TransitionProgress();
- virtual ~TransitionProgress(){}
- protected:
- virtual void sceneOrder() override;
- protected:
- virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture);
- virtual void setupTransition();
- protected:
- float _to;
- float _from;
- Scene* _sceneToBeModified;
- };
- /** @class TransitionProgressRadialCCW
- * @brief TransitionRadialCCW transition.
- A counter clock-wise radial transition to the next scene
- */
- class CC_DLL TransitionProgressRadialCCW : public TransitionProgress
- {
- public:
- /** Creates a transition with duration and incoming scene.
- *
- * @param t Duration time, in seconds.
- * @param scene A given scene.
- * @return An autoreleased TransitionProgressRadialCCW object.
- */
- static TransitionProgressRadialCCW* create(float t, Scene* scene);
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- TransitionProgressRadialCCW(){}
- virtual ~TransitionProgressRadialCCW(){}
- protected:
- //
- // Overrides
- //
- virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
-
- };
- /** @class TransitionProgressRadialCW
- * @brief TransitionRadialCW transition.
- A counter clock-wise radial transition to the next scene.
- */
- class CC_DLL TransitionProgressRadialCW : public TransitionProgress
- {
- public:
- /** Creates a transition with duration and incoming scene.
- *
- * @param t Duration time, in seconds.
- * @param scene A given scene.
- * @return An autoreleased TransitionProgressRadialCW object.
- */
- static TransitionProgressRadialCW* create(float t, Scene* scene);
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- TransitionProgressRadialCW(){}
- virtual ~TransitionProgressRadialCW(){}
- protected:
- //
- // Overrides
- //
- virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
- };
- /** @class TransitionProgressHorizontal
- * @brief TransitionProgressHorizontal transition.
- A clock-wise radial transition to the next scene
- */
- class CC_DLL TransitionProgressHorizontal : public TransitionProgress
- {
- public:
- /** Creates a transition with duration and incoming scene.
- *
- * @param t Duration time, in seconds.
- * @param scene A given scene.
- * @return An autoreleased TransitionProgressHorizontal object.
- */
- static TransitionProgressHorizontal* create(float t, Scene* scene);
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- TransitionProgressHorizontal(){}
- virtual ~TransitionProgressHorizontal(){}
- protected:
- //
- // Overrides
- //
- virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
- };
- /** @class TransitionProgressVertical
- * @brief TransitionProgressVertical transition.
- */
- class CC_DLL TransitionProgressVertical : public TransitionProgress
- {
- public:
- /** Creates a transition with duration and incoming scene.
- *
- * @param t Duration time, in seconds.
- * @param scene A given scene.
- * @return An autoreleased TransitionProgressVertical object.
- */
- static TransitionProgressVertical* create(float t, Scene* scene);
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- TransitionProgressVertical(){}
- virtual ~TransitionProgressVertical(){}
- protected:
- //
- // Overrides
- //
- virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
- };
- /** @class TransitionProgressInOut
- * @brief TransitionProgressInOut transition.
- */
- class CC_DLL TransitionProgressInOut : public TransitionProgress
- {
- public:
- /** Creates a transition with duration and incoming scene.
- *
- * @param t Duration time, in seconds.
- * @param scene A given scene.
- * @return An autoreleased TransitionProgressInOut object.
- */
- static TransitionProgressInOut* create(float t, Scene* scene);
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- TransitionProgressInOut(){}
- virtual ~TransitionProgressInOut(){}
- protected:
- //
- // Overrides
- //
- virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
- virtual void sceneOrder() override;
- virtual void setupTransition() override;
- };
- /** @class TransitionProgressOutIn
- * @brief TransitionProgressOutIn transition.
- */
- class CC_DLL TransitionProgressOutIn : public TransitionProgress
- {
- public:
- /** Creates a transition with duration and incoming scene.
- *
- * @param t Duration time, in seconds.
- * @param scene A given scene.
- * @return An autoreleased TransitionProgressOutIn object.
- */
- static TransitionProgressOutIn* create(float t, Scene* scene);
- CC_CONSTRUCTOR_ACCESS:
- /**
- * @js ctor
- */
- TransitionProgressOutIn(){}
- virtual ~TransitionProgressOutIn(){}
- protected:
- //
- // Overrides
- //
- virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;
- };
- // end of _2d group
- /// @}
- NS_CC_END
- #endif /* __CCTRANSITIONPROGRESS_H__ */
|