[Newbies] Help with pen stuff

K. K. Subramaniam kksubbu.ml at gmail.com
Tue Jun 5 11:15:34 UTC 2012


On Tuesday 05 Jun 2012 2:46:17 AM OrgmiGeek wrote:
> In my spare time I decided to rite a simple paint program!
Welcome to Squeak! Have you read the blog:

 http://billkerr2.blogspot.in/2007/09/morphic-etoys-is-superior-graphical.html

John Maloney's article in the reference listed therein is an excellent 
starting point for graphical programming.

> I have
> encountered some problems:
> #1 does paint stuff work in the BorderedMorph category?
If you mean paint as in the PaintTool, then no. Painting is for sketches while 
BorderedMorph is a patch of single color (or gradient of two colors) with a 
border. You can change the color of a bordered morph with:

     myMorph color: Color blue.

> #2 how would you make the program draw where your mouse pointer is? I think
> you do it like:
>  myPen goto: 200 at 200.	but more like: myPen goto: mouseX at mouseY
The 'mouse' is known as ActiveHand, so you would program it thusly:
     myPen goto: ActiveHand x @ ActiveHand y.

This can be tricky to program. If you don't have a stop condition, myPen will 
keep following the mouse all the time and that can be really annoying :-(.

HTH .. Subbu


More information about the Beginners mailing list