Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Clear only part of the screen
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wolfy




PostPosted: Tue Dec 03, 2013 8:26 pm   Post subject: Clear only part of the screen

Hey everybody, sorry if I sound like I'm really new to this but I was wondering if there is any way that I could only clear a certain part of the screen, or make text disappear. For example I am making hangman for a school project and when the user guesses a wrong letter, its says "wrong" on the screen. After a delay of maybe 2 seconds I want to remove that part, but keep everything else that is currently on the screen. Hopefully someone can help. Thanks!

NOTE: I should also add that I use Font.Draw command for my text, not just the ordinary put command.
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Tue Dec 03, 2013 8:50 pm   Post subject: RE:Clear only part of the screen

There's two ways of doing this. One is good, the other easy.

The easy way is to use View.Set ("offscreenonly") and View.UpdateArea. Simply call cls, then update the area you want cleared.

The good way is to draw everything over and over again (you'll probably want to use offscreenonly mode here as well). Instead of erasing the bit you want gone, erase everything. Then re-draw everything except the part you want erased. This requires you to keep track of everything you've drawn, but if you ever want to make a game, you'll probably have to do this anyway, so you might as well get used to it now.
wolfy




PostPosted: Tue Dec 03, 2013 9:00 pm   Post subject: RE:Clear only part of the screen

Thanks for your help! Should I put all the screen drawing into a procedure and call it after I clear the screen each time?
Insectoid




PostPosted: Tue Dec 03, 2013 9:47 pm   Post subject: RE:Clear only part of the screen

Why not try it out and see if it works?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: