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 / Problems with text disappearing

Author
Message
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 4th Apr 2007 06:45 Edited at: 4th Apr 2007 11:18
Hi, Please can someone help with these 2 problems?

1. it seems such hard work to print text to the screen and to keep it visible once entering into a loop. The way I've over come this is to keep retexting info on the screen which is causing huge slow down issues with large arrays. Surely there is an easier way to doing this.

Do
For i = 1 to 30
text i*20,0,Goods$(i)
next i
...
loop

NB. If I put the text command before the loop it disappears from the screen after wards which is why i include it in the loop. Surely there is an easy way to "text" before the loop and keep the info on screen

2. How do you print text in one font and color on the screen, then text on the same screen something else in a different color so both are displayed at the same time. Might sound really obvious but having tried putting different font and color commands before each text command it doesnt seem to work e.g.

Do
Set Font "arial"
Set text size 20
Text 20,20,"ARIAL 20"

Set Font "Times new roman"
Set text size 40
Text 80,80,"TNR 40"

Loop

Thanks for any help on these
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Apr 2007 09:59
Text is wiped every loop. If you want it to remain, it's better to use a sprite, and write the text on that. This also has speed issues if you're changing it frequently. In which case, you need to consider making sprites for each number/letter, and placing them individually to make up your text.

There's no quick solution. There's a DLL somewhere called D3D (use the search button), which allows much faster, more functional text.
Hangar18
18
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 4th Apr 2007 11:42
Thanks I sort of feel better knowing it wasnt an easy fix. What a hassle though as it looks like D3D is going to take a while to get the hang off so I'll try making a big "line" style sprites and inputing text that way.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 4th Apr 2007 12:26
It's SET TEXT FONT by the way. Your code works fine for me.



As mentioned though you should try and use cloggys Dll as it does superfast anti-aliased text.

Changing font in main loop in DBPro is a big no-no as it reloads the font every call. It does not cache the font at all.

You can just use the INK command to change colour, but once again DBPro really slows down if you change colours lots of times in loop.



Basically the 2D capabilites of DBPro are a bit lacking in speed and could do with some rewriting, but DBPro is more about 3D games, sprites, etc which work just fine.

Boo!

Login to post a reply

Server time is: 2025-05-28 20:53:10
Your offset time is: 2025-05-28 20:53:10