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 / Deleting Text

Author
Message
TeenCHristian
14
Years of Service
User Offline
Joined: 22nd Jun 2010
Location:
Posted: 13th Sep 2010 01:44
Hey there. I've been working with a basic text based game, and I've encountered a problem. I want a number to increase by one every time I push a button. I have that part down... my problem is that the second number overlaps the first number. Is there a way to delete the first layer of text (not using "dbCLS;")

Thanks a ton!

Learning C++
Proud member of www.codecall.com
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 13th Sep 2010 02:53 Edited at: 13th Sep 2010 02:54
either create a 3d object and hide it (or not, its up to you) and set the backdrop color to the color you want for the background (dbSetBackdropColor (...), not sure of spelling though)

or use dbBackdropOn ( ) (or Off, i dont really remember )

Greg_C
14
Years of Service
User Offline
Joined: 22nd May 2010
Location:
Posted: 13th Sep 2010 04:13
Well I am not to sure if you are using custom text but couldn't you just convert an int to a string and then just increment that number when you hit a button?
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 13th Sep 2010 08:43
Set a background colour for the text and then the background will erase the previous text. By default text is transparent but you can set to it to opaque with dbSetTextOpaque. The background colour can be specified with dbInk.
TeenCHristian
14
Years of Service
User Offline
Joined: 22nd Jun 2010
Location:
Posted: 18th Sep 2010 17:39
Mireben, setting the text to dbSetTextOpaque(); works like a charm! Thanks a ton.

PS. Is there a reputation system on these forums? like you give people reputation when they post something helpful?

Learning C++
Proud member of www.codecall.com
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 19th Sep 2010 10:19 Edited at: 19th Sep 2010 10:20
I'm glad to be of help, thanks for the feedback.

I think there is no such voting system for forum users. Sometimes the moderators give the "valued member" status or other badge to appear next to somebody's name but you really have to do a lot to achieve such status.
TeenCHristian
14
Years of Service
User Offline
Joined: 22nd Jun 2010
Location:
Posted: 19th Sep 2010 20:57
Gotcha, well if there was a voting system +vote for you.
I was also wondering, I have this code:


Here is my problem... When I push the up key the music plays (but doesn't stop until I push the down button. Thats fine). When I press the up key the sprite also animates to frame 2, which is my wanted reaction, but unlike the music it stops when the up button is released. How would I go about animating a sprite until the down key is pressed?

Thanks!

Learning C++
Proud member of www.codecall.com

Login to post a reply

Server time is: 2024-11-19 18:24:56
Your offset time is: 2024-11-19 18:24:56