Base class for a transition. More...
#include <Game/TransitionEffect.h>
Inherited by TransitionDelay, TransitionIn, and TransitionOut.
Public Types | |
enum | TransitionType { TRANSITION_UNKNOWN = -1, TRANSITION_OUT = 0, TRANSITION_DELAY, TRANSITION_IN, TRANSITION_COUNT } |
Declares the differant type of transitions. More... | |
Public Member Functions | |
Transition () | |
Constructor. | |
Transition (float time) | |
Constructor. | |
virtual | ~Transition () |
Deconstructor. | |
virtual TransitionType | GetType () const |
Returns the type of the transition. | |
void | SetTransitionTime (float time) |
Sets the transition time. | |
void | SetArea (const Rectf &rec) |
Sets the area that the transition must cover. | |
float | GetTransitionTime () |
Gets the transition time. | |
float | GetTimeLeft () const |
Returns the time left in the transition. | |
bool | IsComplete () const |
Returns true if the transition is complete. | |
float | GetCompletionPercent () const |
Returns a value in the range [0,1]. | |
void | SetCompletionPercent (float t) |
Sets the completion percentage. | |
void | Reset () |
Reset the transition. | |
void | ForceCompletion () |
Forces the transition to be completed. | |
void | Update (float dt) |
Updates the transition. | |
void | Draw () |
Draws the transition. | |
Protected Member Functions | |
virtual void | OnDraw (float t, const Rectf &r)=0 |
Internal draw method. |
Base class for a transition.
Transitions are expected to cover the entire given rectangle.
Declares the differant type of transitions.
TRANSITION_UNKNOWN |
Unknown transition type. |
TRANSITION_OUT |
Transition out. |
TRANSITION_DELAY |
Transition delay between a transition out and in. |
TRANSITION_IN |
Transition in. |
TRANSITION_COUNT |
The number of transition types. |
Transition::Transition | ( | float | time | ) |
Constructor.
[in] | time | the transition time. |
virtual void Transition::OnDraw | ( | float | t, | |
const Rectf & | r | |||
) | [protected, pure virtual] |
Internal draw method.
[in] | t | the completion percentage in the range [0,1]. |
[in] | r | the area to cover. |
Implemented in AlphaFadeOutTransition, AlphaFadeInTransition, SolidColorDelayTransition, SlantedSlideOutTransition, and SlantedSlideInTransition.
void Transition::SetCompletionPercent | ( | float | t | ) |
Sets the completion percentage.
[in] | t | a value in the range [0,1]. |