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 / Input and Backspace

Author
Message
mediafanatic
10
Years of Service
User Offline
Joined: 24th Oct 2013
Location:
Posted: 25th Oct 2013 00:38
So I am fairly new to Dark Basic. I have a .jpg image as my background and a small .png on top of that. I have the input command on top of the .png and it works fine until you hit backspace and it turns black behind the letters.

example of my code

load image "background.jpg",1
load image "box.png",2

paste image 1,0,0
paste image 2,400,400,1

set cursor 420,420
input "Answer: ",answer$
wait key

Sorry if this has been posted, I could not find any mention of this.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 25th Oct 2013 01:40
Welcome to the forums!

A direct solution to your problem:
use the SET TEXT TRANSPARENT command, it should remove the black background.

Recommended solution:
The black is good in case the image behind it is colored the same as the text color, however it can be a bit of an eyesore. I would recommend using the BOX command to draw an entire entry line in the same color as the back of your text (black, in this case). This will prevent the unsightly extra black parts from being visible.

Best solution (in my book):
This is a bit more complicated, and it seems like you are new, so maybe take this with a grain of salt. Using the ENTRY$() command in conjunction with CLEAR ENTRY BUFFER would allow you to create your own input system, allowing you to control screen refreshes between keystrokes (you could draw the box for visibility but limit it to the size of the text). However, you would have to custom program how to handle the enter key, backspace key, etc, so it is a bit more work.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose

Login to post a reply

Server time is: 2024-03-29 09:33:55
Your offset time is: 2024-03-29 09:33:55