Computer Science Canada

Font.Draw help

Author:  Piro24 [ Wed Dec 20, 2006 10:32 pm ]
Post subject:  Font.Draw help

Say I want to make my program display a name I got earlier in a nicer text

Ex.

code:
get name
Font.Draw (name, 12, 12, fontID, green)


Is there a way I can draw this string that I got ?

Author:  Hackmaster [ Wed Dec 20, 2006 10:36 pm ]
Post subject: 

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!

Author:  Piro24 [ Wed Dec 20, 2006 10:40 pm ]
Post subject: 

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

Author:  ericfourfour [ Wed Dec 20, 2006 10:46 pm ]
Post subject: 

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.

code:
var helloName : string := "Hello " + name + "."

code:
Font.Draw ("Hello " + name + ".", 12, 12, fontID, green)

Author:  Piro24 [ Wed Dec 20, 2006 10:53 pm ]
Post subject: 

Oh, easy solution. Thanks a lot.


: