W jaki sposób przyspieszyć wykonanie nastepujacej czynnosci:
procedure TForm1.FormCreate(Sender: TObject);
begin
form1.Width:=screen.Width;
form1.Height:=screen.Height;
Animation := TAnimation.Create(DXSpriteEngine1.Engine);
Animation.Image := Form1.DXImageList1.Items.Find('droga');
Animation.X := (screen.Width - 400) div 2;
Animation.Y := 0;
Animation.Width := Animation.Image.Width;
Animation.Height := Animation.Image.Height;
Animation.AnimCount := 5;
Animation.AnimLooped := True;
Animation.AnimSpeed := 700/1000;
Animation.AnimStart := 0;
end;
procedure TForm1.DXTimer1Activate(Sender: TObject);
begin
DXDraw1.Surface.Fill(0);
DXSpriteEngine1.Draw;
DXDraw1.Flip;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Animation.Y:= Animation.Y + 5;
DXDraw1.Surface.Fill(0);
DXSpriteEngine1.Draw;
DXDraw1.Flip;
end;
Obiekt, który jest animowany porusza się bardzo wolno. Zmieniałem wszystko włącznie z : Interval - w Timerach, Anim.Speed też i nic. W jaki sposób przyspieszyć to wszystko ?