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 / dbText() printing out an extra character

Author
Message
Ottersune
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location:
Posted: 2nd Dec 2008 01:37
I feel very smart not being able to figure out why dbText() is doing this, but this is about my first day working with DarkGDK. No matter what the character input for dbText, it always prints a ' Z' to the left of it. For example, printing out an '@' symbol produces output "@ Z". Has anyone else had this problem? Here's the relevant code:

char PlayerChar = '@';
int PlayerX = 0;
int PlayerY = 0;
// our main loop
while ( LoopGDK ( ) )
{
dbText(PlayerX, PlayerY, &PlayerChar);

ROLL THE DIE!
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 2nd Dec 2008 23:04
I believe that dbText is supposed to be used with character strings, not characters. Try

char PlayerChar [2] = "@" ;
int PlayerX = 0;
int PlayerY = 0;
// our main loop
while ( LoopGDK ( ) )
{
dbText(PlayerX, PlayerY, PlayerChar);

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Ottersune
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location:
Posted: 2nd Dec 2008 23:28
Ah! I see that now. I am a moron :p

thanks for the tip, I'm back on track now

~Kit

ROLL THE DIE!

Login to post a reply

Server time is: 2024-11-25 07:41:40
Your offset time is: 2024-11-25 07:41:40