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

Username:   Password: 
 RegisterRegister   
 Font.Draw Problems!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
hq78




PostPosted: 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)?
Sponsor
Sponsor
Sponsor
sponsor
SuperGenius




PostPosted: Wed Jan 05, 2005 8:23 pm   Post subject: (No 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)
hq78




PostPosted: Wed Jan 05, 2005 9:08 pm   Post subject: (No subject)

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




PostPosted: Wed Jan 05, 2005 9:57 pm   Post subject: (No 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.
hq78




PostPosted: Thu Jan 06, 2005 4:20 pm   Post subject: (No subject)

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




PostPosted: Thu Jan 06, 2005 6:16 pm   Post subject: (No 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
Cervantes




PostPosted: Thu Jan 06, 2005 6:38 pm   Post subject: (No 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
thaProfessor




PostPosted: Thu Jan 06, 2005 7:02 pm   Post subject: (No subject)

thanks alot ...
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: