Thema: Delphi Problem mit dem Timer!?

Einzelnen Beitrag anzeigen

fedderle

Registriert seit: 3. Jan 2003
Ort: Reiskirchen
51 Beiträge
 
#10
  Alt 10. Jan 2003, 18:45
Zitat von lodda:
Schick mir mal die wichtigen Teile von deinem Programm.
Also Hier ist ein Auszug aus dem Programm!!

On Create von der Form "FormCredits":
Delphi-Quellcode:
procedure TFormCredits.FormCreate(Sender: TObject);
begin
   AssignFile(schrift, 'lauf.ste');
   Reset(schrift);
   randomize;
   k := 0;
   j := 0;
   i := 0;
   m := 0;
   n := 0;
   XLabel := -1;
   XLabel2 := -1;
   FormCredits.Player.play;
   FormCredits.TimerLabel1.Enabled := true;
   FormCredits.TimerLabel2.Enabled := true
end;
Auszug aus der Prozedur des ersten von den beiden Timer:
Delphi-Quellcode:
procedure TFormCredits.TimerLabel1Timer(Sender: TObject);
var l, o, p : integer;
begin
  Inc(XLabel);
   case XLabel of

...


     46: FormCredits.Label2.Caption := 'Patrick B ';
     47: FormCredits.Label2.Caption := 'Patric ';
     48: FormCredits.Label2.Caption := 'Pat ';
     49: begin FormCredits.Label2.Visible := false;
                FormCredits.TimerLabel1.Interval := 300;
                if i >= 3 then begin XLabel := 54;
                                     i := 0;
                                     FormCredits.TimerLabel1.Interval := 100
                               end
          end;
     50: begin FormCredits.Label1.Visible := true;
                FormCredits.Label2.Visible := true;
                FormCredits.TimerLabel1.Interval := 100
          end;
     51: FormCredits.Label2.Caption := 'Patric ';
     52: FormCredits.Label2.Caption := 'Patrick B ';
     53: FormCredits.Label2.Caption := 'Patrick Bor ';
     54: begin FormCredits.Label2.Caption := 'Patrick Borsch';
                FormCredits.TimerLabel1.Interval := 1600;
                if i <= 2 then begin XLabel := 44;
                                     Inc(i)
                               end
          end;
     55: begin FormCredits.ImageBack.Picture.LoadFromFile('Bilder\Bild2.jpg');
                FormCredits.TimerLabel1.Interval := 100
          end;
     56: begin FormCredits.Label4.Top := -15;
                FormCredits.Label4.Visible := true;
                FormCredits.Label3.Top := -75;
                FormCredits.Label3.Visible := true;
                FormCredits.Label2.Caption := 'Patrick Borsch';
                FormCredits.Label2.Top := -135;
                FormCredits.Label2.Visible := true;
                FormCredits.Label1.Caption := 'Idee';
                FormCredits.Label1.Top := -205;
                FormCredits.Label1.Visible := true;
                FormCredits.TimerLabel1.Interval := 1
          end;
     57: begin FormCredits.Label4.Top := FormCredits.Label4.Top + 2;
                FormCredits.Label3.Top := FormCredits.Label3.Top + 2;
                FormCredits.Label2.Top := FormCredits.Label2.Top + 2;
                FormCredits.Label1.Top := FormCredits.Label1.Top + 2;
                FormCredits.TimerLabel1.Interval := 5;
                Inc(i);
                if i < 370 then XLabel := 56 else i := 0
          end;
     58: begin FormCredits.Label4.Top := FormCredits.Label4.Top - 2;
                FormCredits.Label3.Top := FormCredits.Label3.Top - 2;
                FormCredits.Label2.Top := FormCredits.Label2.Top - 2;
                FormCredits.Label1.Top := FormCredits.Label1.Top - 2;
                Inc(i);
                if i < 180 then XLabel := 57 else begin i := 0;
                                                        FormCredits.TimerLabel1.Interval := 100
                                                  end
          end;
     59: begin FormCredits.Label1.Font.Color := clred;
                FormCredits.Label2.Font.Color := clblue;
                FormCredits.Label3.Font.Color := clgreen;
                FormCredits.Label4.Font.Color := clyellow
          end;
     60: begin FormCredits.Label1.Font.Color := clred;
                FormCredits.Label2.Font.Color := clyellow;
                FormCredits.Label3.Font.Color := clblue;
                FormCredits.Label4.Font.Color := clgreen
          end;
     61: begin FormCredits.Label1.Font.Color := clred;
                FormCredits.Label2.Font.Color := clgreen;
                FormCredits.Label3.Font.Color := clyellow;
                FormCredits.Label4.Font.Color := clblue;
                Inc(i);
                if i <= 36 then XLabel := 58 else i := 0
          end;
     62: begin FormCredits.Label1.Visible := false;
               FormCredits.Label2.Visible := false;
               FormCredits.Label3.Visible := false;
               FormCredits.Label4.Visible := false;
               FormCredits.Label1.Top := FormCredits.Label1.Top + 20;
               FormCredits.TimerLabel1.Interval := 1500
         end;
     63: begin FormCredits.Label5.Caption := 'Musikauswahl';
               FormCredits.Label6.Caption := 'und';
               FormCredits.Label7.Caption := 'Musikschnitt';
               FormCredits.Label5.Font.Size := 30;
               FormCredits.Label6.Font.Size := 20;
               FormCredits.Label7.Font.Size := 30;

               FormCredits.TimerLabel1.Interval := 1
         end;


...


   else exit end
end;
Steffen!
  Mit Zitat antworten Zitat