Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Font.Draw help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Piro24




PostPosted: 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 ?
Sponsor
Sponsor
Sponsor
sponsor
Hackmaster




PostPosted: Wed Dec 20, 2006 10:36 pm   Post subject: (No 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!
Piro24




PostPosted: Wed Dec 20, 2006 10:40 pm   Post subject: (No 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
ericfourfour




PostPosted: Wed Dec 20, 2006 10:46 pm   Post subject: (No 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)
Piro24




PostPosted: Wed Dec 20, 2006 10:53 pm   Post subject: (No subject)

Oh, easy solution. Thanks a lot.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: