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.

Dark GDK / Printing Constantly Updating Text

Author
Message
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 1st Sep 2009 08:47
Hi, I'm trying to print the location of my vehicle (in two dimensions) on screen for every frame. The problem I'm encountering is that the text doesn't clear from its previous numbers so it ends up writing over its self. Can anyone show me how to printing text that doesn't write over itself?


Current code:
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 1st Sep 2009 09:23 Edited at: 1st Sep 2009 09:23
First of all, don't use dbStr(), if you do then make sure you free the memory it allocates.

Use something like this:


Next, I assume it's being overwritten because your scene is purely 2D without any sprites etc, in which case you may wish to put dbCls() at the start of your loop, or put dbBackdropOn(); before your loop.

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 1st Sep 2009 09:44
I can't use dbCLS() because it causes the screen to go compeletly black and dbBackdropOn() made no difference.

P.S. I have implemented your suggested code.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 1st Sep 2009 09:49
Show us more code then, it can be any number of things going wrong and that function alone should be fine.

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 1st Sep 2009 10:02
Thats all for the print object. The whole program is too big to post here (50,000+ lines)





dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 1st Sep 2009 10:30
Does your scene have any 3D objects or sprites? If so then your background should be getting wiped every frame thus making such overwritten numbers not possible, unless you're writing multiple things per loop to the same location. It's really quite hard to help you when you've given so little info.

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 1st Sep 2009 10:42
I think I figured out what was happening.

I've divided my screen into 4 parts (one for each camera) but I had turned of the part that was displaying my numbers. After enabling it, the numbers are refreshing like normal.

Login to post a reply

Server time is: 2024-10-01 12:31:27
Your offset time is: 2024-10-01 12:31:27