
-----------------------------------
Tubs
Fri May 23, 2003 11:38 am

invisible colourback
-----------------------------------
i want to make the background of text that the user enters have invisible colourback (like font.draw)

is this possible? how?

-----------------------------------
Asok
Fri May 23, 2003 12:06 pm


-----------------------------------
simple use Font.Draw to display what the user is typing

something like

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
Fri May 23, 2003 1:56 pm


-----------------------------------
you might wanna replace the
x+= 10 with x += Font.Width (ch, fontId)

-----------------------------------
Tubs
Mon May 26, 2003 11:41 am


-----------------------------------
ya that displays it but i also want what they enter to be a variable

-----------------------------------
Solo
Mon May 26, 2003 3:59 pm

Try this :)
-----------------------------------
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
Tue May 27, 2003 11:19 am


-----------------------------------
what does += mean?

-----------------------------------
Blade
Tue May 27, 2003 12:34 pm


-----------------------------------
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
Thu May 29, 2003 11:21 am


-----------------------------------
how can i make the backspace key work? all it does is put a box on the screen

-----------------------------------
Homer_simpson
Thu May 29, 2003 1:43 pm


-----------------------------------
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
