Author |
Message |
Tubs
|
Posted: 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
|
|
|
Asok
|
Posted: 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
|
Posted: Fri May 23, 2003 1:56 pm Post subject: (No subject) |
|
|
you might wanna replace the
with code: | x += Font.Width (ch, fontId) |
|
|
|
|
|
|
Tubs
|
Posted: 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
|
Posted: 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
|
Posted: Tue May 27, 2003 11:19 am Post subject: (No subject) |
|
|
what does += mean? |
|
|
|
|
|
Blade
|
Posted: 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
|
Posted: 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 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Homer_simpson
|
Posted: 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 |
|
|
|
|
|
|