Posted: Mon Feb 15, 2010 9:32 am Post subject: Clear a portion of the screen
What is it you are trying to achieve?
I want to program a game where there is a scoreboard on the top, and there will be a message saying enter value, and let the user input a value.
What is the problem you are having?
Since there is a scoreboard on the top, I can't let it go to the next line for every input the user inputs. Is there a way to partially clear a screen? I want the enter value line to always be on that line, and the user entering the value line to always be on the same line as well.
Describe what you have tried to solve this problem
cls clears the whole screen. Using a loop and locating the text gets the first line to always be there, but then the user entered value from last time will still be on that line. It works, but I need to make it look prettier than that.
Please specify what version of Turing you are using
4.11
Sponsor Sponsor
Zren
Posted: Mon Feb 15, 2010 9:57 am Post subject: RE:Clear a portion of the screen
Draw a White Rectangle over it? Same thing as cls really except it won't reset put's location back to 0,0.
Truthfully there's also View.UpdateArea (), but you probably want to update the scoreboard too. And thus will have to redraw the scoreboard anyways if you use cls with it.
chengbin
Posted: Mon Feb 15, 2010 10:06 am Post subject: Re: RE:Clear a portion of the screen
Zren @ Mon Feb 15, 2010 9:57 am wrote:
Draw a White Rectangle over it? Same thing as cls really except it won't reset put's location back to 0,0.
Truthfully there's also View.UpdateArea (), but you probably want to update the scoreboard too. And thus will have to redraw the scoreboard anyways if you use cls with it.
Thanks. That works.
sriyegna
Posted: Tue Mar 02, 2010 6:56 am Post subject: RE:Clear a portion of the screen
Hello Zren, i have been having a similar problem and im hoping you can help me. I cant loop my program and i have an image as my background with buttons on it as wel as a menu on the top. Using CLS clears it all and i only want to clear the text thats been put on the image.
Would i have to create a new procedure that just loads the buttons and background image and menu again?
DemonWasp
Posted: Tue Mar 02, 2010 11:43 am Post subject: RE:Clear a portion of the screen
You probably don't have to recreate the GUI elements you have; it should be enough to redraw the background then call something like GUI.Show on all your UI components to encourage them to redraw themselves.
That said, it's best to avoid using manual drawing techniques in such a way that they will overwrite GUI elements. GUI elements should draw themselves; you should draw only inside given components (a game display panel, etc).