Computer Science Canada keeping your backround while clearing something infront ofit |
Author: | DanceMacabre [ Sat May 06, 2006 10:47 am ] | ||
Post subject: | keeping your backround while clearing something infront ofit | ||
Now then. I've drawn a grid as a backround, and I want the player to control the square while I still have a grid drawn in the backround. The problem is (To my knowledge anyway) I cannot Draw.Cls my box unless I want to get rid of the backround aswell. I want to keep the backround when I Draw.Cls my square. The problem I face is I don't know how to do that! Any help is appreciated. Heres my code:
|
Author: | HellblazerX [ Sat May 06, 2006 11:44 am ] |
Post subject: | |
I guess the only way to do this is to replace the Draw.Cls command with a procedure of your own that will draw the background instead of clearing the screen. There's no way you can set the cls command to draw your background. |
Author: | codemage [ Mon May 08, 2006 7:44 am ] |
Post subject: | |
If you're on version 4.1, there's a View.UpdateArea command that should be able to just update your player without having to reflash the whole screen. |
Author: | [Gandalf] [ Mon May 08, 2006 3:02 pm ] |
Post subject: | |
codemage wrote: If you're on version 4.1, there's a View.UpdateArea command
I'm pretty sure View.UpdateArea was also available for Turing 4.0.5. Problems like this are generally solved by redrawing the entire screen at each iteration of your main loop, background and all. |
Author: | Bored [ Mon May 08, 2006 9:05 pm ] |
Post subject: | |
Also if your on a version of Turing supporting Sprites (I beleive 4.1 and 4.0.3 or below) you can create a sprite for the picture you are drawing over the background and simply hide it, show it, and move it when needed all without affecting you background. |