You can click the panel to create various objects as specified by the ListBoxes and ComboBoxes on the left and right. Objects have from 1 to 4 vertices. When you change color options, they are implemented on the current shape and future shapes. However, if you change shape after giving the current figure any points, you will need to complete it before the new shape is implemented.
Note: when drawing multiple points objects, the sketch starts the drawing by using the points it currently has available. I.e. a line is drawn after the second point is clicked, and a triangle is drawn after the third point even if the final figure is a quadrilateral.
The sketch remembers the last 10 figures drawn.
Display sketch code: DrawingButtons.pde
Class | Example |
---|---|
(Traditional) ListBox | Shapes ListBox. |
(Traditional) ComboBox | Point Color ComboBox. |
(Non-traditional) ListBox | Line Color ListBox (each item is a CircleButton and is arranged 2 items per line). |
(Non-traditional) ComboBox | Background Color ComboBox (opens to the right and each box has its own color). |
ClickablePanel | The panel in the center. |
Button | The Clear Button. Also explicitly created for Background color and implicitly created for the traditional ComboBox and ListBox. |
Checkbox | The Fill Shape Checkbox. |
RadioButtonListBox | The Fill Color radio buttons. |
ButtonGroup | Explicitly created for Background Color ComboBox and Line Color List Box. Implicitly created by the traditional ComboBox, traditional ListBox and RadioButtonListBox. |
ClickableGroup | All the Clickable items are in a ClickableGroup. |
CircleButton | Explicitly created for Line Color ListBox. |
RadioButton | Implicitly created for Fill Color RadioButtonListBox. |
Revised: 04/11/2014