Autor Beitrag
Larus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Di 01.03.05 15:35 
Also ich habe eine Animation mit einem Timer und einem Label gebaut die in etwa so aussieht:
ausblenden volle Höhe Delphi-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:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
procedure TForm1.t_starttimerTimer(Sender: TObject);
begin
If Wilk=0  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W';
If Wilk=1  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W i';
If Wilk=2  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W i l';
If Wilk=3  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W i l l';
If Wilk=4  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W i l l k';
If Wilk=5  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W i l l k o';
If Wilk=6  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W i l l k o m';
If Wilk=7  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W i l l k o m m';
If Wilk=8  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ W i l l k o m m e';
If Wilk=9  Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ W i l l k o m m e n';
If Wilk=10 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ W i l l k o m m e n';
If Wilk=11 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ W i l l k o m m e n';
If Wilk=12 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ W i l l k o m m e n';
If Wilk=13 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ W i l l k o m m e n';
If Wilk=14 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ W i l l k o m m e n';
If Wilk=15 Then l_wort.Caption:='_ _ _ _ _ _ _ _ W i l l k o m m e n';
If Wilk=16 Then l_wort.Caption:='_ _ _ _ _ _ _ W i l l k o m m e n';
If Wilk=17 Then l_wort.Caption:='_ _ _ _ _ _ W i l l k o m m e n';
If Wilk=18 Then l_wort.Caption:='_ _ _ _ _ W i l l k o m m e n';
If Wilk=19 Then l_wort.Caption:='_ _ _ _ W i l l k o m m e n';
If Wilk=20 Then l_wort.Caption:='_ _ _ W i l l k o m m e n';
If Wilk=21 Then l_wort.Caption:='_ _ W i l l k o m m e n';
If Wilk=22 Then l_wort.Caption:='_ W i l l k o m m e n';
If Wilk=23 Then l_wort.Caption:='W i l l k o m m e n';
If Wilk=24 Then l_wort.Caption:='i l l k o m m e n';
If Wilk=25 Then l_wort.Caption:='l l k o m m e n';
If Wilk=26 Then l_wort.Caption:='l k o m m e n';
If Wilk=27 Then l_wort.Caption:='k o m m e n';
If Wilk=28 Then l_wort.Caption:='o m m e n';
If Wilk=29 Then l_wort.Caption:='m m e n';
If Wilk=30 Then l_wort.Caption:='m e n';
If Wilk=31 Then l_wort.Caption:='e n';
If Wilk=32 Then l_wort.Caption:='n';
If Wilk=33 Then l_wort.Caption:='';
If Wilk=40 Then l_wort.Caption:='_';
If Wilk=41 Then l_wort.Caption:='_ _';
If Wilk=42 Then l_wort.Caption:='_ _ _';
If Wilk=43 Then l_wort.Caption:='_ _ _ _';
If Wilk=44 Then l_wort.Caption:='_ _ _ _ _';
If Wilk=45 Then l_wort.Caption:='_ _ _ _ _ _';
If Wilk=46 Then l_wort.Caption:='_ _ _ _ _ _ _';
If Wilk=47 Then l_wort.Caption:='_ _ _ _ _ _ _ _';
If Wilk=48 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _';
If Wilk=49 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _';
If Wilk=50 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _';
If Wilk=51 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=52 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=53 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=54 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=55 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=56 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=57 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=58 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=59 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=60 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=61 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=62 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=63 Then l_wort.Caption:='_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _';
If Wilk=65 Then t_starttimer.Enabled:=False;

Wilk:=Wilk+1;
end;


Wilk is in dem Fall ein Integer.. Nun will ich wissen wie man das Leichter hinkriegt

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Harry Hunt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Di 01.03.05 15:58 
Nicht deutlich kürzer als deins, aber dynamischer

ausblenden volle Höhe Delphi-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:
var
  Wilk, Start: Integer;

const
  WillkommenText = 'W i l l k o m m e n';
  AnzeigeLaenge = 30;

procedure TForm1.TimerTimer(Sender: TObject);
var
  Ausgabe: string;
  I: Integer;
begin
  Ausgabe := '';
  if Wilk < AnzeigeLaenge + Length(WillkommenText) then
  begin
    for I := 0 to (AnzeigeLaenge - Wilk) do
      Ausgabe := Ausgabe + '- ';
    Label1.Caption := Copy(Ausgabe + WillkommenText, Start,
      (AnzeigeLaenge * 2));
    Inc(Wilk);
    if Wilk > AnzeigeLaenge then
      Inc(Start);
  end
  else
  begin
    for I := 0 to (Wilk - (AnzeigeLaenge + Length(WillkommenText))) do
      Ausgabe := Ausgabe + '- ';
    Label1.Caption := Ausgabe;
    Inc(Wilk);
    if Wilk >= (AnzeigeLaenge * 2) + Length(WillkommenText) then
      Timer.Enabled := False;
  end;
end;


Wilk und Start müssen mit "1" initialisiert werden.
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Di 01.03.05 16:13 
Das Problem ist... was mach ich wenn ich Folgendes machen will?
Hello----
-Hello---
--Hello--
---Hello-
----Hello
---Hello-
--Hello--
-Hello---
^und wieder von vorne
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Di 01.03.05 18:25 
@Larus beziehend auf Code im ersten Post:

LOOOOOOOOOOOOOOOOOOOOOOOOOOOOL !!! ROFL !!! <wegschmeiss>

SCNR
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 01.03.05 18:35 
cogito ergo sum :lol:
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Di 01.03.05 18:50 
OK, beruhigt.

Probier's mal mit sowas in der Richtung (quick hack):

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function BannerString(const Wording : string; WindowSize,Offset : integer) : string;
 var i,j : integer;
begin
 SetLength(Result,WindowSize);
 for i:=1 to WindowSize do
 begin
  j := i+Offset;
  if (j>=1) and (j<=Length(Wording)) then
  Result[i]:=Wording[j] else Result[i]:='_';
 end;
end;
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Di 01.03.05 21:35 
Also.. ich weiß das manches euch zum lachen bringt... aber ich hab das prob das ich keinen Timer verwenden will... Im Prinzip kann ich das ruhig mit so ner liste machen nur ohne soviel if und ohne Timer.. versteht ihr was ich meine???
Ich meine sowas in ungefähr der Form...
ausblenden Quelltext
1:
2:
3:
4:
5:
('---dsa',
 '--dsa-',
 '-dsa--',
 'dsa---',
...)

gesehen hab doch jegliches Suchen hat nicht zum erfolg geführt!
JA ganz recht. ich hab mal mit GOOGLE.DE GESUCHT 8)
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 01.03.05 21:58 
Larus hat folgendes geschrieben:
gesehen hab doch jegliches Suchen hat nicht zum erfolg geführt!
JA ganz recht. ich hab mal mit GOOGLE.DE GESUCHT 8)

programmieren bedeutet auch dass man ab und an sein eigenes gehirn benutzen sollte anstatt jeden code nur zu "klauen" :twisted:
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Mi 02.03.05 07:04 
tschuldigung.. DAS TU ICH AUCH SOWEIT WIE ICH KOMME :evil:
sourcehunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 482

Win XP | Suse 10.1
Delphi 2005 Pers.
BeitragVerfasst: Mi 02.03.05 11:10 
Unter Windows respektive Delpih wird das nicht ohne Timer gehen. Aber falls du es trotzdem mal probieren wills, dann lass doch einfach einen Integer incrementieren und bei bestimmten Werten dein Label setzen.
z.B:
ausblenden Delphi-Quelltext
1:
   Label1.Caption:=Liste[counter DIV 1000];					

_________________
Linux und OpenSource rulez!