[Newbies] Drawing a line on a morph

K. K. Subramaniam subbukk at gmail.com
Fri Oct 30 17:18:17 UTC 2009

On Friday 30 October 2009 09:22:26 pm Christine Wolfe wrote:
> What I am trying to do is have a group (array, set, collection?) of "faces"
> on a rectangle - sort of like a child's building block with an image on
>  each of the faces. I want 1 face to be blank, one to have a line, one to
>  have a diamond, and one to have a rectangle.
How about:
drawOn: aCanvas
	super drawOn: aCanvas.
	self perform: ('drawFace', dieValue asString) asSymbol with: aCanvas

drawFace1: aCanvas
	"leave blank"

drawFace2: aCanvas
	self drawLineOn: aCanvas from: self topLeft to: self bottomRight.

HTH .. Subbu

More information about the Beginners mailing list