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() not working for me

Author
Message
Metroid Larvae
15
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 1st Dec 2008 22:04
I am trying to output the score caption for my Pacman game but nothing ever shows up. I do have a black background but even if I don't load the background there is no text in the desired position.

Here is what tried to use


Also how would I output an int PacmanScore variable write next to the Score caption.
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 2nd Dec 2008 13:16
dbInk(dgRGB(255,255,255), dbRGB(255,255,255)); Will make both the foreground and the background white. However it don't do it now, but I recommend that you should change the code into dbInk(dgRGB(255,255,255), 0); If you want to color the background, you should use CLS([color]);.

You must turn sync on (dbSyncOn(); at the beginning of the main function) and place dbSync(); into the main loop in order to view the text.

To print the score, you can use strings or a char array. If you choose the char array alternative, you shold use the strcat function. I don't know how to use strcat, so I use strings instead:
Kilrath
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Alberta
Posted: 3rd Feb 2009 06:35
in my experience the text draws first and the sprite over it... perhaps a dbDrawSpritesFirst(); will help

Saving the world, one bit at a time.... Wait it's not worth saving. Get your own bits!

Login to post a reply

Server time is: 2024-09-30 11:39:02
Your offset time is: 2024-09-30 11:39:02