usage PolygonMorph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

usage PolygonMorph

Konrad.Krentz

Hi @ all,

 

I’d like to know how to create a hexagon using PolygonMorph class.

 

Thanks!

 

Konrad


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

AW: usage PolygonMorph

Konrad.Krentz

Ok I got it

 


Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Konrad.Krentz
Gesendet: Mittwoch, 30. Mai 2007 21:44
An: [hidden email]
Betreff: [Newbies] usage PolygonMorph

 

Hi @ all,

 

I’d like to know how to create a hexagon using PolygonMorph class.

 

Thanks!

 

Konrad


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: usage PolygonMorph

Karl-19
In reply to this post by Konrad.Krentz
Konrad.Krentz wrote:
>
> Hi @ all,
>
> I’d like to know how to create a hexagon using PolygonMorph class.
>
> Thanks!
>
One fun way is to use PolygonMorph shapeFromPen: penBlock color: c
borderWidth: bw borderColor: bc
You make the pen draw a hexagon and that turns into a hexagon PolygonMorph.
So you get:

World addMorph: (PolygonMorph
shapeFromPen: [:p | 1 to: 6 do:[:i|p go: 50.p turn: 60.
]]
color: Color red borderWidth: 1 borderColor: Color black)

karl
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners