sav
sav

Reputation: 2150

How to change the color of TCylinder in Delphi Firemonkey

I can create a Cylinder

Img: TControl3D;
Img := TCylinder.Create(nil);

however Img does not seem to have a colour property. Even when I cast it as a cylinder. It seems to be defaulting to red. Also the object inspector does not have a colour property for cylinders either.

Upvotes: 1

Views: 464

Answers (1)

rsrx
rsrx

Reputation: 1473

Each 3D shape object has MaterialSource property - use it to give your shape color/texture.

If you want to set shape material to solid colour, use TColorMaterialSource component, set color that you want, and link it to the shape's MaterialSource property.

Upvotes: 3

Related Questions