
-----------------------------------
imsry
Sun Dec 13, 2009 4:42 pm

Font Draw HELP !
-----------------------------------
What is it you are trying to achieve?
Using font draw with a variable. Like: put variable,"hello"
im not using put because it will create a white line in background picture

What is the problem you are having?
Turing is not letting me put a variable in Font.Draw


Describe what you have tried to solve this problem
i have tried the following:
Font.Draw (number,") Is it a mammal?", 110, 325, questionfont, red)
Font.Draw (number, 110, 325, questionfont, red)
Font.Draw (number ") Is it a mammal?", 110, 325, questionfont, red)

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
var number : int :=0 

var questionfont : int      %font for the question
questionfont := Font.New ("ISOCT:30:bold")

number +=1
Font.Draw (number,") Is it a mammal?", 110, 325, questionfont, red) %question

then when i run turring says "argument is the wrong type"
Please specify what version of Turing you are using
4.1

-----------------------------------
Tony
Sun Dec 13, 2009 4:49 pm

RE:Font Draw HELP !
-----------------------------------
Because the argument is of the wrong type, please use the right type. You can check put takes an arbitrary number of arguments.

-----------------------------------
imsry
Sun Dec 13, 2009 4:55 pm

RE:Font Draw HELP !
-----------------------------------
; D Thanks your the best !!

-----------------------------------
imsry
Sun Dec 13, 2009 5:06 pm

RE:Font Draw HELP !
-----------------------------------
hmm i still dont get it X.X  what string i put in it??
do i put 
var text:string := "is it a mammal?"

Font.Draw ("is it a mammal?":text,100,100,red,question font:number)

-----------------------------------
Tony
Sun Dec 13, 2009 5:08 pm

RE:Font Draw HELP !
-----------------------------------
check out the examples, click link -> [tdoc]Font.Draw[/tdoc]

-----------------------------------
imsry
Sun Dec 13, 2009 5:16 pm

Re: Font Draw HELP !
-----------------------------------
i tried that.. it dont help much
i want to make a question and sometime i made it so that it skips certain questions. Therefore i need a variable that can count by1 to show the player what question they are on.  
which would be 

var number : int :=0
number +=1 

that does the math but i need to put into font draw. ex  number) is it a mammal?

-----------------------------------
Tony
Sun Dec 13, 2009 5:30 pm

RE:Font Draw HELP !
-----------------------------------
So you need a single string to display. You can concatenate strings with +, as in "foo" + "bar".

You can't join numbers with strings, because that behaviour is not defined, but you can turn an integer into a string with [tdoc]intstr[/tdoc]

-----------------------------------
imsry
Sun Dec 13, 2009 5:50 pm

RE:Font Draw HELP !
-----------------------------------
: D thanks i think it works now it lets me run it

Font.Draw (intstr (number)+") Is it a mammal?", 110, 325, questionfont, red) %question

this seems right. right?

-----------------------------------
Tony
Sun Dec 13, 2009 6:02 pm

RE:Font Draw HELP !
-----------------------------------
That seems right.

But also, don't be afraid to just try things out. It's ok to make mistakes ;)

-----------------------------------
mirhagk
Sun Dec 13, 2009 11:32 pm

Re: RE:Font Draw HELP !
-----------------------------------
That seems right.

But also, don't be afraid to just try things out. It's ok to make mistakes ;)

I wish that were true in all languages. I'm learning assembly right now... that quote does not apply at all. i put a 2 instead of a 9 and the whole computer starts displaying random symbols and beeping like crazy. 

My math teacher actually made a mistake once and his code dynamically erased itself right before his eyes...

-----------------------------------
Tony
Sun Dec 13, 2009 11:47 pm

Re: RE:Font Draw HELP !
-----------------------------------
My math teacher actually made a mistake once and his code dynamically erased itself right before his eyes...
Source. Control.
