Drawing Text in Circle?
BlitzMax Forums/BlitzMax Beginners Area/Drawing Text in Circle?
| ||
| I have convert code from Blitzbasic to BlitzMax What does is move the text round in Circle but I got saying Unable to convert from String to Float
Local word$[10]
word$[0]="D"
word$[1]="E"
word$[2]="M"
word$[3]="O"
word$[4]="S"
While Not KeyDown(1)
Move=Move+1
While Move>360
Move=Move-360
Wend
Cls
For i=0 To 4;
gamma=i*45+Move
z=64*Sin(gamma)+160
x=32*Cos(gamma)+64
DrawText Z,X,word$[i]
Next
Flip
Wend
Then My next step would be using REAL Graphics Fonts :) |
| ||
| wrong order of parameters in function DrawText(word[i], X, Z) |
| ||
| Thanks and I change that and run the program but it say Expression of Type Int cannot be indexed It is alright and I got it sort out :) |
| ||
| Hello, just for fun, here is a slightly more Blitzmax:ish way Strict Graphics 800,600 Local word:String[]=["D","E","M","O","S"] Local t_gamma:Double Local move:Int Local x:Int, z:Int While Not KeyDown(KEY_ESCAPE) move:+1 If move > 360 move:-360 Cls For Local i:Int = 0 Until word.length t_gamma = i*45 + move z = 64*Sin(t_gamma) + 160 x = 32*Cos(t_gamma) + 64 DrawText word[i],z,x Next Flip Wend -Henri |
| ||
| Thanks Henri and much better :) |