
-----------------------------------
irishseacaptain
Tue Jun 14, 2011 11:18 am

How do you delete everything but a drawfillrectangle?
-----------------------------------
What is it you are trying to achieve?
I'm attempting to clear everything BUT a drawn rectangle. 


What is the problem you are having?
I do not know how to use "cls" and still keep an object on screen


Describe what you have tried to solve this problem
Lots of thought. I learned the language 3 days ago... 


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




drawfillbox (0,350, 100, 400, 12)
...
...
cls



Please specify what version of Turing you are using
4.1

-----------------------------------
Nick
Tue Jun 14, 2011 11:21 am

RE:How do you delete everything but a drawfillrectangle?
-----------------------------------
just clear your screen and redraw it

-----------------------------------
irishseacaptain
Tue Jun 14, 2011 12:00 pm

Re: How do you delete everything but a drawfillrectangle?
-----------------------------------
Sorry, should have mentioned. I did, but since its in a game and it's refreshing constantly, it doesn't appear, it just blinks in some areas of where its supposed to be.

-----------------------------------
apython1992
Tue Jun 14, 2011 12:07 pm

RE:How do you delete everything but a drawfillrectangle?
-----------------------------------
You want to be using double-buffering - essentially, all of the calculations that involve changing the scene in a game happen on a back buffer (one that doesn't get updated continuously), and then after all of the calculations and movement have been finished for that loop, you can draw the back buffer onto the front buffer, so that the scene is updated once and in unison. Take a look at View.Set("offscreenonly") and View.Update.

-----------------------------------
irishseacaptain
Wed Jun 22, 2011 1:01 pm

Re: RE:How do you delete everything but a drawfillrectangle?
-----------------------------------
You want to be using double-buffering - essentially, all of the calculations that involve changing the scene in a game happen on a back buffer (one that doesn't get updated continuously), and then after all of the calculations and movement have been finished for that loop, you can draw the back buffer onto the front buffer, so that the scene is updated once and in unison. Take a look at View.Set("offscreenonly") and View.Update.

Awesome, thanks, I'll take a look at that.
