Computer Science Canada Need help with a turing eraser |
Author: | TheGreatOne [ Fri Jun 10, 2011 5:06 pm ] |
Post subject: | Need help with a turing eraser |
What is it you are trying to achieve? I'm trying to create an eraser as a part of my turing project. What is the problem you are having? I don't know the exact code to do that. Describe what you have tried to solve this problem I tried putting a loop, for loop, changing dot color to white, etc Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) N/A Please specify what version of Turing you are using 4.0 |
Author: | apython1992 [ Fri Jun 10, 2011 5:39 pm ] |
Post subject: | RE:Need help with a turing eraser |
If you've tried putting loops and changing the dot color to white, why don't you post that code? |
Author: | feebas200 [ Fri Jun 10, 2011 9:05 pm ] |
Post subject: | RE:Need help with a turing eraser |
use mouse where and then draw white oval or square/rectangle when the mouse is pressed. |
Author: | DanShadow [ Sat Jun 11, 2011 2:08 am ] |
Post subject: | RE:Need help with a turing eraser |
The method offered by feebas200 is the one i'd also recommend. If the background of your program is white, the action of "erasing" something is just returning the color of a particular portion of the screen back to the background color. So code in a mouse click statement, use mouse.where and draw a white circle/square where the user clicked. To emulate an MS Paint style eraser, you could have your code continue to draw a white circle/square the mouse co-ordinates while mouse button 1 is down, and stop when it is released. |