Cheers,
Darius
-----Original Message-----
From: Scott Wallace [mailto:scott.wallace@squeakland.org]
Sent: Wednesday, January 14, 2004 8:34 PM
To: Darius Clarke
Cc: squeakland@squeakland.org; Andreas Raab
Subject: RE: [Squeakland] Re: [Q]Some questions about scripting an eToy playerHi, Darius,I don't have the perfect answer to your query (perhaps Andreas will) but here are some observations that may be useful:(1) An easy way to achieve the effect you want, I think, would be to capture your gradient-graced sphere as a SketchMorph. The reason is that there is a special feature available only to SketchMorphs that allows you to specify that their appearance not change as they rotate. To do this:* First create your object as an EllipseMorph with gradient fill, as before.* Then obtain a SketchMorph from it using one of the new morph... grab... commands from the desktop menu.* Remove the transparent pixels surrounding the resulting SketchMorph by using painting... erase pixels of color.. from its halo menu.* The result is a SketchMorph of exactly the same size and shape and appearance as your original.* Go to the SketchMorph's halo menu, choose painting... set rotation style... don't rotate.Now you have a ball whose appearance will not change as you change its heading from a Viewer or from running code.(2) The intent of the rotation code is to take the *complete* appearance of the object when facing in its "forward direction" and to rotate it rigidly by the required number of degrees. That "complete" appearance includes drop-shadow, gradient direction, etc.What you are asking for is directly at odds with that. If you don't want to use the SketchMorph trick outlined above, then the best alternative I can think of is for you to give the object a ticking textual script that serves to counteract the effect of the rotation on the gradient direction. Though I couldn't immediately and without careful thought write down a script that accomplished this, obviously it must be possible, though perhaps strenuous. The script would presumably have code of the form "Sphere costume fillStyle direction: foo" or something similar.(3) A further thought is: if you want the appearance to be unchanged, perhaps you shouldn't be changing the heading in the first place. An alternative is to forego the built-in heading-changing feature such as "turn-by" and to do all your motion-related computations more directly instead. Though this obviously has its price, and the resulting scripts might be too obscure.Hope these observations help, or at least don't hurt ;-)Cheers,-- Scott