Jump to content
Sign in to follow this  
IElite

Animations using TW3Animation ?

Recommended Posts

I can create a Rotation animation using the TRotateAnimation class

procedure TForm1.InitializeForm;
begin
  inherited;
  fAni.Start(nil);
end;

procedure TForm1.InitializeObject;
begin
  inherited;
  {$I 'Form1:impl'}
  fAniCfg:= TW3AnimationConfig.Create;
  fAniCfg.Loop:= True;
  fAniCfg.StartMode:= asImmediate;
  fAniCfg.OnCompleted:= nil;

fAni:= TRotateAnimation.Create( W3Panel1, 3000, fAniCfg, 90, 180);

end;
 
procedure TForm1.Resize;
begin
  inherited;
  fPanel.SetBounds((ClientWidth Div 2) - 50, (ClientHeight Div 2) - 50, 100, 100);
end;

 

but I can't seem to get the 

TMoveAnimation

or

 TOpacityAnimation

to work.  What am I doing wrong

I tried 

W3Panel1.Left:= 0; W3Panel1.Top:= 0;

fAni:= TMoveAnimation.Create( W3Panel1, 3000, fAniCfg, TPoint.create(ClientWidth, ClientHeight));

and

fAni:= TOpacityAnimation.Create( W3Panel1, 3000, fAniCfg,  100, 0);

or

fAni:= TOpacityAnimation.Create( fPanel, 3000, fAniCfg, 0, 100);

 

none of which works

What am I doing wrong

 

Share this post


Link to post
Share on other sites

@lennart

i do believe the Start procedure requires a param of type procedure

Syntax Error: Argument 0 expects type "procedure TW3AnimationFinishedEvent(TW3Animation)" instead of "TW3Panel" [line: 47, column: 18, file: Form1]
 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×