Autor Beitrag
Freezer-X
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

Win XP
d7 pers
BeitragVerfasst: Di 27.07.04 12:21 
Wie schon in der Überschrift beschrieben hab ich das Problem das wenn ich eine Animation in eine Endlosschleife reinmache am ende der Animation diese kurz verschwindet (aber merklich) verschwindet, bevor sie wieder von vorne anfängt. Ich bin nach dem Tutorial auf Delphi-Treff für DelphiX vorgegangen. Die Framerate will ich nicht erhöhen da dadurch die Animation zu schnell abläuft.
Dr. Phil
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 66

Win XP
Delphi 7 Prof.
BeitragVerfasst: Di 27.07.04 12:24 
Ja das hatte ich auch einmal, ich weiß aber nichtmehr wie ich das gelöst habe...


Ich glaube es hat gereicht dass ich eine Schleifenvariable bei 1 statt bei 0 hab anfangen lassen, bin mir aber nichtmehr sicher ;)

_________________
self-improvement is masturbation;
self-destruction is the answer - Tyler Durden
Freezer-X Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

Win XP
d7 pers
BeitragVerfasst: Di 27.07.04 14:26 
Ne hat leider nicht geklappt deshalb hier mal der code
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
begin
if not DXDraw1.CanDraw then exit;

DXimagelist1.Items.find('BG').Draw(DXDraw1.Surface,0,0,0);
DXspriteengine1.Move(1);
DxSpriteengine1.Draw;
DXdraw1.Flip;

Animation.X:=X;
Animation.Y:=y;
y:=y+1;

If y>=dxdraw1.SurfaceHeight-dximagelist1.Items[1].Width then
  begin
    y:=0;
    X:= random(Dxdraw1.SurfaceWidth);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Animation:=Tanimation.Create(DXspriteengine1.Engine);
Animation.Image:= Form1.DXimagelist1.Items.Find('ai');
Animation.x:=0;
Animation.Y:=0;
Animation.Width:=Animation.Image.Width;
Animation.Height:=Animation.Image.Height;
Animation.AnimCount:=12;
Animation.AnimLooped:=True;
Animation.AnimSpeed:=100/1000;
Animation.AnimStart:=0;
end;
Dr. Phil
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 66

Win XP
Delphi 7 Prof.
BeitragVerfasst: Di 27.07.04 15:03 
Und wenn du AnimCount runtersetzt?

_________________
self-improvement is masturbation;
self-destruction is the answer - Tyler Durden
Freezer-X Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

Win XP
d7 pers
BeitragVerfasst: Di 27.07.04 20:43 
Ähm ne dann werden ja nicht mehr alle Animationen durchgeführt, denn Animcount gibt an wieviel Bilder vorhanden sind
Dr. Phil
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 66

Win XP
Delphi 7 Prof.
BeitragVerfasst: Di 27.07.04 21:35 
Schon klar, aber vielleicht liegt der Fehler darin, dass es von 0 - 11 Bilder sind, und das schwarze folglich schwarz ist. Ansonsten hab ich auch keine genaue Vorstellung...

_________________
self-improvement is masturbation;
self-destruction is the answer - Tyler Durden
Freezer-X Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

Win XP
d7 pers
BeitragVerfasst: Mi 28.07.04 09:40 
Ok hast recht daran lag es mit, da ich alle animationen in einem bild hatte und das unsauber eingeteilt war, blieben zum schluss wahrscheinlich noch ein paar pixel über, und durch die die Angabe von 13 animationen (Animecount:=12)wurden die letzten paar pixel als bild angesehen.