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 / dbPrint - it prints but dissapears right after

Author
Message
diemauerdk
13
Years of Service
User Offline
Joined: 8th Dec 2010
Location:
Posted: 8th Dec 2010 21:16
Hi

I have a problem with dbPrint. I want to display a score in my game which is the variable GLOBALCOUNTER - declared as a global integer after the includes. I do also have a char buffer as global.

#include "DarkGDK.h"
...
long int GLOBALCOUNTER = 0;
char buffer[100];
...

in the function darkGDK() there is a loop called LoopGDK().

in that loop i do the following:

while ( LoopGDK ( ) )
{
...
sprintf(buffer, "Your Score is:%i ", GLOBALCOUNTER);
dbPrint(buffer);
...
}

The variable buffer is being printet BUT right after it has been printet it disappears again if i put fx a dbWait that waits 1 sec the variable is shown that one sec and disappears right after.

i dont know what to do - cant find other peoples with same problem.

Hope someone can help

DieMauerDK

john
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 9th Dec 2010 06:07
dbPrint is a 2D command and will get overwritten by anything 3D, such as the backdrop. Try using dbText, and make sure you call it every frame. If not, then you must dbSyncOff() with dbCLS() to wipe the display.

diemauerdk
13
Years of Service
User Offline
Joined: 8th Dec 2010
Location:
Posted: 9th Dec 2010 08:16
I tried that but it is the same problem - it dissapears right after it is shown. Maybe you are right, that i am overwriting it but i cant see what could be overwriting it i am makeing a 2D game so i got no 3D elements. Thx for reply!

john
diemauerdk
13
Years of Service
User Offline
Joined: 8th Dec 2010
Location:
Posted: 9th Dec 2010 08:16
I tried that but it is the same problem - it dissapears right after it is shown. Maybe you are right, that i am overwriting it but i cant see what could be overwriting it i am makeing a 2D game so i got no 3D elements. Thx for reply!

john
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 10th Dec 2010 18:23 Edited at: 10th Dec 2010 18:24
Can you post the whole code? (If it's not several hundred lines yet.) Maybe then we can find the problem.

Login to post a reply

Server time is: 2024-11-19 16:35:52
Your offset time is: 2024-11-19 16:35:52