ColorText - Text in Farbe wie in Call of Duty
Übersicht

NiclasBetreff: ColorText - Text in Farbe wie in Call of Duty |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hi,
nach langer inaktivität im Forum, und noch längerer Pause im Code-Archiv *g* habe ich mal eine weitere, für die meisten wahrscheinlich unnütze, funktion. ![]() In Call of Duty werden die Nicks ja durch "^1" (=rot) Farbig gemacht. Diese Funktion kann diesen Farbcode darstellen. Code: [AUSKLAPPEN] ;Function, die Text in Farbe darstellt. ;Benutzung wie in CoD: ;^ + Zahl der Farbe: ; 0 - Black / Schwarz ; 1 - Red / Rot ; 2 - Green / Grün ; 3 - Yellow /Gelb ; 4 - Blue / Blau ; 5 - Cyan / Türkis ; 6 - Pink / Purpurrot ; 7 - White / Weiß ;z.B. "^1" wenn der Text Rot erscheinen Soll Function ColorText(x,y,txt$) Local tmp_x=x Local tmp_x2=x Local tmp_txt$ For cnt = 1 to Len(txt$) curr_ltr$ = Mid$(txt$,cnt,1) If curr_ltr$ = "^" or cnt=Len(txt$) Then curr_cLtr$ = Mid$(txt$,cnt+1,1) curr_cNmbr = int(curr_cLtr$) If (curr_cNmbr > -1 And curr_cNmbr < 8) or cnt=Len(txt$) Then If cnt=Len(txt$) Then tmp_txt$=tmp_txt$+Right$(txt$,1) Text tmp_x,y,tmp_txt$ tmp_x = tmp_x2 tmp_txt$="" cnt=cnt+1 Select int(curr_cNmbr) Case 0 Color 0,0,0 Case 1 Color 255,0,0 Case 2 Color 0,255,0 Case 3 Color 255,255,0 Case 4 Color 0,0,255 Case 5 Color 0,255,255 Case 6 Color 255,0,255 Case 7 Color 255,255,255 End Select else tmp_txt$ = tmp_txt$+curr_ltr$ tmp_x2 = tmp_x2+StringWidth(curr_ltr$) end if else tmp_txt$ = tmp_txt$+curr_ltr$ tmp_x2 = tmp_x2+StringWidth(curr_ltr$) End if Next End Function |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group