
-----------------------------------
vertozia
Sat Jan 20, 2007 5:42 pm

Displaying variables with Font.Draw
-----------------------------------
Hey there, I'm trying to make a scoring system, but i want to make the score bigger, there is a problem

correct is my score variable and is equal to 0, with each correct answer it increases by one. When i want to see the score it gives me an error that i do not know how to correct this (argument is the wrong type. please have a look at my code. I tried defining font . draw with a variable then trying to execute it instead of executing it on the spot, it still didn't work.



http://img135.imageshack.us/img135/484/math5pk.jpg

-----------------------------------
neufelni
Sat Jan 20, 2007 6:19 pm

RE:Displaying variables with Font.Draw
-----------------------------------
The problem is that your score is an int variable and Font.Draw takes a string as an argument. To solve this problem you just need to convert your int to a string. This is done using intstr:

var score : int := 5
var font : int := Font.New("Arial:12")

Font.Draw(intstr(score), 10, 10, font, 7)


-----------------------------------
CodeMonkey2000
Sat Jan 20, 2007 6:20 pm

RE:Displaying variables with Font.Draw
-----------------------------------
use intstr(correct)

-----------------------------------
vertozia
Sat Jan 20, 2007 8:51 pm

RE:Displaying variables with Font.Draw
-----------------------------------
cool, thanks a lot, gave you both some random bits.
