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

Username:   Password: 
 RegisterRegister   
 invisible colourback
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tubs




PostPosted: Fri May 23, 2003 11:38 am   Post subject: invisible colourback

i want to make the background of text that the user enters have invisible colourback (like font.draw)

is this possible? how?
Sponsor
Sponsor
Sponsor
sponsor
Asok




PostPosted: Fri May 23, 2003 12:06 pm   Post subject: (No subject)

simple use Font.Draw to display what the user is typing

something like

code:
var x, y : int := 100
var fontId : int := Font.New ("Arial:12")
var ch : string (1)

loop
    getch (ch)
    Font.Draw (ch, x, y, fontId, black)
    x += 10
end loop
Homer_simpson




PostPosted: Fri May 23, 2003 1:56 pm   Post subject: (No subject)

you might wanna replace the
code:
x+= 10
with
code:
x += Font.Width (ch, fontId)
Tubs




PostPosted: Mon May 26, 2003 11:41 am   Post subject: (No subject)

ya that displays it but i also want what they enter to be a variable
Solo




PostPosted: Mon May 26, 2003 3:59 pm   Post subject: Try this :)

code:
var x, y : int := 100
var fontId : int := Font.New ("Arial:12")
var ch : string (1)
var word : string := ""

loop
    getch (ch)
    exit when ord (ch) = 10
    Font.Draw (ch, x, y, fontId, black)
    x += Font.Width (ch, fontId)
    word += ch
end loop


The Variable it gets stored in is word, this also outputs it to the screen.

Enter ends the loop and stops adding to the variable.
Tubs




PostPosted: Tue May 27, 2003 11:19 am   Post subject: (No subject)

what does += mean?
Blade




PostPosted: Tue May 27, 2003 12:34 pm   Post subject: (No subject)

you are adding something together or adding something to a string. in an integer it will add the value and with a string it will add on a character. so
in x = 3
x+=2 will = 5
means the same thing as
x:=x+5

just a shortcut..
Tubs




PostPosted: Thu May 29, 2003 11:21 am   Post subject: (No subject)

how can i make the backspace key work? all it does is put a box on the screen
Homer_simpson




PostPosted: Thu May 29, 2003 1:43 pm   Post subject: (No subject)

take a look at my custom created text box (located at turing submittions -> custom created GUI) i have used a method to do that...
i'm at school right now but i'll tell u how to do it exactly when i get home
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  [ 9 Posts ]
Jump to:   


Style:  
Search: