Autor Beitrag
sonic159
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Windows XP
BDS 2006 Professional
BeitragVerfasst: Di 03.10.06 17:41 
Hallo!

Ich versuche ein Programm zu entwickeln wo ein
Panel von A nach B fährt und wieder von B nach A,
und das immer wieder, und das ohne das das Programm abstürtzt oder
ständig am laden ist!

Ist das zuschafen?

MfG: sonic
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 03.10.06 17:47 
Du musst erstmal eine vestimmte Zeit definieren, in der das Panel die Strecke zurücklegen soll. Dann berechneste den x- und Y-Abstand. DAnn musst du den Wert durch die Anzahl einzelbilder teilen und halt in Variablen abspeichern. Dann brauchste nen Timer, der als Intervall Gesamtzeit / Anzahl bilder hat. Und dann machste einfach:
ausblenden Delphi-Quelltext
1:
2:
Panel.Left:=Panel.Left+XPerFrame;
Panel.Top:=Panel.Top+YPerFrame;

Und dann musste halt noch auswerten, ob das Panel die Zielposition erreicht hat, wenn ja musste einfach das Vorzeichen von XPerFrame und YPerFrame umdrehen.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
sonic159 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Windows XP
BDS 2006 Professional
BeitragVerfasst: Di 03.10.06 19:22 
Hey Danke!!