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 / trouble with INPUT statement in my matrix editor

Author
Message
hooray_for_db
21
Years of Service
User Offline
Joined: 11th Jul 2003
Location: United States
Posted: 20th Jul 2003 07:26


I use an INPUT statement for the user to name their matrix in the save subroutine (SaveMatrix) of my incomplete matrix editor. The problem is when you hit save (shift+s) the prompt to name the matrix does not appear. As you type a filename, you can only see what you are typing as long as you have the keys held down.

I've tried turning off sync and breaking out of the main program loop, but it seems once I've drawn 3-d stuff to the screen the INPUT command just does not function propertly.

Help would be greatly appreciated.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Jul 2003 17:37 Edited at: 20th Jul 2003 17:38
Draw To Front is not enough to put text over a 3D screen! Use:

Set Camera View 0,0,1,1

This will turn off the camera, but the 3D image view will not disappear. Do your text stuff then set the camera view back to normal with:

Set Camera View 0,0,800,600

TDK
hooray_for_db
21
Years of Service
User Offline
Joined: 11th Jul 2003
Location: United States
Posted: 22nd Jul 2003 23:33
Thanks, TDK! Looks like that's gonna do the trick. Gee, I never would have thought of that.




Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 22nd Jul 2003 23:44
Whoa, I feel stupid now. I wasted all that time writing a custom INPUT command when the solution was so simple?

Hmm, I guess the advantage with mine is that it doesn't pause the rest of the engine when you're text inputting.... small loss tho.



hooray_for_db
21
Years of Service
User Offline
Joined: 11th Jul 2003
Location: United States
Posted: 24th Jul 2003 03:28
Is it possible to make PRINT and INPUT use the current text settings (set text size, set text font, etc)?

It is easy enough to replace PRINT with TEXT, but what if you wanted to get input from the user and have it display on the screen with... I dunno... size 42, italic, green letters as they enter it? Would you need to write your own function to do something that basic?

Ag3ntSm1th
22
Years of Service
User Offline
Joined: 13th May 2003
Location:
Posted: 24th Jul 2003 09:14
just wait, im sure Hell IVIonkey will help you out... if he doesn't, i'll whip something up. too tired to do it right now

"The secret to creativity is knowing how to hide your sources." - Einstein
my DarkBasic creations - http://www.sixurbanninjas.tk
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Jul 2003 16:46
I reckon you should forget about the INPUT command and follow Monkeys route in making a custom function, besides looking better, you can do some neat tricks (like adding a virtual keyboard for clicking the keys instead) - plus the very important mouse control, so OK and Cancel buttons can be used (makes things sooooo much neater). The Input command is notoriously ugly, I suggest you take note of the scancodes for return, backspace etc, then check the inkey$() for keystrokes. It's not that difficult, I could show you my input box function later (in about 5 hours - at work just now) if it'll give you a start.


Van-B

My cats breath smells of cat food.
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 25th Jul 2003 13:03 Edited at: 25th Jul 2003 13:04
Here's a rudimentary but good enough method:


hooray_for_db
21
Years of Service
User Offline
Joined: 11th Jul 2003
Location: United States
Posted: 26th Jul 2003 07:18
Thanks Monkey (and everyone else)! That's certainly cleaner than if I had tried coding my own input function.

Login to post a reply

Server time is: 2025-05-19 22:40:16
Your offset time is: 2025-05-19 22:40:16