I even have the code!
Note that this block would draw the rectangle relative to the sprite.
drawRectangleFromX:y:toX:y:color: | stage fillDirection lastPosition | stage _ self ownerThatIsA: ScratchStageMorph. lastPosition _ self referencePosition. self penColor: t5. self referencePosition: ((self referencePosition x) + t1) @ ((self referencePosition y) + t2). ((t4 - t2) > 0) ifTrue: [fillDirection _ 1] ifFalse: [fillDirection _ -1]. ((t4 - t2) abs) timesRepeat: [ self putPenDown. stage updateTrailsForm. self changeXposBy: (t3 - t1). stage updateTrailsForm. self putPenUp. self changeXposBy: (t1 - t3). self changeYposBy: fillDirection.]. self referencePosition: lastPosition.
Offline
You could just use this simple script:
Offline
Hey the code won't work
If the code is right, the class is ('draw rectangle from x: %s y: %s to x: %s y: %s use color: %s' #- #drawRectangleFromX:y:toX:y:color:)
Last edited by zorket (2010-09-22 15:43:05)
Offline