FMX.AnimationDemo3D Sample
From RAD Studio Code Examples
This sample illustrates how to create 3D animations using FireMonkey.
Contents |
Location
You can find the AnimationDemo3D sample project at:
- Start > Programs > Embarcadero RAD Studio XE3 > Samples and then navigate to FireMonkey\AnimationDemo3D
- Subversion Repository for Delphi: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE4/FireMonkey/AnimationDemo3D/
Description
This application uses several visual objects on a form and animates each of them with TColorAnimation and TFloatAnimation.
How to Use the Sample
- Navigate to Start > Programs > Embarcadero RAD Studio XE3 > Samples and open AnimationDemo3D.dproj.
- Press F9 or choose Run > Run.
Classes
FireMonkey 3D Animation is a TForm3D and represents the main window of the sample. It contains the following components:
- A TRoundCube
- A TStrokeCube
- A TCube
- A TLight
- Four TTextLayer3D objects
- Two TSphere objects
- A TPlane
- A TText3D
- A TLayer3D
- A TLayout
- A TPath
- A TText
- A TRoundRect
- Two TColorAnimations
- Four TFloatAnimations
- A TPathAnimations
Implementation
- The first FloatAnimation is related to the second Sphere's Opacity property.
- The second FloatAnimation is subordinated to the StrokeCube, relating to its RotationAngle.Y property.
- The RoundCube handles the third FloatAnimation through the Position.Z property.
- The first Sphere relates to the ColorAnimations, both of them being used for the Material.Diffuse property. IsMouseOver triggers the animations.
- The ObjectLayer contains a 2D animation of a RoundRect on a sinusoidal path.
- The Text3D object is animated by the fourth FloatAnimation through the RotationAngle.X property.
Note: The entire project is implemented at design time, using the Tool Palette and the Object Inspector.
Uses
- FMX.Objects3D.TRoundCube
- FMX.Objects3D.TStrokeCube
- FMX.Objects3D.TCube
- FMX.Controls3D.TLight
- FMX.Layers3D.TTextLayer3D
- FMX.Objects3D.TSphere
- FMX.Objects3D.TPlane
- FMX.Objects3D.TText3D
- FMX.Layers3D.TLayer3D
- FMX.Layouts.TLayout
- FMX.Objects.TPath
- FMX.Objects.TText
- FMX.Objects.TRoundRect
- FMX.Ani.TColorAnimations
- FMX.Ani.TFloatAnimations
- FMX.Ani.TPathAnimations