Can I use TAnimation without TFMXObject

  

I’m drawing my own shapes directly on a TCanvas in the onPaint event (i.e. I’m not using TShape). Can I use a TAnimation to animate elements in my drawing? I was hoping I’d find the current value as a property on TAnimation, or at least as an argument in the OnProcess event.

But it seems that TAnimation only can send it’s current value to a defined property in a TFMXObject.

Here is what I’d like do do if OnProcess would allow:

TDrawingController.OnFloatAnimationProcess(aCurrentValue: Single);
begin
FCurrentShape.Opacity:= aCurrentValue;
FCanvas.Repaint;
end;

I.e. I’d like to animate the opacity of one of the shapes in the list of shapes (FCurrentShape). FCurrentShape is not a TShape. It’s a proprietary object which takes care of its own drawing with drawLine, drawEllipse, etc.

More specifically, what I want from the TAnimation object is:
– The formulas for different animation types
– Calculations and timer in a separate thread, only synchronising when a new animation value is due.

Thanks.
//Michael

Comments are closed.