
-----------------------------------
Piro24
Wed Dec 20, 2006 10:32 pm

Font.Draw help
-----------------------------------
Say I want to make my program display a name I got earlier in a nicer text

Ex.

get name
Font.Draw (name, 12, 12, fontID, green)

Is there a way I can draw this string that I got ?

-----------------------------------
Hackmaster
Wed Dec 20, 2006 10:36 pm


-----------------------------------
Well... first you have to define a new font, using Font.New. then, you just use that in place of fontID as well. also... you might check the tutorial section...It really can be quite helpful, when it comes to stuff just like this!

-----------------------------------
Piro24
Wed Dec 20, 2006 10:40 pm


-----------------------------------
Ok, bad question

What I need to do is put something like :

Font.Draw ("Hello", name, 12, 12, fontID, green)

name being a string that I 'got' earlier

-----------------------------------
ericfourfour
Wed Dec 20, 2006 10:46 pm


-----------------------------------
Many programming languages have this useful feature called concatenation. It let's you combine two strings into one. To concatenate strings in Turing you simply use the + operator.

var helloName : string := "Hello " + name + "."
Font.Draw ("Hello " + name + ".", 12, 12, fontID, green)

-----------------------------------
Piro24
Wed Dec 20, 2006 10:53 pm


-----------------------------------
Oh, easy solution. Thanks a lot.
