created with NetLogo
view/download model file: Paint-LilyFung.nlogo
Lily Fung
MCS1 Period 5
It is a painter that allows the user to go beyond just doodling. Most of the options are based off MS Paint, the stamper is based off Kid Pix, but all have been adapted for the purposes of completing this project on time.
SETUP - Sets up the painter. If this button is not pressed first, nothing will work.
Colors:
Color Picker and the slider below it sets the global variable PICKED-COLOR. When the mouse is down on a certain patch in the Color Picker, PICKED-COLOR is set to that color plus the number on the darker to lighter slider.
PAINT BACKGROUND - Sets all patches to PICKED-COLOR. This will always change the background color because the rest of the tools are turtles.
PAINTBRUSH - A turtle with its xcor and ycor set to mouse-xcor and mouse-ycor. It sets its pen-size to the number indicated on the BRUSH-SIZE slider and its color to PICKED-COLOR.
RAINBOW BRUSH - Same as PAINTBRUSH except it keeps adding 1 to its color, taking advantage of the fact that it is a forever button.
CIRCLE & POLYGON - Create circles and polygons by taking user-inputs as dimensions and plugging them into formulas that draw their perimeters.
ADD TEXT - When mouse is clicked on the visual space, a turtle is created set to a blank shape that was created in the shapes editor so that the turtle would appear invisible. Its label is set to a user-input and its label-color is set if the user clicks the color first.
STAMPS & Stamp Picker:
When the mouse is down on a certain patch in the Stamp Picker, global variable PICKED-STAMP is set the shape of the turtle on that patch. A premade but hidden turtle becomes visible and sets its shape to PICKED-STAMP, its color to PICKED-COLOR, its heading to whatever is indicated on the ROTATION slider, and its size to STAMP-SIZE. Its xcor is mouse-xcor and its ycor is mouse-ycor so it follows the mouse on the visual screen. When the mouse is down on the visual space, the turtle will perform the primitives command stamp.
STAMPS: Certain stamps do not rotate at all.
POLYGON: The cursor does not appear exactly in the center.
Everything. That's the point of a painter. :)
If one could find the general formula for the apothem of a regular polygon or the radius of the circle that all its vertices lie on, one could use that to adjust the cursor so that it will be the center of the polygon.
There is no property of turtles or patches such that would change the label-size so far. Thus, all text will appear the same size.
The dimensions entered by the user for the polygon and circle use the command read-from-string since user-input is always a string.
MS Paint
© 1981 - 2001 Microsoft Corporation
Kid Pix
©2007 Riverdeep Interactive Learning Limited
Mr.Brooks & his sugguestion to use the command read-from-string.