FMX.AnimationDemoHD Sample
From RAD Studio Code Examples
This sample illustrates how to create HD animations with FireMonkey.
Contents |
Location
You can find the AnimationDemoHD sample project at:
- Start > Programs > Embarcadero RAD Studio XE3 > Samples and then navigate to FireMonkey\AnimationDemoHD
- Subversion Repository for Delphi: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE4/FireMonkey/AnimationDemoHD/
Description
This application uses several visual objects on a form and animates each of them with TColorAnimation, TFloatAnimation, TPathAnimation, and TBitmapAnimation.
How to Use the Sample
- Navigate to Start > Programs > Embarcadero RAD Studio XE3 > Samples and open AnimationDemoHD.dproj.
- Press F9 or choose Run > Run.
Classes
FireMonkey 2D Animation represents the main window of the sample. It contains the following components:
- Three TAniIndicator objects
- Seven TText objects
- A TEllipse
- Three TRectangle objects
- A TRoundRect
- A TPath
- A TImage
- A TColorAnimation
- Three TFloatAnimations
- Two TPathAnimations
- A TBitmapAnimation
Implementation
- The first FloatAnimation is subordinated to the ellipse, relating to the RotationAngle property. Its Loop property is set to True, in order to repeat the animation.
- The ColorAnimation is related to the first rectangle's Color.
- The second FloatAnimation is being handled by the second Rectangle, through its Opacity property.
- The TImage object handles the BitmapAnimation, through its IsMouseOver trigger.
- The third FloatAnimation relates to the third rectangle's Position.X property.
- The RoundRect and the sixth Text are animated on a sinusoidal PathAnimation, defined in the Path.Data property.
- The Path object is used for explicitly drawing the path for the PathAnimation.
- TAniIndicator objects are used for indicating motion or progress.
Note: The entire project is implemented at design time, using the Tool Palette and the Object Inspector.
Uses
- Using FireMonkey Animation Effects
- FMX.StdCtrls.TAniIndicator
- FMX.Objects.TText
- FMX.Objects.TEllipse
- FMX.Objects.TRectangle
- FMX.Objects.TRoundRect
- FMX.Objects.TPath
- FMX.Objects.TImage
- FMX.Ani.TColorAnimation
- FMX.Ani.TFloatAnimation
- FMX.Controls.TPathAnimation
- FMX.Ani.TBitmapAnimation