I’ve a question about Delphi FMX TRectangle object.
I’m trying to animate the dashed border of a TRectangle but I can’t do it.
I’ve written this code inside a OnCreate Event of a form:
Rectangle1.Stroke.Kind := TBrushKind.Solid;
Rectangle1.Stroke.Dash := TStrokeDash.Dash;
Rectangle1.Stroke.Color := TAlphaColors.Red;
Rectangle1.Stroke.Thickness := 2;
// Configura l'animazione del bordo
FloatAnimation1.Parent := Rectangle1;
FloatAnimation1.PropertyName := 'StrokeDashOffset';
FloatAnimation1.StartValue := 0;
FloatAnimation1.StopValue := 20;
FloatAnimation1.Duration := 1;
FloatAnimation1.Loop := True;
FloatAnimation1.AnimationType := TAnimationType.InOut;
FloatAnimation1.Interpolation := TInterpolationType.Linear;
FloatAnimation1.Start;
On the form there are a TrectangleObject and a TFloatAnimation object that should animate the rectangle but when I run the program I can see no animation.
Is the first time I write a Delphi FMX application because usually I develop with VCL.
Can someone tell me what is wrong in this piece of code? I obtain a dash red border but no animation.