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

Username:   Password: 
 RegisterRegister   
 writing variables in font
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
trees are uber




PostPosted: Tue May 30, 2006 8:12 am   Post subject: 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


¿?¿?¿?¿?¿?¿?¿?¿?¿?¿?¿?¿?¿?
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Tue May 30, 2006 8:38 am   Post subject: (No subject)

what is the type of your variable ex. int, real, string?
if its string:
code:

var font:int:=Font.New("times new roman:12")
var myWord:string:="Hello"
Font.Draw(myWord,0,0,font,black)

code:

%for ints
var font:int:=Font.New("times new roman:12")
var myInt:int:=1200
Font.Draw(intstr(myInt),0,0,font,black)

code:

%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 Very Happy check the Turing Walkthrough for the tutorial on font commands and their uses if u are unclear on anything
trees are uber




PostPosted: Tue May 30, 2006 4:14 pm   Post subject: (No subject)

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.

Wink
Guest




PostPosted: Tue May 30, 2006 4:54 pm   Post subject: (No subject)

tree freak
trees are uber




PostPosted: Tue May 30, 2006 6:12 pm   Post subject: (No subject)

trees are uber though?
Cervantes




PostPosted: Tue May 30, 2006 7:03 pm   Post subject: (No subject)

vahnx wrote:
tree freak


Not only is this a semi-flame, it's spam. Please read [The Rules].

-10 BITS.

And since it seems trees are uber has received all the help he needs on this topic, I've locked it to prevent further spam. trees are uber, please let me or another Turing mod know if you have further questions on this topic, and we will unlock it.

(And yes, trees are wonderful. Please vahnx, try living without them. Wink)
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  [ 6 Posts ]
Jump to:   


Style:  
Search: