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.

DarkBASIC Professional Discussion / Can I get rid of the blinking cursor?

Author
Message
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 14th Jun 2003 00:54
Whilst the player is inputing something...the little blinking cursor that waits for the input annoys me and can appear to smear with typing. Is it possible to hide the cursor somehow?
Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
Rye
23
Years of Service
User Offline
Joined: 30th May 2003
Location: United Kingdom, Blackrod
Posted: 14th Jun 2003 01:15
you could use a realtime input function. ive got one you will probably need to adapt. but you should be able to change what comes after the text.

it needs an array as well. these need to be initialised before the function is run


dim RTtext$(6)
rem 1=text
rem 2=newkey
rem 3=oldkey
Dim RTtextflag(2)
rem 1=returnflag
rem 2=backspaceflag

do

message$=realtimeinput()
ink 0,0
box 10,570,400,599
ink RGB(128,128,255),0
text 10,570,RTtext$(1)

sync
loop

FUNCTION RealTimeInput()
IF KEYSTATE(14)=1
IF RTtextflag(2) = 0
IF LEN(RTtext$(1)) > 0 THEN RTtext$(1) = LEFT$(RTtext$(1),(LEN(RTtext$(1))-1))
RTtextflag(2) = 1
ENDIF
ELSE
RTtextflag(2) = 0
IF RETURNKEY()
IF RTtextflag(1) = 0
RTtext$(6)=RTtext$(1)
RTtext$(1) = ""
RTtextflag(1) = 1
ENDIF
ELSE
RTtextflag(1) = 0
RTtext$(3) = RTtext$(2)
RTtext$(2) = INKEY$()
IF RTtext$(2) <> RTtext$(3)
if ASC(RTtext$(2)) > 31
RTtext$(1) = RTtext$(1) + RTtext$(2)
endif
endif
returntext$ = RTtext$(1)
ENDIF
ENDIF
ENDFUNCTION returntext$

i used it out of my camera area so the box commands in the main loop may not be needed.

He who keeps his work in disorder gives home to chaos. Let him be struck with stone and iron to forge away his flaws
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 14th Jun 2003 01:41
Thanks for the function Ryan. I have tried to integrate it into my code without much success i'm afraid
I shall persevere though. Any other advice guys?

Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 14th Jun 2003 01:55 Edited at: 14th Jun 2003 01:56
I've got some editor code that you might find useful - however, its only prints using sprites & it requires one of my DLL's...

As I've abandoned my F-Eight game (to do something a little less graphically intense), I'll probably stick all the code on my web site.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Rye
23
Years of Service
User Offline
Joined: 30th May 2003
Location: United Kingdom, Blackrod
Posted: 14th Jun 2003 19:43
Replace the input command with the code below and see if that works.
when the Return key is pressed the loop will break.

while RTtextflag(1)=0
entry$=RealTimeInput()
text x,y,entry$
sync
endwhile

He who keeps his work in disorder gives home to chaos. Let him be struck with stone and iron to forge away his flaws
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 14th Jun 2003 23:04
Thanks for your help Ryan. I am still having problems though...firstly, was that written in DBC? Anyway, i've taken your lead and had a go at one myself. It's smaller than yours as once the user presses the RETURN key I can exit the loop. What is happening is that it prints the text out to the screen in real time, except that if I press the BACKSPACE key (keystate(14)) the whole string gets cleared, instead of just the last character!!!
Could anyone take a look and help me out please?



Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.
Rye
23
Years of Service
User Offline
Joined: 30th May 2003
Location: United Kingdom, Blackrod
Posted: 15th Jun 2003 00:15
if you type randomly until the text is almost off the screen then tap backspace really fast you will delete about 10 letters. This is because the program loops really fast and it deletes a letter each time backspace is held down. You need a timer so it only deletes a letter every half a second.

He who keeps his work in disorder gives home to chaos. Let him be struck with stone and iron to forge away his flaws
FieldDoc
23
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 15th Jun 2003 01:12
I see what you mean mate but i'm too dumb it would seem to solve it....if I add a SLEEP in there like I have below, it works as long as you don't hold the backspace down!

help!



Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.

Login to post a reply

Server time is: 2026-07-18 09:23:44
Your offset time is: 2026-07-18 09:23:44