Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
PolygonMorph
Last updated at 6:41 pm UTC on 8 March 2017
The PolygonMorph is a subclass of BorderedMorph.

Subclasses are

Examples:

Draw a filled triangle:

(PolygonMorph
vertices: (Array with: 0@0 with: 200@0 with: 100@100)
color: Color red borderWidth: 1 borderColor: Color black) openInWorld



Draw a regular polygon using the shapeFromPen: method

Draw a smoothed polygon:

b _ (PolygonMorph
vertices: (Array with: 50@100 with: 200@300 with: 100@400)
color: Color red borderWidth: 1 borderColor: Color black).
World addMorph: b.
b beSmoothCurve.


see also Drawing a Hilbert Curve