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 Professional Discussion / Set text size slow down

Author
Message
Mr Universe
15
Years of Service
User Offline
Joined: 15th Dec 2010
Location:
Posted: 16th Dec 2010 05:32
Hello! I have been using dark basic for years but have never been able to actually make anything. I started working on this my latest endeavor and this time I'm am going through with it. But as with every other program I have tried to make I get to a problem I have no idea how to correct. So I come begging for help on my probably inane error so I can continue.

I am trying to make a frontend like steam to launch all of my games from. I want it to eventually back up save files and track playing time but fot now I just want it to display my text smoothly. It works by loading info for each game from a folder of text files like this:

Borderlands
C:\Users\Shelby Jueden\Documents\My Games\Borderlands\SaveData
Save0001.sav
C:\Program Files (x86)\2K Games\Gearbox Software\Borderlands\Binaries
Borderlands.exe

When I am finished I want it to look like this:


My problem is when I try to set the text size to be 18 it makes the program run half as fast.

I appreciate any help!

BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 16th Dec 2010 09:38 Edited at: 16th Dec 2010 09:56
I tried your program it runs fast for me.
How do you know it runs 1/2 as fast without a screen fps() line, just a visual slow scrolling?
What part runs slower, the scrolling? If yes, How many items are you scrolling?
If you print below the screen, the auto page scrolling is slow, you don't want to do this.
If you reverse the size 30 and size 18 at the bottom of your code, does the size 30 then become the slow size?
Mr Universe
15
Years of Service
User Offline
Joined: 15th Dec 2010
Location:
Posted: 16th Dec 2010 09:47
yes. If I change the code to have a "`" before the "set text size 18" then it runs faster. I didn't know about the fps command.
Mr Universe
15
Years of Service
User Offline
Joined: 15th Dec 2010
Location:
Posted: 16th Dec 2010 09:58
I'm double posting because you modified you post while mine was in check. I can't find the fps command. I have six file scrolling. I reversed them and I get the same error.

Just in case it makes a difference I am running the free version on 64 bit windows 7.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Dec 2010 12:58
You need Cloggy's D3D plugin. It will not only provide a much faster way to change fonts, but it will also anti-alias them, so they will appear with smooth edges, and look just like your screenshot. With standard DBPro text, it will never look that smooth.

Health, Ammo, and bacon and eggs!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 16th Dec 2010 13:12
And just to add another method, Bitmap Font. Won't be as fast and as easy (know where near) to implement as Cloggy's D3D plugin, but its image based font, so you've got a ton of control when it comes to editing how your font looks.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Dec 2010 14:11
Yeah, cloggy's plugin is great. I use it all the time. You can have up to I think 7 different fonts... more than enough for this use.

Or you could use a plugin that creates a browser window like BlueGUI and have these pages in html.

Mr Universe
15
Years of Service
User Offline
Joined: 15th Dec 2010
Location:
Posted: 16th Dec 2010 17:53
Cool! thank you! Where do I get it and is it free?
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Dec 2010 18:07
Mr Universe
15
Years of Service
User Offline
Joined: 15th Dec 2010
Location:
Posted: 16th Dec 2010 19:25
I installed the plug-in but am having a new problem. I got it to display the text and it does go fast at first, but it slows to a crawl after a second or two of movement.

BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 16th Dec 2010 20:49 Edited at: 16th Dec 2010 20:50
Are you printing past the bottom of the screen making it scroll?
Also, post some example code showing the problem for us to compile and test
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Dec 2010 23:04
I think you can setup your 30 and 18 size fonts outside of that routine, like put them at the start of your program...

D3D_FONT 1,"Tahoma",30,0,0,0
D3D_FONT 2,"Tahoma",18,0,0,0

So thats 2 fonts, then specify which font when using d3d_text...

rescroll:
cls
D3D_STARTTEXT
for ss=1 to checklist quantity()-2
d3d_text 1,200,(ss-2)*100+scroll,0,str$(ss)+" - "+GameName$(ss)
next ss

for ss=1 to checklist quantity()-2
d3d_text 2,220,(ss-2)*100+scroll+24,0,GameExeN$(ss)+"-"+GameExeL$(ss)
next ss
D3D_ENDTEXT
return

I'm not 100 percent sure though, it has been a while since I used D3D.

Health, Ammo, and bacon and eggs!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Dec 2010 00:21
Yes you should set the fonts up before your loop.

Mr Universe
15
Years of Service
User Offline
Joined: 15th Dec 2010
Location:
Posted: 17th Dec 2010 00:35
It worked! Thank you! The text all seems much larger compared to the dbp standard but I just set the size to be 4 less so it looks ok.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 18th Dec 2010 22:09
Didn't notice anyone tell you the "screen fps()" command. That's it, lol. Oh another you might find handy is statistic(1). That is number of polygons on screen.

http://s6.bitefight.org/c.php?uid=103081
Mr Universe
15
Years of Service
User Offline
Joined: 15th Dec 2010
Location:
Posted: 19th Dec 2010 05:45
Thank you I couldn't find it and it was bugging me.

Login to post a reply

Server time is: 2026-07-21 03:10:49
Your offset time is: 2026-07-21 03:10:49