FMX.GUI3d Sample
This sample is a demonstration of how to build 3D Graphical User Interface (GUI) applications.
Contents
Location
You can find the GUI3d sample project at:
- Start | Programs | Embarcadero RAD Studio Athens | Samples and then navigate to:
CPP\Multi-Device Samples\User Interface\GUI3d
- Subversion Repository:
- You can find C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.
Description
The GUI3d sample demonstrates how to build 3D GUI applications. The sample uses a 3D layer that holds a 2D button. The button, which has a TGlow effect attached, enables a float animation.
How to Use the Sample
- Navigate to the location given above and open GUI3dCPP.cbproj.
- Select the target platform.
- Press F9 or choose Run > Run.
- Interact with the sample: left-click on the button labeled as Flip to activate the animation.
Files
File in C++ | Contains |
---|---|
GUI3dCPP.cbproj |
The project itself. |
Unit1.fmx |
The main form where the components are located. |
GUI3dCPPCH.h, Unit1.cpp |
Used to define and implement the sample. |
Classes
TForm3D1 is the main form that represents the main window of the sample. It contains the following components:
- A TLayer3D object that contains:
- A TButton object that contains:
- A TGlowEffect object that contains:
- A TFloatAnimation object.
- A TGlowEffect object that contains:
- A TButton object that contains:
Implementation
- The sample uses TLayer3D to hold any 2D object in a FireMonkey 3D form.
- The sample uses TButton to enable the TFloatAnimation.
- The sample uses TGlowEffect to create a glow effect around the TButton.
- The sample uses TFloatAnimation to define an animation.
When you run the application, you see a button labeled as Flip. The button has a glow effect attached with the GlowColor property set to Gold
. When you click on the button, an OnClick event occurs. The OnClick event animates the 3D layer. The sample uses
the AnimateFloat and AnimateFloatDelay methods of the TFmxObject class to define three different animations for the 3D Layer object.
Uses
See Also
Samples
- FireMonkey HD Animation sample
- FireMonkey Low Level 3D sample
- FireMonkey Arrows 3D sample
- FireMonkey TFmxObject AnimateFloat (C++)
- FireMonkey Attach TAnimation (C++)