Wellentext von TheShadow von TheShadow / / jonn2 / adbtdkbv
Zeigt Text auf einer Sinuskurve (auf er Stelle), mit Farbübergang.


[code:1:6bde1a5813]
;Zeigt gewellten Text
;by TheShadow

Graphics 640,480,16,1

Dim sintab(359)
For i=0 To 359
sintab(i)=Sin(i)*20
Next

font=LoadFont("Arial",48,1,0,0)
image=createtextwave("GAME OVER",font)



While Not KeyHit(1)
Cls
angle=(angle+3) Mod 360
animatetextwave(image,197,216,angle)
Flip
Wend
FreeFont font
FreeImage image
End



;---------------------------------------------------------------------
Function animatetextwave(image,x,y,angle)
width =ImageWidth (image)
height=ImageHeight(image)
For i=0 To width-1
DrawImageRect image,x+i,y+sintab((angle+i) Mod 360),i,0,1,height
Next
End Function



;---------------------------------------------------------------------
Function createtextwave(txt$,font)
SetFont font
width =StringWidth (txt$)
height=StringHeight(txt$)
image =CreateImage (width,height)
image2=CreateImage (width,height)
SetBuffer ImageBuffer(image2)
Color 255,255,255
Text 0,0,txt$
MaskImage image2,255,255,255
SetBuffer ImageBuffer(image)
For i=0 To width-1
pro=250-(400*Abs(width/2-i))/width
Color pro,pro,pro/2
Rect i,0,1,height,1
DrawImageRect image2,i,0,i,0,1,height
Next
SetBuffer BackBuffer()
FreeImage image2
Return image
End Function
[/code:1:6bde1a5813]



Suche:
(unterstützt mySQL Wildcards ala %)
Titel:
Text:
Autor: