Jump to content

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

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...