[squeak-dev] Rotating Morphs; how to rotate about a point other than the centre of bounds?

tim Rowledge tim at rowledge.org
Fri Apr 7 22:11:27 UTC 2017


> On 07-04-2017, at 12:09 PM, Bob Arning <arning315 at comcast.net> wrote:
> 
> photoshop is for sissies. use squeak ;-)

Nice.

|head hat flex|
head := CircleMorph new extent: 40 at 40.
head color: Color salmon lighter twiceLighter twiceLighter.
head position: 200 at 200.
head openInWorld.
hat := Form extent: 45 at 35 depth: 32.
hat fillColor: Color transparent.
hat getCanvas
	fillRectangle: (10 at 0 extent: 25 at 30) color: Color black;
	fillOval: (0 at 28 extent: 45 at 7) color: Color black.
hat := hat asMorph.
hat position: 30@ -40.
flex := TransformationMorph new.
flex addMorph: hat.
flex position: 195 at 170.
flex openInWorld.
0 to: -30 by: -2 do:[:v| flex rotationDegrees: v.
(Delay forMilliseconds: 50) wait.
World displayWorldSafely].
-30 to: 0 by: 2 do:[:v| flex rotationDegrees: v.
(Delay forMilliseconds: 50) wait.
World displayWorldSafely].
(Delay forMilliseconds: 1500) wait.
flex delete.
head delete

I must admit at first I thought you were proposing an image filtering operation until I noticed the lack of filename.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- He's not a complete idiot -- some parts are missing.




More information about the Squeak-dev mailing list