Sin Text Scroller

Blitz3D Forums/Blitz3D Beginners Area/Sin Text Scroller

Function SinScroll(txt$,x,y,am,amp=20,per=20,d=10)
.wrap
For n=1 To Len(txt$)
If Len(txt$) = "^" Then Text x+xx,y+Sin(am+n*per)*amp, " ": Goto wrap
Text x+xx,y+Sin(am+n*per)*amp,Mid$(txt$,n,1)
xx=xx+d
Next
End Function

here is what i've done to the sin scroll function, it wraps the text but, the problem is when it gets to the end of the text, the x position moves back to the beginning i.e. the far left of the screen, so it jumps instead of actually continuing where it left off. and i probably shouldn't use a goto...