Autor Beitrag
N47R0N
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Mi 18.05.05 20:00 
Hi

Ich wollte fragen wie man si eine art schrift efeckt zu stande bringt z.B

Ich drücke einen Button und es erscheint ein fenster in dem es so aussit als würde jemand da rein schreiben und ein text entsteht langsam .
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Mi 18.05.05 20:17 
user profile iconN47R0N hat folgendes geschrieben:
Ich drücke einen Button und es erscheint ein fenster in dem es so aussit als würde jemand da rein schreiben und ein text entsteht langsam .

Hallo! Nimm doch einen Timer, der dir Buchstabe für Buchstabe hinzufügt und sich disabled, wenn der Text komplett ist.

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 18.05.05 20:18 
1: Suche benutzen
2: Suche in: Delphi-Forum, Delphi-Library TTIMER
3: Label1.Caption:=Label1.Caption+'a';

Der Rest sollte einich einfach sein... Bin mir aber recht sicher, dass die frage schonmal (schon 2 mal...? )gestellt wurde.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Mi 18.05.05 21:21 
OK danke erstmal

Werd das näste mal suchen :D
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Mi 18.05.05 21:53 
user profile iconN47R0N hat folgendes geschrieben:
OK danke erstmal


Habe aber trotzdem ein problem unzwar wie bekomme ich den timer dazu immer eine bestimmte zeit zu warten bis er den nästen bustaben hinzufügt .

Moderiert von user profile iconmatze: Quote Tag repariert
rjan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 40

Win XP, WIN 2000, Win 98, Win 95, Win 3.11
D5 Stand /D7 enterp/2k5 pers.
BeitragVerfasst: Mi 18.05.05 22:01 
Den intervall höher drehen (siehe Objektinspektor)
VitaminC
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 21



BeitragVerfasst: Mi 18.05.05 22:02 
Einfach die Eigenschaft "Interval" verändern. Angabe erfolgt in Millisekunden.

Also z.B.:
ausblenden Delphi-Quelltext
1:
Timer1.Interval := 500;					

für eine halbe Sekunde.

--> Tia, eine Sekunde zu langsam gewesen :-)

Moderiert von user profile iconmatze: Code- durch Delphi-Tags ersetzt.
rjan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 40

Win XP, WIN 2000, Win 98, Win 95, Win 3.11
D5 Stand /D7 enterp/2k5 pers.
BeitragVerfasst: Mi 18.05.05 22:11 
Zitat:
Einfach die Eigenschaft "Interval" verändern. Angabe erfolgt in Millisekunden.

Also z.B.:
ausblenden anzeigen Code
ausgeblendet markieren
1:

Timer1.Interval := 500;

für eine halbe Sekunde.



ODER so
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Mi 18.05.05 22:36 
Das habe ich bereitz versucht , doch das funktioniert irgendwie nicht


mein code:
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:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
procedure TForm1.Timer3Timer(Sender: TObject);
begin
Label25.font.Color:=clred;
Label25.Caption:=Label25.Caption+'G';
if Timer3.Interval := 500 then
begin
Label25.Caption:=Label25.Caption+'a';
end;
begin
if Timer3.Interval := 1000 then
begin
Label25.Caption:=Label25.Caption+'m';
end;
begin
if Timer3.Interval := 1500 then
begin
Label25.Caption:=Label25.Caption+'e';
end;
begin
if Timer3.Interval := 2000 then
begin
Label25.Caption:=Label25.Caption+'R';
end;
begin
if Timer3.Interval := 2500 then
begin
Label25.Caption:=Label25.Caption+'i';
end;
begin
if Timer3.Interval := 3000 then
begin
Label25.Caption:=Label25.Caption+'p';
end;
begin
if Timer3.Interval := 3500 then
begin
Label25.Caption:=Label25.Caption+'z';
end;
begin
if Timer3.Interval := 4000 then
begin
Label25.Caption:=Label25.Caption+' ';
end;
begin
if Timer3.Interval := 4500 then
begin
Label25.Caption:=Label25.Caption+'H';
end;
begin
if Timer3.Interval := 5000 then
begin
Label25.Caption:=Label25.Caption+'T';
end;
begin
if Timer3.Interval := 5500 then
begin
Label25.Caption:=Label25.Caption+'M';
end;
begin
if Timer3.Interval := 6000 then
begin
Label25.Caption:=Label25.Caption+'L';
end;
begin
if Timer3.Interval := 6500 then
begin
Label25.Caption:=Label25.Caption+' ';
end;
begin
if Timer3.Interval := 7000 then
begin
Label25.Caption:=Label25.Caption+'C';
end;
begin
if Timer3.Interval := 7500 then
begin
Label25.Caption:=Label25.Caption+'r';
end;
begin
if Timer3.Interval := 8000 then
begin
Label25.Caption:=Label25.Caption+'e';
end;
begin
if Timer3.Interval := 8500 then
begin
Label25.Caption:=Label25.Caption+'a';
end;
begin
if Timer3.Interval := 9000 then
begin
Label25.Caption:=Label25.Caption+'t';
end;
begin
if Timer3.Interval := 9500 then
Label25.Caption:=Label25.Caption+'o';
end;
begin
if Timer3.Interval := 10000 then
begin
Label25.Caption:=Label25.Caption+'r';
end;
begin
if Timer3.Interval := 10500 then
begin
Label25.Caption:=Label25.Caption+' ';
end;
begin
if Timer3.Interval := 11000 then
begin
Label25.Caption:=Label25.Caption+'1';
end;
begin
if Timer3.Interval := 11500 then
begin
Label25.Caption:=Label25.Caption+'.';
end;
begin
if Timer3.Interval := 12000 then
begin
Label25.Caption:=Label25.Caption+'0';
Timer3.Enabled := false
end;

end.


Der Fehler der mir angezeigt wird:
ausblenden 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:
[Fehler] Unit1.pas(334): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(339): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(344): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(349): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(354): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(359): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(364): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(369): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(374): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(379): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(384): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(389): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(394): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(399): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(404): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(409): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(414): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(419): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(424): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(428): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(433): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(438): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(443): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(448): Ausdruckstyp muss BOOLEAN sein
[Fehler] Unit1.pas(454): Record, Objekt oder Klassentyp erforderlich
[Fehler] Unit1.pas(457): 'END' erwartet, aber Dateiende gefunden
[Fataler Fehler] Project1.dpr(7): Verwendete Unit 'Unit1.pas' kann nicht compiliert werden


Bitte helft mir :cry: :cry: :cry: :cry:
crakos
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 195


D2k5 Pers
BeitragVerfasst: Mi 18.05.05 23:40 
ausblenden Delphi-Quelltext
1:
Label25.Caption:=Label25					

du weist es zu mit := du darfst aber nur fragen if mhmhmh ist mhmhmh dann mhmhmh ;)
also nur =

_________________
Das Ende der Menschheit ist der Anfang der Unendlichkeit.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 19.05.05 00:40 
interessante sache. wieso fragst du mit der If-abfrage die größe des intervalls ab? versuchs mal so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
var Form1 : TForm1;
    i : integer;
{...}
procedure TForm1.Timer1onTimer(Sender: TObject);
begin
inc(i); //ist das gleiche wie i:=i+1;
case i of
1:Label1.text:=Label1.Text+'h';
2:Label1.text:=Label1.Text+'a';
3:Label1.text:=Label1.Text+'l';
4:Label1.text:=Label1.Text+'l';
5:Label1.text:=Label1.Text+'o';
6:Label1.text:=Label1.Text+' ';
7:Label1.text:=Label1.Text+'w';
8:Label1.text:=Label1.Text+'e';
9:Label1.text:=Label1.Text+'l';
10:Label1.text:=Label1.Text+'t';
end;
end;

Dann stellst du noch den Timer1.Intervall auf die entsprechende größe (vielleicht 500 milisekunden) und tadaaa, klappt.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Do 19.05.05 07:11 
Habe meinen code jetzt überarbeitet

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:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
procedure TForm1.Timer3Timer(Sender: TObject);
begin
Label25.font.Color:=clred;
Label25.Caption:=Label25.Caption+'G';
if Timer3.Interval = 500 then
begin
Label25.Caption:=Label25.Caption+'a';
end;
begin
if Timer3.Interval = 1000 then
begin
Label25.Caption:=Label25.Caption+'m';
end;
begin
if Timer3.Interval = 1500 then
begin
Label25.Caption:=Label25.Caption+'e';
end;
begin
if Timer3.Interval = 2000 then
begin
Label25.Caption:=Label25.Caption+'R';
end;
begin
if Timer3.Interval = 2500 then
begin
Label25.Caption:=Label25.Caption+'i';
end;
begin
if Timer3.Interval = 3000 then
begin
Label25.Caption:=Label25.Caption+'p';
end;
begin
if Timer3.Interval = 3500 then
begin
Label25.Caption:=Label25.Caption+'z';
end;
begin
if Timer3.Interval = 4000 then
begin
Label25.Caption:=Label25.Caption+' ';
end;
begin
if Timer3.Interval = 4500 then
begin
Label25.Caption:=Label25.Caption+'H';
end;
begin
if Timer3.Interval = 5000 then
begin
Label25.Caption:=Label25.Caption+'T';
end;
begin
if Timer3.Interval = 5500 then
begin
Label25.Caption:=Label25.Caption+'M';
end;
begin
if Timer3.Interval = 6000 then
begin
Label25.Caption:=Label25.Caption+'L';
end;
begin
if Timer3.Interval = 6500 then
begin
Label25.Caption:=Label25.Caption+' ';
end;
begin
if Timer3.Interval = 7000 then
begin
Label25.Caption:=Label25.Caption+'C';
end;
begin
if Timer3.Interval = 7500 then
begin
Label25.Caption:=Label25.Caption+'r';
end;
begin
if Timer3.Interval = 8000 then
begin
Label25.Caption:=Label25.Caption+'e';
end;
begin
if Timer3.Interval = 8500 then
begin
Label25.Caption:=Label25.Caption+'a';
end;
begin
if Timer3.Interval = 9000 then
begin
Label25.Caption:=Label25.Caption+'t';
end;
begin
if Timer3.Interval = 9500 then
Label25.Caption:=Label25.Caption+'o';
end;
begin
if Timer3.Interval = 10000 then
begin
Label25.Caption:=Label25.Caption+'r';
end;
begin
if Timer3.Interval = 10500 then
begin
Label25.Caption:=Label25.Caption+' ';
end;
begin
if Timer3.Interval = 11000 then
begin
Label25.Caption:=Label25.Caption+'1';
end;
begin
if Timer3.Interval = 11500 then
begin
Label25.Caption:=Label25.Caption+'.';
end;
begin
if Timer3.Interval = 12000 then
begin
Label25.Caption:=Label25.Caption+'0';
Timer3.Enabled := false
end;

end.


Kommt aber immernoch n fehler
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Do 19.05.05 13:53 
Hi,
Siehst so aus als ob du die Funktionsweise des Timers nicht richtig verstanden hast.
Zum Verständnis : Alles, was im Ereignis OnTimer steht wird im Abstand von n Millisekunden ausgeführt.
(Wobei n der Wert des Intervalls ist). Das Intervall bezeichnet aber NICHT die vergangene Zeit.

Guck dir nochmal den Code von JayEff an. Falls du ihn nicht verstehst nochmal die Erklärung :
Wenn du jede halbe Sekunde einen Buchstaben setzen willst stellst du den Timer.Intervall auf 500.
Im OnTimer-Ereignis baust du dann einen Zähler ein, der sich bei jedem Aufruf des Ereignisses um 1 erhöht. Danach fragst den Zähler ab und fügst den entsprechenden Buchstaben hinzu. Ist der Zähler beim letzen Buchstaben kannst du noch Timer.enable auf false setzen.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 19.05.05 14:04 
Ausserdem fehlt bei dir noch ein end; ... -.-

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Do 19.05.05 15:22 
DANKE Azubi 20 jetzt hab ich es richtig verstanden
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 19.05.05 15:34 
Schrift Effekt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.Button1Click(Sender: TObject);  
var
  i: integer;
  str: string;
begin
  randomize;
  str := 'Hello World';
  label1.caption := '';
  for i := 1 to length(str) do
    begin
      label1.caption := label1.caption + str[i];
      application.processmessages;
      sleep(random(255) + 126); //schneller: sleep(random(175) + 75)
    end;
end;
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 19.05.05 16:53 
jaaaaa genau ^^ das ist natürlich noch besser. einen String nehmen und per schleife zeichenweise auslesen...

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 19.05.05 16:55 
warum denn nicht ?
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 19.05.05 17:11 
Eine andere Möglichkeit bestünde darin, den Text ganz in ein Label zu machen, dessen widht auf 0 setzten und dann die widht immer größer werden lassen. So kommen dann die Zeichen wie aus der Feder, nur dass manchmal halt 2 Federn schreiben müssten :wink:
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 19.05.05 19:06 
auch nich schlecht.

@FotD: Ich meinte: deine Idee ist natürlich besser als meine. Viel weniger kompliziert! Übersichtlicher! das war es, was ich sagen wollte, das sollte nicht ironisch gemeint sein, sorry wenns so rüber kam :wink:

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.