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 / Confused about text-command

Author
Message
tha_rami
19
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 1st Dec 2007 07:51
Please review the following code:



I'm using a modified version of a text output code I found, and while it works with normal text it doesn't work in this modification. The screen is set to a width of 800. If I enter any string that's over one line (text width > 600), only the last line gets printed. I'm confused - why doesn't this work, and how can I fix it?


A mod has been erased by your signature because it was larger than 600x120
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 1st Dec 2007 18:15
The only thing I can think of is you are overwriting the string with the last line.
can you explain what you're trying to do?

"You must be someone's friend to make comments about them." - MySpace lied.
tha_rami
19
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 1st Dec 2007 19:08
Well, the function is used like:

repeat
answer = input("How much money do you want to invest?")
until answer > 0

The string should be printed to the screen, the object is nothing but a grey background. It is removed. The objects being deleted at start are menu buttons.

Then, the function lets the player input a string which is shown on screen. The key I'm checking for (14) is backspace; if pressed, it removes the last character in the string.

The problem is that if the line overflows the width of the text wrap function, only the last line is being printed and I can't see why. The input works correctly.


A mod has been erased by your signature because it was larger than 600x120
SFSW
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 2nd Dec 2007 01:47
Did you include the draw to front command to make sure the text is rendered in front of any 3D objects?

tha_rami
19
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 2nd Dec 2007 04:08 Edited at: 2nd Dec 2007 05:12
Heya, Vice, nice to see you out here! I'm honored, heh . Getting out of the routine with Evochron for a while? How cool to see the logo I made you as avatar here .

In any case, yeah, I'm using draw to front. Actually, I've got no idea what is causing this in any case. And even worse: I just fixed it. Still have no clue, but everything works now so I guess I'm moving on again.


A mod has been erased by your signature because it was larger than 600x120
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Dec 2007 20:41
I think since you are using a 3D object the backdrop might have been updating and wiping the previous lines
sounds clever, was that it?

"You must be someone's friend to make comments about them." - MySpace lied.

Login to post a reply

Server time is: 2025-06-05 18:13:57
Your offset time is: 2025-06-05 18:13:57