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 Discussion / Text Problems

Author
Message
JJAC116
19
Years of Service
User Offline
Joined: 3rd Oct 2006
Location:
Posted: 17th Oct 2006 03:50
In my 3D game, I load a bitmap, print text on the bitmap, use the 'get image command' and create a sprite with the image as a text bar in the same shape as the bitmap. This allows me to print text to the screen. But when I try to use it with the input command (input "->",input$) it doesn't print it to the screen until I hit 'enter.' Am I explaining myself clearly? How do I fix this?
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th Oct 2006 04:17 Edited at: 17th Oct 2006 04:17
When you use "input" it stops all action till you hit enter. So if you have "sync on" it won't update the screen till it sees a "sync". It's better to use "entry$()" for input to give you better control.

CreamPie
19
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 17th Oct 2006 12:42
JJAC116,

In some aspects, YOU must 'rig' a dynamic keyboard input within your programs.
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 17th Oct 2006 13:51 Edited at: 17th Oct 2006 13:58
@Grog: There is no ENTRY$ command in DBC. Hold on let me find a snippet I made a while back...

EDIT: Nevermind the snippet doesn't work well. The Inkey$() command may help though...

Ummm...
Bob_42
19
Years of Service
User Offline
Joined: 15th Sep 2006
Location: Guernsey
Posted: 17th Oct 2006 18:31 Edited at: 17th Oct 2006 18:32
there is an entry$() command, i would imagine thats what he was refering to, i didn't know it existed until i saw it in a code snippet, because i haven't seen it in any of the help files :/

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Oct 2006 22:18
@Grog

Get rid of that 1 in the entry$() command in your snippet. Should be

a$=entry$():clear entry buffer

instead of

a$=entry$(1):clear entry buffer

Atleast in DBC.

Enjoy your day.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Oct 2006 00:47
Sorry about that everybody... forgot what base I was in. The version I posted was for Pro.

Here's the two versions that are valid in this base. Both look the same as the Pro version on the screen.

Darkbasic Classic ( with inkey$() )
In this one the timer it still there but in an if/then statement by itself... so a$ can be cleared to prevent the backspace character (a vertical line) to be added to the string when the timer() is below the time it allows backspace to work.





Darkbasic Enhanced ( with entry$() )
This one has a for/next loop for a$ because it sometimes has more than one character (without this it also adds the backspace character to the string). And the return has to be taken off Com$ before it exits the do/loop.



Both have a "cls" that can be replaced with a pasted image of your choice. Again sorry about that. I'll pay more attention next time.

Login to post a reply

Server time is: 2026-07-06 10:39:30
Your offset time is: 2026-07-06 10:39:30