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 / Printing Screen Data to screen.

Author
Message
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 9th Oct 2009 16:27
Well I just started on another game ( yeah I don't finish my game because I get a better idea in my head ) and right now I'm just making my screen buttons etc. but now I'm trying to paste the screen props to the screen. So depth/width/height work well, exept that when I try to print the FPS. It seams as if it does not delete like the first number so it keeps writing over it until its 1 big white square. So how do I refresh the fps without the old one staying on screen.

Here's my code ( not much ):



The printing is based on the code Sparky uses in its ray collsion cast demo.

Isocadia
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 9th Oct 2009 16:40
Put dbCLS() in your loop, after dbSync() to clear any 2d stuff (including text).

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 9th Oct 2009 16:52
You can turn on the backdrop to stop it from being overwritten with dbBackdropOn() or you can clear the screen each frame with dbClear(0, 0, 0); for black or dbCLS(); (and its overrides) or you could paste an image to the screen as a background and that would also work.

If it ain't broke.... DONT FIX IT !!!
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 9th Oct 2009 17:20
If the background color is consistent I've usually just plopped a box of the background color down over the previous text then written the new data. Otherwise, as has been said, clear the screen and redraw everything.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 9th Oct 2009 18:11
Thank you guys, I got it working. And I really think that the documentation should be updated, alot of commands I see that are used are not in the documentation.

But completly off topic: I once saw Mista have a class or something to get your fps to like 2000. But I can't find the tread back. Does someone know what the title is or where I can find the used code??

Isocadia
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 9th Oct 2009 18:57 Edited at: 9th Oct 2009 20:56
NVM, fixed the problem, didn't make sprites of the images.

Isocadia

Login to post a reply

Server time is: 2024-11-20 13:37:19
Your offset time is: 2024-11-20 13:37:19