Drawing Text in Circle?

BlitzMax Forums/BlitzMax Beginners Area/Drawing Text in Circle?

Hotshot2005(Posted 2013) [#1]
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 :)


Jur(Posted 2013) [#2]
wrong order of parameters in function

DrawText(word[i], X, Z)


Hotshot2005(Posted 2013) [#3]
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 :)


Henri(Posted 2013) [#4]
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


Hotshot2005(Posted 2013) [#5]
Thanks Henri and much better :)