From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 20: | Line 20: | ||
= See Also= | = See Also= | ||
* [[ClAnimateFloatWait | ClAnimateFloatWait]] | * [[ClAnimateFloatWait | ClAnimateFloatWait]] | ||
* [[ClAnimateFloatDelay | ClAnimateFloatDelay]] | |||
Revision as of 08:39, 18 September 2023
Clomosy's clAnimateFloat is a procedure that allows a TComponent derived component's properties to smoothly transition from one value to another over a specified period of time. This procedure is particularly useful when creating animated transitions for graphical user interface (GUI) elements or adding visual effects.
The general usage is as follows:
clAnimateFloat(MyControl,PropertyName,TargetValue,Duration,TAnimationType.In,TInterpolationType.Linear);
- MyControl: Represents the control or component that is the target of the animation.
- PropertyName: Specifies the name of the property to which the animation will be applied.
- TargetValue: Specifies the target value that the property should reach at the end of the animation.
- Duration: Specifies the duration of the animation in seconds.
- TAnimationType.In: It is one of the animation types and typically represents an animation type that involves an increase in a value or the visibility of a specific property.
- TInterpolationType.Linear: It is used to control the smooth transition of values in animations.
For example, you can use the following code to animate the opacity of a button:
clAnimateFloat(nextBtn,'Opacity',1, 1,0,0);
This code aims to make the opacity of the button named nextBtn completely opaque.