Class Animation
Definition
- Namespace:
- Tizen.NUI
- Assembly:
- Tizen.NUI.dll
- API Level:
- 3
Animation can be used to animate the properties of any number of objects, typically view.
If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.
This is typically done in the object destructor, and requires either the animation handle to be stored.
The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.
If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.
C#Copypublic class Animation : BaseHandle, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable
- Inheritance
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
Constructors
Animation()
Creates an initialized animation.
The animation will not loop.
The default end action is "Cancel".
The default alpha function is linear.
Declaration
C#Copypublic Animation()
API Level: 3
Animation(Int32)
Creates an initialized animation.
The animation will not loop.
The default end action is "Cancel".
The default alpha function is linear.
Declaration
C#Copypublic Animation(int durationMilliSeconds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | durationMilliSeconds | The duration in milliseconds. |
Remarks
DurationmSeconds must be greater than zero.
API Level: 3
Properties
CurrentLoop
Gets the current loop count.
A value 0 indicating the current loop count when looping.
Declaration
C#Copypublic int CurrentLoop { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: 3
CurrentProgress
Gets or sets the progress of the animation.
The animation will play (or continue playing) from this point.
The progress must be in the 0-1 interval or in the play range interval if defined
otherwise, it will be ignored.
Declaration
C#Copypublic float CurrentProgress { get; set; }
Property Value
Type | Description |
---|---|
Single |
API Level: 3
Declaration
C#Copypublic AlphaFunction DefaultAlphaFunction { get; set; }
Property Value
Type | Description |
---|---|
AlphaFunction |
API Level: 3
Declaration
C#Copypublic string[] DestValue { get; set; }
Property Value
Type | Description |
---|---|
System.String[] |
DisconnectAction
Gets or sets the disconnect action.
If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.
The default action is cancel.
Declaration
C#Copypublic Animation.EndActions DisconnectAction { get; set; }
Property Value
Type | Description |
---|---|
Animation.EndActions |
API Level: 3
Declaration
C#Copypublic int Duration { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: 3
EndAction
Gets or sets the end action of the animation.
This action is performed when the animation ends or if it is stopped.
The default end action is cancel.
Declaration
C#Copypublic Animation.EndActions EndAction { get; set; }
Property Value
Type | Description |
---|---|
Animation.EndActions |
API Level: 3
Declaration
C#Copypublic int[] EndTime { get; set; }
Property Value
Type | Description |
---|---|
System.Int32[] |
LoopCount
Set: Enables looping for a specified number of repeats. A zero is the same as Looping = true; i.e., repeat forever.
This property resets the looping value and should not be used with the Looping property.
Setting this parameter does not cause the animation to Play().
Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.
The loop count is initially 1 for play once.
Declaration
C#Copypublic int LoopCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
API Level: 3
Looping
Gets or sets the status of whether the animation will loop.
This property resets the loop count and should not be used with the LoopCount property.
Setting this parameter does not cause the animation to Play().
Declaration
C#Copypublic bool Looping { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
API Level: 3
PlayRange
Gets or sets the playing range.
Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.
Declaration
C#Copypublic RelativeVector2 PlayRange { get; set; }
Property Value
Type | Description |
---|---|
RelativeVector2 |
API Level: 3
ProgressNotification
Gets or sets the progress notification marker which triggers the ProgressReachedSignal.
Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30%
One notification can be set on each animation.
Declaration
C#Copypublic float ProgressNotification { get; set; }
Property Value
Type | Description |
---|---|
Single |
API Level: 3
Declaration
C#Copypublic string[] Properties { get; set; }
Property Value
Type | Description |
---|---|
System.String[] |
SpeedFactor
Gets or sets specificifications of a speed factor for the animation.
The speed factor is a multiplier of the normal velocity of the animation.
Values between [0, 1] will slow down the animation and values above one will speed up the animation.
It is also possible to specify a negative multiplier to play the animation in reverse.
Declaration
C#Copypublic float SpeedFactor { get; set; }
Property Value
Type | Description |
---|---|
Single |
API Level: 3
Declaration
C#Copypublic int[] StartTime { get; set; }
Property Value
Type | Description |
---|---|
System.Int32[] |
Declaration
C#Copypublic Animation.States State { get; }
Property Value
Type | Description |
---|---|
Animation.States |
API Level: 3
Methods
AnimateBetween(View, String, KeyFrames, Int32, Int32, Animation.Interpolation, AlphaFunction)
Animates a property between keyframes.
Declaration
C#Copypublic void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Animation.Interpolation interpolation = Animation.Interpolation.Linear, AlphaFunction alphaFunction = null)
Parameters
Type | Name | Description |
---|---|---|
View | target | The target object to animate |
System.String | property | The target property to animate |
KeyFrames | keyFrames | The set of time/value pairs between which to animate |
System.Int32 | startTime | The start time of animation in milliseconds. |
System.Int32 | endTime | The end time of animation in milliseconds. |
Animation.Interpolation | interpolation | The method used to interpolate between values. |
AlphaFunction | alphaFunction | The alpha function to apply. |
API Level: 3
AnimateBetween(View, String, KeyFrames, Animation.Interpolation, AlphaFunction)
Animates a property between keyframes.
Declaration
C#Copypublic void AnimateBetween(View target, string property, KeyFrames keyFrames, Animation.Interpolation interpolation = Animation.Interpolation.Linear, AlphaFunction alphaFunction = null)
Parameters
Type | Name | Description |
---|---|---|
View | target | The target object to animate. |
System.String | property | The target property to animate. |
KeyFrames | keyFrames | The set of time or value pairs between which to animate. |
Animation.Interpolation | interpolation | The method used to interpolate between values. |
AlphaFunction | alphaFunction | The alpha function to apply. |
API Level: 3
AnimateBy(View, String, Object, Int32, Int32, AlphaFunction)
Animates a property value by a relative amount.
Declaration
C#Copypublic void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
Parameters
Type | Name | Description |
---|---|---|
View | target | The target object to animate. |
System.String | property | The target property to animate. |
System.Object | relativeValue | The property value will change by this amount. |
System.Int32 | startTime | The start time of the animation. |
System.Int32 | endTime | The end time of the animation. |
AlphaFunction | alphaFunction | The alpha function to apply. |
API Level: 3
AnimateBy(View, String, Object, AlphaFunction)
Animates a property value by a relative amount.
Declaration
C#Copypublic void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
Parameters
Type | Name | Description |
---|---|---|
View | target | The target object to animate. |
System.String | property | The target property to animate. |
System.Object | relativeValue | The property value will change by this amount. |
AlphaFunction | alphaFunction | The alpha function to apply. |
API Level: 3
AnimatePath(View, Path, Vector3, Int32, Int32, AlphaFunction)
Animates the view's position and orientation through a predefined path.
The view will rotate to orient the supplied forward vector with the path's tangent.
If forward is the zero vector then no rotation will happen.
Declaration
C#Copypublic void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
Parameters
Type | Name | Description |
---|---|---|
View | view | The view to animate. |
Path | path | It defines position and orientation. |
Vector3 | forward | The vector (in local space coordinate system) will be oriented with the path's tangent direction. |
System.Int32 | startTime | The start time of the animation. |
System.Int32 | endTime | The end time of the animation. |
AlphaFunction | alphaFunction | The alpha function to apply. |
API Level: 3
AnimatePath(View, Path, Vector3, AlphaFunction)
Animates the view's position and orientation through a predefined path.
The view will rotate to orient the supplied forward vector with the path's tangent.
If forward is the zero vector then no rotation will happen.
Declaration
C#Copypublic void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
Parameters
Type | Name | Description |
---|---|---|
View | view | The view to animate. |
Path | path | It defines position and orientation. |
Vector3 | forward | The vector (in local space coordinate system) will be oriented with the path's tangent direction. |
AlphaFunction | alphaFunction | The alpha function to apply. |
API Level: 3
AnimateTo(View, String, Object, Int32, Int32, AlphaFunction)
Animates a property to a destination value.
Declaration
C#Copypublic void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
Parameters
Type | Name | Description |
---|---|---|
View | target | The target object to animate. |
System.String | property | The target property to animate. |
System.Object | destinationValue | The destination value. |
System.Int32 | startTime | The start time of the animation. |
System.Int32 | endTime | The end time of the animation. |
AlphaFunction | alphaFunction | The alpha function to apply. |
API Level: 3
AnimateTo(View, String, Object, AlphaFunction)
Animates a property to a destination value.
Declaration
C#Copypublic void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
Parameters
Type | Name | Description |
---|---|---|
View | target | The target object to animate. |
System.String | property | The target property to animate. |
System.Object | destinationValue | The destination value. |
AlphaFunction | alphaFunction | The alpha function to apply. |
API Level: 3
Clear()
Clears the animation.
This disconnects any objects that were being animated, effectively stopping the animation.
Declaration
C#Copypublic void Clear()
API Level: 3
Declaration
C#Copyprotected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type |
Overrides
API Level: 3
DownCast(BaseHandle)
Downcasts a handle to animation handle.
If handle points to an animation object, the downcast produces a valid handle.
If not, the returned handle is left uninitialized.
Declaration
C#Copypublic static Animation DownCast(BaseHandle handle)
Parameters
Type | Name | Description |
---|---|---|
BaseHandle | handle | Handle to an object. |
Returns
Type | Description |
---|---|
Animation | Handle to an animation object or an uninitialized handle. |
API Level: 3
Declaration
C#Copypublic void Pause()
API Level: 3
Declaration
C#Copypublic void Play()
API Level: 3
PlayAfter(Int32)
Plays the animation after a given delay time.
The delay time is not included in the looping time.
When the delay time is a negative value, it would treat as play immediately.
Declaration
C#Copypublic void PlayAfter(int delayMilliseconds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | delayMilliseconds | The delay time. |
API Level: 4
Declaration
C#Copypublic void PlayAnimateTo(View target)
Parameters
Type | Name | Description |
---|---|---|
View | target | The target object to animate. |
PlayFrom(Single)
Plays the animation from a given point.
The progress must be in the 0-1 interval or in the play range interval if defined,
otherwise, it will be ignored.
Declaration
C#Copypublic void PlayFrom(float progress)
Parameters
Type | Name | Description |
---|---|---|
Single | progress | A value between [0,1], or between the play range if specified, from where the animation should start playing. |
API Level: 3
Declaration
C#Copypublic void Stop()
API Level: 3
Declaration
C#Copypublic void Stop(Animation.EndActions action = Animation.EndActions.Cancel)
Parameters
Type | Name | Description |
---|---|---|
Animation.EndActions | action | The end action can be set. |
API Level: 3
Events
Declaration
C#Copypublic event EventHandler Finished
Event Type
Type | Description |
---|---|
EventHandler |
API Level: 3
Declaration
C#Copypublic event EventHandler ProgressReached
Event Type
Type | Description |
---|---|
EventHandler |