Jump to content
Felix.

AnimateFloat: how to change X and Y simultaneously?

Recommended Posts

I use this code (Delphi 10.4, Firemonkey, Android):

procedure TForm1.MoveButtonClick(Sender: TObject);
begin
  var
  Time := 1.0;
  var
  P := Image1.Position.Point + TPointF.Create(200, 100);
  TAnimator.AnimateFloat(Image1, 'Position.X', P.X, Time);
  TAnimator.AnimateFloat(Image1, 'Position.Y', P.Y, Time);
end;

The question is how can I change Position.X and Position.Y simultaneously, so I can use it with AnimateFloatWait?

There's an important procedure after animation that executes immediately (i.e. doesn't wait for the end of animation).

I tried to use in thread, but also with success.

Share this post


Link to post

You could assign an Event, and process more property than one inside.

 

BTW:  FMX.Types.TFmxObject.AnimateFloat is deprecated.

Edited by Rollo62

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×