
-----------------------------------
trees are uber
Tue May 30, 2006 8:12 am

writing variables in font
-----------------------------------
how do i write variables in fonts

example: im trying to make a sprite for my score but i need to know how to write the variable for score in a font


Â¿?Â¿?Â¿?Â¿?Â¿?Â¿?Â¿?Â¿?Â¿?Â¿?Â¿?Â¿?Â¿?

-----------------------------------
Clayton
Tue May 30, 2006 8:38 am


-----------------------------------
what is the type of your variable ex. int, real, string?
if its string:

var font:int:=Font.New("times new roman:12")
var myWord:string:="Hello"
Font.Draw(myWord,0,0,font,black)


%for ints
var font:int:=Font.New("times new roman:12")
var myInt:int:=1200
Font.Draw(intstr(myInt),0,0,font,black)


%for real
var font:int:=Font.New("times new roman:12")
var myReal:real:=3.145
Font.Draw("Pi = "+realstr(myReal),0,0,font,black)

you'll notice in the real example, i have "Pi = "+realstr(myReal) you have to concatenate strings in font commands so as not to try to pass extra paramaters :D check the Turing Walkthrough for the tutorial on font commands and their uses if u are unclear on anything

-----------------------------------
trees are uber
Tue May 30, 2006 4:14 pm


-----------------------------------
Alright, thanks.

What i'm trying to do is make a score for my game, so that'd be in int, and then turn it into a sprite so I can have it stay on the screen the whole time. 

;)

-----------------------------------

Tue May 30, 2006 4:54 pm


-----------------------------------
tree freak

-----------------------------------
trees are uber
Tue May 30, 2006 6:12 pm


-----------------------------------
trees are uber though?

-----------------------------------
Cervantes
Tue May 30, 2006 7:03 pm


-----------------------------------
tree freak

Not only is this a semi-flame, it's spam. Please read (And yes, trees are wonderful. Please vahnx, try living without them. ;))
