V-Gears 0
Free Final Fantasy VII engine.
UiAnimation Class Reference

An UI element animation. More...

#include <UiAnimation.h>

Collaboration diagram for UiAnimation:

Public Types

enum  State { DEFAULT , ONCE }
 Animation state. More...
 

Public Member Functions

 UiAnimation (const Ogre::String &name, UiWidget *widget)
 Constructor. More...
 
virtual ~UiAnimation ()
 Destructor. More...
 
void AddTime (const float time)
 Adds time to the animation and updates it. More...
 
const Ogre::String & GetName () const
 Retrieves the animation name. More...
 
void SetTime (const float time)
 Sets the time of the animation and updates it. More...
 
float GetTime () const
 Retrieves the animation current time. More...
 
void SetLength (const float time)
 Sets the animation length. More...
 
float GetLength () const
 Retrieves the animation length. More...
 
void AddScaleKeyFrame (const UiKeyFrameVector2 &key_frame)
 Adds a scale keyframe to the animation. More...
 
void AddXKeyFrame (const UiKeyFrameVector2 &key_frame)
 Adds a X position keyframe to the animation. More...
 
void AddYKeyFrame (const UiKeyFrameVector2 &key_frame)
 Adds a Y position keyframe to the animation. More...
 
void AddWidthKeyFrame (const UiKeyFrameVector2 &key_frame)
 Adds a width keyframe to the animation. More...
 
void AddHeightKeyFrame (const UiKeyFrameVector2 &key_frame)
 Adds a height keyframe to the animation. More...
 
void AddRotationKeyFrame (const UiKeyFrameFloat &key_frame)
 Adds a rotation keyframe to the animation. More...
 
void AddAlphaKeyFrame (const UiKeyFrameFloat &key_frame)
 Adds an alpha keyframe to the animation. More...
 
void AddScissorKeyFrame (const UiKeyFrameVector2 &x1, const UiKeyFrameVector2 &y1, const UiKeyFrameVector2 &x2, const UiKeyFrameVector2 &y2)
 Adds an scissor keyframe to the animation. More...
 

Private Member Functions

 UiAnimation ()
 Constructor. More...
 
Ogre::String name_
 The UI animation name. More...
 
UiWidgetwidget_
 The UI widget. More...
 
float time_
 The animation's current time. More...
 
float length_
 The animation length. More...
 
std::vector< UiKeyFrameVector2scale_
 List of scale keyframes. More...
 
std::vector< UiKeyFrameVector2x_
 List of X position keyframes. More...
 
std::vector< UiKeyFrameVector2y_
 List of Y position keyframes. More...
 
std::vector< UiKeyFrameVector2width_
 List of width keyframes. More...
 
std::vector< UiKeyFrameVector2height_
 List of height keyframes. More...
 
std::vector< UiKeyFrameFloatrotation_
 List of rotation keyframes. More...
 
std::vector< UiKeyFrameFloatalpha_
 List of alpha keyframes. More...
 
std::vector< UiKeyFrameVector2scissor_x_top_
 
std::vector< UiKeyFrameVector2scissor_y_left_
 
std::vector< UiKeyFrameVector2scissor_x_bottom_
 
std::vector< UiKeyFrameVector2scissor_y_right_
 
float KeyFrameGetValue (std::vector< UiKeyFrameFloat > &data)
 Gets the value from asee UiKeyFrameFloat}. More...
 
Ogre::Vector2 KeyFrameGetValue (std::vector< UiKeyFrameVector2 > &data)
 Gets the value from asee UiKeyFrameVector2}. More...
 

Detailed Description

An UI element animation.

Member Enumeration Documentation

◆ State

Animation state.

Enumerator
DEFAULT 
Todo:
Understand and document.
ONCE 

Animate only once.

Constructor & Destructor Documentation

◆ UiAnimation() [1/2]

UiAnimation::UiAnimation ( const Ogre::String &  name,
UiWidget widget 
)

Constructor.

Parameters
[in]nameAnimation name.
[in]widgetWidget to animate.

◆ ~UiAnimation()

UiAnimation::~UiAnimation ( )
virtual

Destructor.

◆ UiAnimation() [2/2]

UiAnimation::UiAnimation ( )
private

Constructor.

Member Function Documentation

◆ AddAlphaKeyFrame()

void UiAnimation::AddAlphaKeyFrame ( const UiKeyFrameFloat key_frame)

Adds an alpha keyframe to the animation.

Parameters
[in]key_frameThe keyframe to add.

◆ AddHeightKeyFrame()

void UiAnimation::AddHeightKeyFrame ( const UiKeyFrameVector2 key_frame)

Adds a height keyframe to the animation.

Parameters
[in]key_frameThe keyframe to add.

◆ AddRotationKeyFrame()

void UiAnimation::AddRotationKeyFrame ( const UiKeyFrameFloat key_frame)

Adds a rotation keyframe to the animation.

Parameters
[in]key_frameThe keyframe to add.

◆ AddScaleKeyFrame()

void UiAnimation::AddScaleKeyFrame ( const UiKeyFrameVector2 key_frame)

Adds a scale keyframe to the animation.

Parameters
[in]key_frameThe keyframe to add.

◆ AddScissorKeyFrame()

void UiAnimation::AddScissorKeyFrame ( const UiKeyFrameVector2 x1,
const UiKeyFrameVector2 y1,
const UiKeyFrameVector2 x2,
const UiKeyFrameVector2 y2 
)

Adds an scissor keyframe to the animation.

Parameters
[in]x1
Todo:
Understand and document.
Parameters
[in]y1
Todo:
Understand and document.
Parameters
[in]x2
Todo:
Understand and document.
Parameters
[in]y2
Todo:

Understand and document.

What is an scissor keyframe?.

◆ AddTime()

void UiAnimation::AddTime ( const float  time)

Adds time to the animation and updates it.

Parameters
[in]timeTime to add, in seconds.

◆ AddWidthKeyFrame()

void UiAnimation::AddWidthKeyFrame ( const UiKeyFrameVector2 key_frame)

Adds a width keyframe to the animation.

Parameters
[in]key_frameThe keyframe to add.

◆ AddXKeyFrame()

void UiAnimation::AddXKeyFrame ( const UiKeyFrameVector2 key_frame)

Adds a X position keyframe to the animation.

Parameters
[in]key_frameThe keyframe to add.

◆ AddYKeyFrame()

void UiAnimation::AddYKeyFrame ( const UiKeyFrameVector2 key_frame)

Adds a Y position keyframe to the animation.

Parameters
[in]key_frameThe keyframe to add.

◆ GetLength()

float UiAnimation::GetLength ( ) const

Retrieves the animation length.

Returns
The animation length, in seconds.

◆ GetName()

const Ogre::String & UiAnimation::GetName ( ) const

Retrieves the animation name.

Returns
The animation name.

◆ GetTime()

float UiAnimation::GetTime ( ) const

Retrieves the animation current time.

Returns
The animation current time.

◆ KeyFrameGetValue() [1/2]

float UiAnimation::KeyFrameGetValue ( std::vector< UiKeyFrameFloat > &  data)
private

Gets the value from asee UiKeyFrameFloat}.

Returns
The value of the keyframe.

◆ KeyFrameGetValue() [2/2]

Ogre::Vector2 UiAnimation::KeyFrameGetValue ( std::vector< UiKeyFrameVector2 > &  data)
private

Gets the value from asee UiKeyFrameVector2}.

Returns
The value of the keyframe.

◆ SetLength()

void UiAnimation::SetLength ( const float  time)

Sets the animation length.

Parameters
[in]timeThe animation length, in seconds.

◆ SetTime()

void UiAnimation::SetTime ( const float  time)

Sets the time of the animation and updates it.

Parameters
[in]timeThe time of the animation.

Member Data Documentation

◆ alpha_

std::vector<UiKeyFrameFloat> UiAnimation::alpha_
private

List of alpha keyframes.

◆ height_

std::vector<UiKeyFrameVector2> UiAnimation::height_
private

List of height keyframes.

◆ length_

float UiAnimation::length_
private

The animation length.

◆ name_

Ogre::String UiAnimation::name_
private

The UI animation name.

◆ rotation_

std::vector<UiKeyFrameFloat> UiAnimation::rotation_
private

List of rotation keyframes.

◆ scale_

std::vector<UiKeyFrameVector2> UiAnimation::scale_
private

List of scale keyframes.

◆ scissor_x_bottom_

std::vector<UiKeyFrameVector2> UiAnimation::scissor_x_bottom_
private
Todo:
Understand and document.

◆ scissor_x_top_

std::vector<UiKeyFrameVector2> UiAnimation::scissor_x_top_
private
Todo:
Understand and document.

◆ scissor_y_left_

std::vector<UiKeyFrameVector2> UiAnimation::scissor_y_left_
private
Todo:
Understand and document.

◆ scissor_y_right_

std::vector<UiKeyFrameVector2> UiAnimation::scissor_y_right_
private
Todo:
Understand and document.

◆ time_

float UiAnimation::time_
private

The animation's current time.

◆ widget_

UiWidget* UiAnimation::widget_
private

The UI widget.

◆ width_

std::vector<UiKeyFrameVector2> UiAnimation::width_
private

List of width keyframes.

◆ x_

std::vector<UiKeyFrameVector2> UiAnimation::x_
private

List of X position keyframes.

◆ y_

std::vector<UiKeyFrameVector2> UiAnimation::y_
private

List of Y position keyframes.


The documentation for this class was generated from the following files: