0

I have a cylinder

Cylinder1 : TCylinder;

and I want it to change colour when I click on it. I've added this to the on click event

procedure TfrmFiremonkey.Cylinder1Click(Sender: TObject);
begin
    Cylinder1.MaterialSource := GreenMaterial;
end;

The cylinder does not change colour. However it will change colour if I set Cylinder1.MaterialSource before I call the form.Show event

I suspect the reason its not showing is because Cylinder1Click is happening in a different thread.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
sav
  • 2,064
  • 5
  • 25
  • 45

1 Answers1

0

I have discovered that

procedure TfrmFiremonkey.Cylinder1Click(Sender: TObject);
begin
    TColorMaterialSource(Cylinder1.MaterialSource).Color := claBlue;
end;

Works fine

sav
  • 2,064
  • 5
  • 25
  • 45