The Shapes Editor allows you to create and save turtle designs. NetLogo uses fully scalable and rotatable vector graphics, which means it lets you create designs by combining basic geometric figures, which can appear on-screen in any size or orientation.
To begin making shapes, choose "Shapes Editor" on the Tools menu. A new window will open with a list of all the shapes, beginning with "default", and a row of action buttons, including new, edit, copy, and import.
Press the "new" button, and the editing window will appear. The shape you make will appear in the main drawing area and in the three smaller preview areas found on the left side of the editing window.
The preview areas show your shape at different sizes as it might appear within your model, as well as how it looks while rotating. The "rotation" feature can be turned off if you want a shape that always stays right side up.
There are four shape-drawing tools (select from four button icons), each of which can be filled with color or not, and a background grid to guide you. You can move and size these shapes with the mouse pointer as a drawing tool.
The shape created last will fall on top. Layers can be removed with the "remove last" button. The "remove last" and "remove all" buttons are the only way of correcting mistakes -- you can't go back to move or alter the shape after it's been drawn. If you make a mistake, to fix it, remove and redraw the shape.
Areas that use the "key" color (selected from a drop-down menu -- the default is gray) will change according to the value of each turtle's "color" variable in your model. Areas filled with any other color (selected from the palette at the top) will stay that color regardless of each turtle's "color". For example, you could create cars that always have yellow headlights and black wheels but have bodies of different colors -- to make this happen, you would draw the bodies in the "key" color.
It's tempting to draw complicated, interesting shapes, but remember that in most models, the patch size is so small that you won't be able to see all the detail. Simple, bold shapes are best.
When the shape is done, give it a name and click on the save option at the bottom of the screen. The shape and its name will now be in the list along with the "default" shape.
If you want to borrow a shape from another model, use the "import" button to call up other NetLogo models and import shapes from them.
After closing the shapes editor, you can adjust the code to call the new shape. For example, suppose you want to create 50 turtles with the shape "rabbit". In the command center, give this command to the observer:
crt 50
And then give these commands to the turtles to spread them out, then change their shape:
fd random 15 set shape "rabbit"
Voila! Rabbits! Note the use of quotation marks around the shape name.
The set-default-shape
primitive is also useful for
assigning shapes to turtles.