Computer Science Canada

invisible colourback

Author:  Tubs [ 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?

Author:  Asok [ Fri May 23, 2003 12:06 pm ]
Post 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

Author:  Homer_simpson [ Fri May 23, 2003 1:56 pm ]
Post subject: 

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

Author:  Tubs [ Mon May 26, 2003 11:41 am ]
Post subject: 

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

Author:  Solo [ 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.

Author:  Tubs [ Tue May 27, 2003 11:19 am ]
Post subject: 

what does += mean?

Author:  Blade [ Tue May 27, 2003 12:34 pm ]
Post 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..

Author:  Tubs [ Thu May 29, 2003 11:21 am ]
Post subject: 

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

Author:  Homer_simpson [ Thu May 29, 2003 1:43 pm ]
Post 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


: