Class AlphaFunction
Definition
- Assembly:
- Tizen.NUI.dll
Alpha functions are used in animations to specify the rate of change of the animation parameter over time.
Understanding an animation as a parametric function over time, the alpha function is applied to the parameter of
the animation before computing the final animation value.
C#Copypublic class AlphaFunction : Disposable, IDisposable
- Inheritance
- Implements
-
System.IDisposable
Examples
CopyView view = new View() { Size2D = new Size2D(100, 100), Position2D = new Position2D(100, 100), BackgroundColor = Color.Red, }; Window.Default.Add(view); Animation animation = new Animation(); const float destinationValue = 300.0f; const int startTime = 0; // animation starts at 0 second point. no delay. const int endTime = 5000; // animation ends at 5 second point. animation.AnimateTo(view, "PositionX", destinationValue, startTime, endTime, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseIn)); animation.Play();
Constructors
AlphaFunction()
The default constructor.
Creates an alpha function object with the default built-in alpha function.
Declaration
C#Copypublic AlphaFunction()
AlphaFunction(Delegate)
The constructor.
Creates an alpha function object with the user-defined alpha function.
Declaration
C#Copypublic AlphaFunction(Delegate func)
Parameters
Type | Name | Description |
---|---|---|
System.Delegate | func | User defined function. It must be a method formatted as float alphafunction(float progress) |
Remarks
Alpha function called at seperated thread with main thread. Due to the disposed infomation is not send to seperated thread, Given function might be invoked even if animation class or alpha functoin itself disposed.
AlphaFunction(BuiltinFunctions)
The constructor.
Creates an alpha function object with the built-in alpha function passed as a parameter to the constructor.
Declaration
C#Copypublic AlphaFunction(AlphaFunction.BuiltinFunctions function)
Parameters
Type | Name | Description |
---|---|---|
AlphaFunction.BuiltinFunctions | function | One of the built-in alpha functions. |
AlphaFunction(Vector2, Vector2)
The constructor.
Creates a bezier alpha function. The bezier will have the first point at (0,0) and the end point at (1,1).
Declaration
C#Copypublic AlphaFunction(Vector2 controlPoint0, Vector2 controlPoint1)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | controlPoint0 | A Vector2 which will be used as the first control point of the curve. |
Vector2 | controlPoint1 | A Vector2 which will be used as the second control point of the curve. |
Remarks
The x components of the control points will be clamped to the range [0, 1] to prevent non-monotonic curves.
Methods
GetBezierControlPoints(out Vector2, out Vector2)
Retrieves the control points of the alpha function.
Declaration
C#Copypublic void GetBezierControlPoints(out Vector2 controlPoint0, out Vector2 controlPoint1)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | controlPoint0 | A Vector2 which will be used as the first control point of the curve. |
Vector2 | controlPoint1 | A Vector2 which will be used as the second control point of the curve. |
GetBuiltinFunction()
Returns the built-in function used by the alpha function.
In case no built-in function has been specified, it will return AlphaFunction::DEFAULT.
Declaration
C#Copypublic AlphaFunction.BuiltinFunctions GetBuiltinFunction()
Returns
Type | Description |
---|---|
AlphaFunction.BuiltinFunctions | One of the built-in alpha functions. |
Declaration
C#Copypublic AlphaFunction.Modes GetMode()
Returns
Type | Description |
---|---|
AlphaFunction.Modes | The functioning mode of the alpha function. |