Vous êtes sur la page 1sur 4

Creating the User Interface (FireMonkey 3D Tutorial) - RAD Studio

http://docwiki.embarcadero.com/RADStudio/XE5/en/Creating_the_User_...

Show: Delphi C++ Display Preferences

Creating the User Interface (FireMonkey 3D Tutorial)


From RAD Studio Go Up to Tutorial: Creating a FireMonkey 3D Application

Contents
1 Creating a FireMonkey 3D Application 2 Adding and Adjusting Components 3 Next 4 See Also

Creating a FireMonkey 3D Application


1. Select File > New > FireMonkey Desktop Application - Delphi > From the FireMonkey Desktop Application wizard, choose 3D FireMonkey Application and press the OK button. 2. The FireMonkey Form Designer appears, displaying a FMX.Forms.TForm3D.

Adding and Adjusting Components


1. From the Tool Palette, add the following FireMonkey 3D components (by entering the component name in the Search field and pressing Return): A TLight Two TCube

1 of 4

12/23/2013 5:01 PM

Creating the User Interface (FireMonkey 3D Tutorial) - RAD Studio

http://docwiki.embarcadero.com/RADStudio/XE5/en/Creating_the_User_...

3D Form.png

2. In the FireMonkey Form Designer , adjust the position and size of the FireMonkey 3D components to suit your needs: To move an object, simply drag and drop. To rotate a 3D component, use the three blue handles that appear when you click the component. Each handle rotates the component in the associated plane in space (that is, the x, y, or z vertex). When you click a handle, it becomes red to indicate that it is the active handle. Note: You can also use the RotationAngle properties in the Object Inspector (x, y, and z). To resize a component, use the resizer control, which is a small blue cube located on one corner of the component. The resizer works in one dimension at a time; the resizer is red on the side of the cube that is the selected (active) dimension. Note: You can also use the properties in the Object Inspector (for TCube, the size-related properties are Depth, Width, and Height). 3. To change the material of the two cubes: 1. Add a TTextureMaterialSource to the form. In the Object Inspector, using TTextureMaterialSource, adjust the Texture property by clicking ellipsis [] >Edit. The Bitmap Editor wizard opens. Click the Load button of the Bitmap Editor to load the wanted texture. After loading the texture, click the OK button on the Bitmap Editor. In the Object Inspector, with the first cube in focus, adjust the MaterialSource property by clicking ellipsis [] > and choose the added TTextureMaterialSource from the list. TTextureMaterialSource only adds texture to the cube. 2. Add a TLightMaterialSource to the form. To specify the color and texture of the material, use the TLightMaterialSource properties. In the Object Inspector, using TLightMaterialSource: Adjust the Texture property by clicking ellipsis [] >Edit. The Bitmap Editor wizard opens. Click the Load button on the Bitmap Editor to load the wanted texture. After loading the texture, click the OK button on the Bitmap Editor. Ambient, Diffuse, Emissive, and Specular are set by default like in the following image.

2 of 4

12/23/2013 5:01 PM

Creating the User Interface (FireMonkey 3D Tutorial) - RAD Studio

http://docwiki.embarcadero.com/RADStudio/XE5/en/Creating_the_User_...

4. The result at design time is shown in the following image.

5. At this point, you can click F9 to compile, build, and run your first FireMonkey 3D application.

3 of 4

12/23/2013 5:01 PM

Creating the User Interface (FireMonkey 3D Tutorial) - RAD Studio

http://docwiki.embarcadero.com/RADStudio/XE5/en/Creating_the_User_...

Next
Creating a 2D Interface in a 3D Application (FireMonkey 3D Tutorial)

See Also
Creating a FireMonkey Component (Delphi) Creating a FireMonkey Component (C++) 3D FireMonkey Application Retrieved from "http://docwiki.embarcadero.com/RADStudio/XE5/e /index.php?title=Creating_the_User_Interface_(FireMonkey_3D_Tutorial)&oldid=210725" Categories: Delphi C++ This page was last modified on 25 October 2013, at 17:15. Help Feedback

4 of 4

12/23/2013 5:01 PM

Vous aimerez peut-être aussi