Einzelnen Beitrag anzeigen

Benutzerbild von Die Muhkuh
Die Muhkuh

Registriert seit: 21. Aug 2003
7.332 Beiträge
 
Delphi 2009 Professional
 
#1

DelphiX - Kapitel 4 - Animation wird nicht angezeigt

  Alt 30. Aug 2004, 13:20
Hi,


also, ich hab wie schon gesagt, das DelphiX Tut von Delphi-Treff vor mir liegen und möchte das machen. Bin jetzt bei Kapitel 4 bei den Animationen.

Ich hab alles 1:1 abgeschrieben, aber es geht nicht. Ich starte das Programm, danach wird die DXDraw Kompo schwarz und dann passiert nix mehr. Eigentlich sollte die Animation abgespielt werden. Tuts aber nicht.


Hier mal der Source:

Delphi-Quellcode:
TAnimation = class(TImageSprite);

var
  Form1: TForm1;
  Animation: TAnimation;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Animation := TAnimation.Create(DXSpriteEngine1.Engine);
  Animation.Image := Form1.DXImageList1.Items.Find('Animation');
  Animation.X := 0;
  Animation.Y := 0;
  Animation.Width := Animation.Image.Width;
  Animation.Height := Animation.Image.Height;
  Animation.AnimCount := 5;
  Animation.AnimLooped := True;
  Animation.AnimSpeed := 20/1000;
  Animation.AnimStart := 0;
end;

procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
begin
  DXSpriteEngine1.Move(1);
  DXDraw1.Surface.Fill(0);
  DXSpriteEngine1.Draw;
  DXDraw1.Flip;
end;

Hatte jemand das selbe problem? Wenn ja, wie hast Du es gelöst?
Oder weiß sonst jemand rat?

*MFG*

Manu
  Mit Zitat antworten Zitat