Computer Science Canada

Font.Draw Problems!

Author:  hq78 [ Wed Jan 05, 2005 8:10 pm ]
Post subject:  Font.Draw Problems!

var font1:int
var number:int:=15
The command Font.Draw (" ", x,y,font1,red)
why does it not let me use Font.Draw(number,x,y,font1,red)?

Author:  SuperGenius [ Wed Jan 05, 2005 8:23 pm ]
Post subject: 

i think that only a string can be used. so instead of:

code:

Font.Draw(number,x,y,font1,red)

do this:

code:

Font.Draw(intstr(number),x,y,font1,red)

Author:  hq78 [ Wed Jan 05, 2005 9:08 pm ]
Post subject: 

PRAISES TO YOU!!!! Thanks SOOOO MUCH!!!

Author:  SuperGenius [ Wed Jan 05, 2005 9:57 pm ]
Post subject: 

for something like this if you looked in the help it would say the syntax required, which includes the var type for each parameter.

Author:  hq78 [ Thu Jan 06, 2005 4:20 pm ]
Post subject: 

i looked for hours on this site before i posted so i guess i must have missed it

Author:  thaProfessor [ Thu Jan 06, 2005 6:16 pm ]
Post subject: 

im a newbie to programming and i just wanted to know how to make the statement you put in Font.Draw turn different colors or if you can do that ... any help would be nice

Author:  Cervantes [ Thu Jan 06, 2005 6:38 pm ]
Post subject: 

You sure can do that. Check out the last parameter to the Font.Draw function:
The Turing Reference wrote:

Font.Draw (txtStr : string, x, y, fontID, Color : int)

So, just change the colour number. Or you could use the RGB module.
Let's take a look at a simple example:

code:

var font1 := Font.New ("Times New Roman:16")
for i : 0 .. maxcolour %usually, maxcolour will return 255
    Font.Draw ("Look, my colours are changing!", 10, 10, font1, i)
    delay (10)
end for

Author:  thaProfessor [ Thu Jan 06, 2005 7:02 pm ]
Post subject: 

thanks alot ...


: