[Squeakland] Squeak 'non-starter' in U.K. schools?

Andreas Raab andreas.raab at squeakland.org
Mon Jul 7 15:42:19 PDT 2003


Hi Christopher,

Thanks, this URL worked. I've been looking at the problem and
(unfortunately) there's a tiny bit of magic needed to make this work since
the center of rotation is not accessible for scripts (it really should).
Fortunately, there is a way of rotating objects around a "fixed point" -
namely the origin of the playfield we're in. The relation between any object
and the origin of the playfield is covered by two properties (in the
"geometry" section):
* "distance" hands us the distance of the object to the origin of the
playfield
* "theta" hands us an angle to the origin of the playfield
However (and this is where the magic comes in) by default playfields have
their origin at the lower-left corner which isn't really helpful.
Fortunately, there is a menu item in the red-halo menu of any playfield (or
the world itself) within the "playfield options" submenu which allows you to
specify "origin-at-center" and this will set the origin of the playfield to
be the center instead of the lower-left corner.

When you do this, you can rotate your objects around the center of the
screen using the theta property of the object (you may also want to change
the center of rotation for your weights to be at the bottom center). This,
in addition with changes in the heading, gives you the exact effect you're
looking for.

About the only thing left is to align the fulcrum itself properly with the
playfield's center and you can do this by setting the line's "distance" to
zero (as it will make the line move to the playfield's origin which we
changed to be at the center).

Both, "theta" and "distance" are pretty powerful when you set the origin of
the playfield to be its center - it allows for all sorts of "interesting"
rotational effects - try it out sometime.

I hope the above is clear enough for you to make this work. If you've got
any more questions, let us know.

Cheers,
  - Andreas

> -----Original Message-----
> From: Christopher Sawtell [mailto:csawtell at paradise.net.nz] 
> Sent: Monday, July 07, 2003 2:08 PM
> To: Andreas Raab
> Subject: Re: [Squeakland] Squeak 'non-starter' in U.K. schools?
> 
> 
> On Tue, 08 Jul 2003 00:02, you wrote:
> > Hi Christopher,
> >
> > > 
> http://squeakland.org/project.jsp?http://berty.dyndns.org/SeeS
> aw.001.pr
> >
> > I was going to have a look at it but I got a 404 (page not 
> found) error for
> > http://berty.dyndns.org/SeeSaw.001.pr - are you sure the 
> above is the
> > correct URL?
> 
> Sorry, try this one, forgot the hyphen. :-(
> 
http://squeakland.org/project.jsp?http://berty.dyndns.org/See-Saw.001.pr

--
C. S.




More information about the Squeakland mailing list