peter
23-10-2012, 13:45
Hi,
Uses "ui","math"
DWord hwnd
hwnd=Canvas_Window("Sine Text",320,240,640,480)
Canvas_Attach(hwnd,0,%TRUE)
Canvas_Font("system",16,%CANVAS_FONTSTYLE_BOLD)
Dim tl,i,x As Long
Dim z As String ="HELLO AND WELCOME TO OUR THINBASIC FORUM !"
Dim letter As String
Dim y(44) As Single
Dim angle(44) As Single
tl = Len(z)
For i=1 To tl
angle(i)=360-i*(360/tl)
y(i)=240
Next
While IsWindow(hwnd)
Canvas_Clear(Rgb(0,0,185))
For x=1 To tl
angle(x)=angle(x) +1
If angle(x)=360 Then angle(x) =0
letter = Mid$(z, x ,1)
y(x)=y(x)+Sin(DegToRad(angle(x)))
SetText(2+x*14,y(x)-40, letter,Rgb(255,200,255),Rgb(0,0,185))
SetText(4+x*14,y(x), letter,Rgb(2,255,255),Rgb(0,0,185))
Next
Canvas_Redraw
If GetAsyncKeyState(27) Then Exit While
Wend
Canvas_Window End
Sub SetText(x,y As Long, txt As String, xkol,ykol As Long)
Canvas_Color(xkol,ykol)
Canvas_SetPos(x,y)
Canvas_Print(txt)
End Sub
Uses "ui","math"
DWord hwnd
hwnd=Canvas_Window("Sine Text",320,240,640,480)
Canvas_Attach(hwnd,0,%TRUE)
Canvas_Font("system",16,%CANVAS_FONTSTYLE_BOLD)
Dim tl,i,x As Long
Dim z As String ="HELLO AND WELCOME TO OUR THINBASIC FORUM !"
Dim letter As String
Dim y(44) As Single
Dim angle(44) As Single
tl = Len(z)
For i=1 To tl
angle(i)=360-i*(360/tl)
y(i)=240
Next
While IsWindow(hwnd)
Canvas_Clear(Rgb(0,0,185))
For x=1 To tl
angle(x)=angle(x) +1
If angle(x)=360 Then angle(x) =0
letter = Mid$(z, x ,1)
y(x)=y(x)+Sin(DegToRad(angle(x)))
SetText(2+x*14,y(x)-40, letter,Rgb(255,200,255),Rgb(0,0,185))
SetText(4+x*14,y(x), letter,Rgb(2,255,255),Rgb(0,0,185))
Next
Canvas_Redraw
If GetAsyncKeyState(27) Then Exit While
Wend
Canvas_Window End
Sub SetText(x,y As Long, txt As String, xkol,ykol As Long)
Canvas_Color(xkol,ykol)
Canvas_SetPos(x,y)
Canvas_Print(txt)
End Sub