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 / Help me with text!!

Author
Message
my name here
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: bosnia & herzegovina/ba
Posted: 27th Sep 2010 21:50
ok first of all i haven't used DBPro for quite some time. But i returned cuz I want to start a new project with some friends. But my skills... well... got a bit "rusty". Here's a problem wich i DO remember from before but don't know how to fix it. Here's it in short i have a 3d scene and want to write some text but the screen goes black and i see ONLY the text, then i do some play with that and a bit that, but still couldn't fix it. ANYONE HELP?? here's a very small part of my source just for example:

set text transparent
color backdrop 0
sync rate 0
do
if DEBUG=1 and controlkey()=1
set text font "CHILLER"
set text size 35
text 0,0,"Camera pos: X="+STR$(object position x(1))+" Y="+STR$(object position y(1)+15)+" Z="+STR$(object position z(1)+15)
text 0,100,"Car Model pos: X="+STR$(object position x(1))+" Y="+STR$(object position y(1))+" Z="+STR$(object position z(1))
text 0,200,"Terrain Model pos: X="+STR$(object position x(3))+" Y="+STR$(object position y(3))+" Z="+STR$(object position z(3))
text 0,300,"FPS: "+STR$(screen fps())
endif
and so on...
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 28th Sep 2010 00:04
Well the 'and so on' would have been the most important... it ends at a "sync : loop" right?

Also, change text type/size before DO, once. It is one freakin slow of a process to do that every loop... and totally not necessary...
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 28th Sep 2010 18:22
You may have problems if you don't declare: sync on

Even if you fix the blank screen, it will "flicker" without the sync on....

Try this:


The fastest code is the code never written.
my name here
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: bosnia & herzegovina/ba
Posted: 28th Sep 2010 20:40
first thx for post. and yes i put "sync"... i haven't used dbpro for some years but i still remember the basics like that, and i tried this little rewrite hawkblood mentioned but still black... but i think this is a bug because a friend of mine wrote the same code but in another project and got it working...
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 29th Sep 2010 16:48
Post the do-loop section in it's entirety. Include all the setup code such as display options section. We will figure this out!

The fastest code is the code never written.
my name here
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: bosnia & herzegovina/ba
Posted: 29th Sep 2010 17:59
ok here's the source but it's not my main source it's just one source of 45 but i think you don't need the rest but if you do just let me know it will be open source anyway...
my name here
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: bosnia & herzegovina/ba
Posted: 29th Sep 2010 23:41
ooooops... ok HERE's the source...


enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 30th Sep 2010 01:17 Edited at: 30th Sep 2010 01:18
Don't know if this helps, but I made something that runs fine, based on your source...



- enderleit
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 30th Sep 2010 16:06
Yes, enderleit's should work fine. Notice the "sync on" command? He also didn't mess with the camera position.... You can, but it's better to do any camera movement/orientation at the beginning of the do-loop and all your text rendering just before the sync.

The fastest code is the code never written.
my name here
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: bosnia & herzegovina/ba
Posted: 30th Sep 2010 17:12
ok found it finally! thanks to all for help but the problem was my pc! i noticed that after loading some other simple models (cubes) instead of my real the game worked. It was because my OS is very wrecked... I formated my HDD and installed my Win7 again and now it works at full speed! thx to enderleit for giving me the idea!
my name here
15
Years of Service
User Offline
Joined: 27th Sep 2010
Location: bosnia & herzegovina/ba
Posted: 30th Sep 2010 17:18
... and by the way, yes i put sync on but on my main source, as far as i know it's enough to put it once and it will work for the whole project and the DEBUG variable is set to 1 ONLY if the parameter on the shortcut is added (i.e. "c:\...some folders\nonameyet.exe" -DEBUGME)
and thx again
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 1st Oct 2010 18:02
Quote: "as far as i know it's enough to put it once and it will work for the whole project "

That's correct. I just didn't see "sync on" in the code you posted.

The fastest code is the code never written.
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 1st Oct 2010 20:22
Glad I was helpful, in some small way...

- enderleit

Login to post a reply

Server time is: 2026-07-23 15:49:10
Your offset time is: 2026-07-23 15:49:10