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 / Help with setting Text over background!!

Author
Message
steakyfask
13
Years of Service
User Offline
Joined: 9th Jan 2011
Location:
Posted: 10th Jan 2011 02:16
Hi I have been using darkGDK for a few days and created a simple game. I want to allow text printed in the screen to keep scores but my background sits above and dose not show any text.
any help would be great, this has been bugging me for some time




#include "darkGDK.h"
#include "player1.h"
#include "player2.h"
#include "ball.h"

void DarkGDK(void)
{

dbSyncOn();
dbSyncRate(60);



dbDisableEscapeKey();

dbSetImageColorKey(255,255,255);


dbLoadImage("background.bmp",1);

dbLoadImage("dave.bmp",2);
dbLoadImage("lsdt.bmp",3);
dbLoadImage("topbottomline.bmp",4);
dbLoadImage("leftrightline.bmp",5);
dbPasteImage (1,10,20);
//background
dbSprite(2,50,220,2); //player1
dbSprite(3,590,220,2); //player2


dbSprite(10,0,0,4);
dbSprite(11,0,0,5);
dbSprite(12,635,0,5);
dbSprite(13,0,475,4);


player1 player1;
player2 player2;
ball ball;
while(LoopGDK())
{


dbText ( 10, 20, "text" );



player1.movement();
player1.hitball();
player2.movement();
player2.hitball();

ball.reset();
ball.movement();
ball.goal_check();
ball.collision();

if(dbEscapeKey() == 1)
{
break;

}



dbSync();

}

for (int i = 1; i < 14; i++)
{
dbDeleteImage(i);

dbDeleteSprite(i);
}
return;



}
steakyfask
13
Years of Service
User Offline
Joined: 9th Jan 2011
Location:
Posted: 11th Jan 2011 21:32
ANY ONE????


please????
dwillynt
13
Years of Service
User Offline
Joined: 15th Jan 2011
Location:
Posted: 15th Jan 2011 19:40 Edited at: 15th Jan 2011 19:50
don't know if anyone has helped you with this or not ,but you need to hide your background sprite then paste it, then you can place your text. The functions are described in the help file if you need help. You will need to change the parameters in the code below to what your values are of course.

ex:
dbHideSprite(30);
dbPasteSprite(30, 20, 20);
dbText(60, 220, "Press Space to begin game");
dwillynt
13
Years of Service
User Offline
Joined: 15th Jan 2011
Location:
Posted: 15th Jan 2011 19:42 Edited at: 15th Jan 2011 19:49
don't know if anyone has helped you with this or not ,but you need to hide your background sprite then paste it, then you can place your text. The functions are described in the help file if you need help.

ex:
dbHideSprite(30);
dbPasteSprite(30, 20, 20);
dbText(60, 220, "Press Space to begin game");

Login to post a reply

Server time is: 2024-09-28 14:01:30
Your offset time is: 2024-09-28 14:01:30