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 / really REALLY annoying glitch with text.

Author
Message
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 16th Jun 2010 23:34
hello. i am currently working on a game that has a 1970's, DOS type computer motif to it, and as such, much of the animation involves text. i have put up with an annoying glitch for about a month now, but its getting to the point where i can no longer create a workaround.

Ok, say you have a string of text, "this is a strink", you have entered a character wrong, so you hit backspace, and hit g to change it to "this is a string". using dbText, instead of removing the old character, it just leaves it there, and writes over it. using the clear screen function (dbCLS) creates and annoying flicker with every keystroke. the dbBox function, to create a box the size of a character, the same color as the background, will not suffice, as text is written over inking and drawing operations. is there some concept to this that i am blind to? because i have run out of ideas.

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
http://www.lionsbloodstudios.justinman.net/index.htm
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 17th Jun 2010 21:19
Well, might not be the best solution, but you can create any object, hide it and make the backdrop color to whatever you want, then, this wont happen, because you have a 3d object in scene (but not seen), you can also use this object as a background if you wanted

JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 17th Jun 2010 23:59
You really can't use dbCLS() for this, but;

You could, before acknowleging any new text changes, do a dbGetImage() call that gets a copy of the screen section where you are about to paste the text (plus a little buffer room for the next character).

Then, when the next character arrives - if you need to hit the back-space, you make your changes to the character string (the same as you are now) but instead of pasting the new string - paste the bitmap that you stored as the buffer instead...

I hope this makes sense...

JTK
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 18th Jun 2010 06:25
um, just use dbText() and dbSync() with dbBackdropOn() and that should be the most simple route to what you are trying to accomplish

*Hint*
use dbText() to redraw the text on screen each loop


Making dreams possible, one line at a time...
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 25th Jun 2010 01:34 Edited at: 25th Jun 2010 01:34
First use 'dbSyncOn()' at the top of your program. This will prevent the screen updating until you explicitly tell it to.

Now draw your text every loop, then call 'dbSync()' to explicitly update the screen and finally call 'dbCLS()'. This will cause no flicker and there will be no text left behind from a previous loop as CLS is used every time.

Login to post a reply

Server time is: 2024-11-19 20:52:26
Your offset time is: 2024-11-19 20:52:26