Computer Science Canada

Font

Author:  upthescale [ Wed Apr 19, 2006 3:23 pm ]
Post subject:  Font

Font.Draw ("Player 1 " + intstr (numb), 70, 400, font, blue)
is for the font to be whatever u like, in numbners....how do i get it so when they write their name it will b in the font, cuz instr is for int only and words are string!


thank you

Author:  [Gandalf] [ Wed Apr 19, 2006 3:26 pm ]
Post subject: 

Hmm... Why do you think we used intstr() in the first place? To convert the integer into a string so that it can be concatenated to your text using the + operator. If your variable is a string already, there is no need for intstr() and everything else stays the same.

Author:  upthescale [ Wed Apr 19, 2006 3:35 pm ]
Post subject: 

ok it's not werking!!!


code:

var name:string

get name
font := Font.New ("Palatino:26:bold,italic")

    Font.Draw ("Player 1    ", name, 70, 400, font, blue)


wtf is wrong!?

Author:  [Gandalf] [ Wed Apr 19, 2006 3:41 pm ]
Post subject: 

It's not werking because you didn't listen to a thing I said. You add the string variable to the end of your text using the + operator, otherwise it will take your variable as an extra argument.

Author:  upthescale [ Wed Apr 19, 2006 3:44 pm ]
Post subject: 

s0rry if im flooding or w/e but it's not helping me

that don't werth either

Font.Draw ("Player 1 " (name) + intstr, 70, 400, font, blue)

Author:  [Gandalf] [ Wed Apr 19, 2006 4:04 pm ]
Post subject: 

Sigh...
You should definately have gotten this on your own:
code:
Font.Draw ("Player 1: " + name, 70, 400, font, blue)

Sigh...


: