Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
RisTar
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 24th Jun 2003 14:53
how can i create text box input ??
just a normal text box ?
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 24th Jun 2003 17:07
not sure what you mean..... are you reffering to the input command? when activated it waits for the user to type in text and stores the text as a string variable, i think it goes something like:

input text$,"enter name:"

hardly ever use it though so i'm not sure

there is a manual way to do it though, withought using the input command. The input command doesn't work too well for a 3D rendered screen, it keep flashing as you type in the text.

to live is to suffer, to survive, well, thats to find meaning in the sufferening.....
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 24th Jun 2003 18:06
you could do a thing like:



feel free to use that code if you like.

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 24th Jun 2003 20:03
that takes up alot of room heres some input code, doesn't regcognise the returnkey but it works ok


for a text box couldn't you just draw a box to the screen then put some text in the middle???

hi guys
Red general
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 24th Jun 2003 20:03
you could clear the keyboard buffer and after each key is pressed, add the buffer to string and then clear the buffer again.

This is an accurate system, and usually works better than input, as this means that if you keep texting it when you are using 3D as well, then it does not vanish like input.


Hope this helps
RED GENERAL

My computer melts regulary - perhaps it likes being fondue
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 24th Jun 2003 20:18
whats a keyboard buffer???

hi guys
Bloodshot
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United Kingdom
Posted: 24th Jun 2003 21:05 Edited at: 24th Jun 2003 21:08
Hi ReD_eYe , Redgeneral is talking about accessing your keyboard presses via your Windows System.

A keyboard Buffer is a place where keypress values are stored in memory, ready for you to act on them.

It can be cleared (emptied of all previous keypresses) before you decide to start examining further presses with the Clear Entry Buffer and Entry() commands:

Troan
21
Years of Service
User Offline
Joined: 22nd Jan 2003
Location: Inner thought about nothing
Posted: 29th Jun 2003 03:15
I should make my name RedTroan

Rank: Newb
Exp: .01 Next Rank: 9.99
Hp 1/1 Mp 0/0
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 29th Jun 2003 22:13
Let's see. You want something like: (in your loop)

if delay=0
a$=inkey$()
a = asc(a$)
if a=>32 and a<=126 then en$=a$: delay=10
if keystate(14)
l=len(en$)
en$=left$(en$,l-1)
delay=10
endif
else
delay=delay-1
endif

then en$ holds whatever has been typed
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 29th Jun 2003 22:33
I wrote this snippet a while ago, its like a normal windows text box which you click on to select, then type stuff into it. It was written in DBPro.



You are the th person to view this signature.
GRAVITY: I fought the law but the law won
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 29th Jun 2003 22:39
I've done stuff like that, didn't think of using text width() to limit the string though. Good one.
FieldDoc
21
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 30th Jun 2003 14:05
You could use IanM's excellent realtime input function.



Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
k0shi
21
Years of Service
User Offline
Joined: 30th Dec 2002
Location: Cyberspace
Posted: 3rd Jul 2003 03:17
if you have dark basic enhanced you could use the entry buffer command.


famous last words-
Sorry im nervous, this is my first execution.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Jul 2003 23:21
Quote: "I've done stuff like that, didn't think of using text width() to limit the string though. Good one."


Thanks

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
Ishamael Sedai
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: France
Posted: 5th Jul 2003 19:28
what about something like that...
Quote: "
Function SpriteText Input(prompt$,x,y,W,H,N,BMP,cursor$)
backdrop on
repeat
if scancode()=14
cls
long = Len(Txt$)-1
Txt$ = LEFT$(Txt$,long)
goto skip
endif
Txt$ = Txt$ + inkey$()
skip:
for i = 1 to 5
if i = 1 then Spritetext (prompt$ + txt$ + cursor$,x,y,w,h,n,bmp)
if i = 2 then Spritetext (prompt$ + txt$ + cursor$,x,y,w,h,n,bmp)
if i = 3 then Spritetext (prompt$ + txt$,x,y,w,h,n,bmp)
if i = 4 then Spritetext (prompt$ + txt$,x,y,w,h,n,bmp)
if i = 5 then Spritetext (prompt$ + txt$,x,y,w,h,n,bmp)
sync
next i
until returnkey()=1
endfunction txt$"

w stands for width
h for height
n for the image number...
and so on

I am the Betrayer of hope naebl'is by the will of
the Great Lord of the Dark. If you do not want to surrender, your soul will burn in the deepest hole of the Pit of doom.

Login to post a reply

Server time is: 2024-11-24 20:32:45
Your offset time is: 2024-11-24 20:32:45