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

Author
Message
Gammer_
15
Years of Service
User Offline
Joined: 23rd Nov 2008
Location:
Posted: 23rd Nov 2008 22:45
Hey there,

I am kinda new to Dark GDK. I'm now trying to print messages to the screen using the dbText function. Allthough when I use it; the message stays on the screen forever. Am I doing something wrong, or overseeing something, or is this intended?

I would like to know how to make a message dissapear again.

Thanks in advance.
Swordsman
15
Years of Service
User Offline
Joined: 12th Nov 2008
Location: Wigan, England
Posted: 23rd Nov 2008 23:04
Use dbCLS() to clear the screen, can you provide a bit more detail? Are you using it in the main game loop with dbSync as it will keep drawing itself every frame
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 23rd Nov 2008 23:04
dbCLS() is for clearing the screen. You can optionally provide a color as a DWORD, which you can get from dbRGB().


Screen is cleared with a red background.


My site, for various stuff that I make.
Gammer_
15
Years of Service
User Offline
Joined: 23rd Nov 2008
Location:
Posted: 24th Nov 2008 01:23
I am trying to use dbText in the main game loop yes. Should I use it anywhere else? And when I use dbCLS it literally clears anything on the screen, also images etc. I had on it, wich is something I don't want. Or am I doing something wrong?
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 24th Nov 2008 15:27
You must turn sync on, and redraw everything you want to have left.
Like this:
Gammer_
15
Years of Service
User Offline
Joined: 23rd Nov 2008
Location:
Posted: 25th Nov 2008 14:13 Edited at: 25th Nov 2008 15:02
So, if I want to remove some text created by dbText I need to clear the screen first, then redraw everything again? Is there really no easier way? This seems to work though.

Also, if I look into the code of the "Dark Dungeon FPS" or the "Sprite Showcase" (one of the samples) it shows the fps on the screen using dbText, and it keeps updating it properly but, I don't see dbCLS used anywhere. Anyone know how it's done there?

Login to post a reply

Server time is: 2024-09-30 11:38:00
Your offset time is: 2024-09-30 11:38:00