Detailed Description

Handles all actively animated css properties. Also keeps track of a single set of css properties as used in any animate method (PowerUI.HtmlElement.animate) and can be used to monitor the progress of an animation.

Public Member Functions

 UIAnimation (Element animating, string properties, float duration, Blaze.VectorPath timeCurve)
 Creates a new UIAnimation for animating CSS and immediately animates it. See PowerUI.HtmlElement.animate. More...
 
 UIAnimation (Element animating, Style properties, float duration, Blaze.VectorPath timeCurve)
 Creates an animation with the given style as the set of target properties. More...
 
void Finished ()
 Called when this animation is finished. More...
 
void OnDone (DynamicMethod< Nitro.Void > method)
 Calls the given function when the animation is over. More...
 
void OnDone (AnimationCompleted onComplete)
 Calls the given delegate when the animation is over. More...
 
void Stop ()
 Call this to halt the animation early. This internally will cause the finished event to run. More...
 
void Stop (bool runEvent)
 Call this to halt the animation early. More...
 

Static Public Member Functions

static void Clear ()
 Removes all active animations. More...
 
static void Update (float frameTime)
 Called at the UI update rate to progress the currently animated properties. More...
 
static AnimatedProperty GetAnimatedProperty (Element animating, string property)
 Searches the current animated properties for the named property on the given element. More...
 
static AnimatedProperty GetAnimatedProperty (Element animating, CssProperty property)
 Searches the current animated properties for the named property on the given element. More...
 

Public Attributes

object Data
 A custom data object. More...
 
Element Animating
 The element being animated. More...
 
ComputedStyle ComputedStyle
 The CS for the element being animated. More...
 
float Duration
 The time in seconds that the animation will run for. More...
 
bool Paused
 True if this animation is paused. More...
 
Blaze.VectorPath TimeCurve
 A curve which describes the progression of the animation. x is time, y is value. Usually (0,0) to (1,1). More...
 
UIAnimation NextAnimation
 All current animations are stored in a linked list. This is the next one. More...
 
AnimationCompleted OnComplete
 The method to call (a c# or JS method) when the animation is done playing. More...
 
DynamicMethod< Nitro.VoidDone
 The dynamic method (a nitro function) to call when this animation is done. More...
 

Static Public Attributes

static AnimatedProperty LastProperty
 Actively animated properties are stored in a linked list. This is the tail of that list. More...
 
static AnimatedProperty FirstProperty
 Actively animated properties are stored in a linked list. This is the head of that list. More...
 

Properties

float TotalTime [get]
 The total time in seconds that this animation lasts for. More...
 

Private Member Functions

void Setup (Element animating, Style style, float duration, Blaze.VectorPath timeCurve)
 Sets up general information for a particular animation and starts running it. More...
 
void AnimateTransform (Css.Value value)
 Special case when animating CSS transform. More...
 
void Animate (CssProperty property, Css.Value value, bool updateCss)
 Starts animating the named property and target value. More...
 

Private Attributes

bool FinishedPlaying
 True if this animation has finished; false otherwise. More...
 

Constructor & Destructor Documentation

PowerUI.UIAnimation.UIAnimation ( Element  animating,
string  properties,
float  duration,
Blaze.VectorPath  timeCurve 
)
inline

Creates a new UIAnimation for animating CSS and immediately animates it. See PowerUI.HtmlElement.animate.

Parameters
animatingThe element being animated.
propertiesThe CSS property string. Each property should define the value it will be when the animation is done.
durationHow long this animation lasts for.
timeCurveA curve used to describe animation progression.
PowerUI.UIAnimation.UIAnimation ( Element  animating,
Style  properties,
float  duration,
Blaze.VectorPath  timeCurve 
)
inline

Creates an animation with the given style as the set of target properties.

Member Function Documentation

void PowerUI.UIAnimation.Animate ( CssProperty  property,
Css.Value  value,
bool  updateCss 
)
inlineprivate

Starts animating the named property and target value.

Parameters
propertyThe property to update. May be an alias or composite.
valueThe target value of the property.
updateCssTrue if this property should update CSS/ the screen when it's progressed.
void PowerUI.UIAnimation.AnimateTransform ( Css.Value  value)
inlineprivate

Special case when animating CSS transform.

static void PowerUI.UIAnimation.Clear ( )
inlinestatic

Removes all active animations.

void PowerUI.UIAnimation.Finished ( )
inline

Called when this animation is finished.

static AnimatedProperty PowerUI.UIAnimation.GetAnimatedProperty ( Element  animating,
string  property 
)
inlinestatic

Searches the current animated properties for the named property on the given element.

Parameters
animatingThe element being animated.
propertyThe CSS property to look for. Note: Must not be a composite property such as color-overlay. Must be a full property such as color-overlay-r.
Returns
An AnimatedProperty if it was found; Null otherwise.
static AnimatedProperty PowerUI.UIAnimation.GetAnimatedProperty ( Element  animating,
CssProperty  property 
)
inlinestatic

Searches the current animated properties for the named property on the given element.

Parameters
animatingThe element being animated.
propertyThe CSS property to look for.
Returns
An AnimatedProperty if it was found; Null otherwise.
void PowerUI.UIAnimation.OnDone ( DynamicMethod< Nitro.Void method)
inline

Calls the given function when the animation is over.

void PowerUI.UIAnimation.OnDone ( AnimationCompleted  onComplete)
inline

Calls the given delegate when the animation is over.

void PowerUI.UIAnimation.Setup ( Element  animating,
Style  style,
float  duration,
Blaze.VectorPath  timeCurve 
)
inlineprivate

Sets up general information for a particular animation and starts running it.

void PowerUI.UIAnimation.Stop ( )
inline

Call this to halt the animation early. This internally will cause the finished event to run.

void PowerUI.UIAnimation.Stop ( bool  runEvent)
inline

Call this to halt the animation early.

Parameters
runEventOptionally run the finished event if there is one.
static void PowerUI.UIAnimation.Update ( float  frameTime)
inlinestatic

Called at the UI update rate to progress the currently animated properties.

Member Data Documentation

Element PowerUI.UIAnimation.Animating

The element being animated.

ComputedStyle PowerUI.UIAnimation.ComputedStyle

The CS for the element being animated.

object PowerUI.UIAnimation.Data

A custom data object.

DynamicMethod<Nitro.Void> PowerUI.UIAnimation.Done

The dynamic method (a nitro function) to call when this animation is done.

float PowerUI.UIAnimation.Duration

The time in seconds that the animation will run for.

bool PowerUI.UIAnimation.FinishedPlaying
private

True if this animation has finished; false otherwise.

AnimatedProperty PowerUI.UIAnimation.FirstProperty
static

Actively animated properties are stored in a linked list. This is the head of that list.

AnimatedProperty PowerUI.UIAnimation.LastProperty
static

Actively animated properties are stored in a linked list. This is the tail of that list.

UIAnimation PowerUI.UIAnimation.NextAnimation

All current animations are stored in a linked list. This is the next one.

AnimationCompleted PowerUI.UIAnimation.OnComplete

The method to call (a c# or JS method) when the animation is done playing.

bool PowerUI.UIAnimation.Paused

True if this animation is paused.

Blaze.VectorPath PowerUI.UIAnimation.TimeCurve

A curve which describes the progression of the animation. x is time, y is value. Usually (0,0) to (1,1).

Property Documentation

float PowerUI.UIAnimation.TotalTime
get

The total time in seconds that this animation lasts for.