Views on Map

Ned Konz ned at squeakland.org
Tue Feb 1 22:17:20 UTC 2005


On Monday 31 January 2005 11:26 pm, Blake wrote:
> I've been playing with the playfield (appropriately enough) and would like
> to go to the next level, as it were: I want a view that scrolls around a
> larger playfield than is seen at anyone time. While I think I could do
> this with the 3D graphics, I'd prefer to keep things 2D for now. (I guess
> I could sorta do that with a top-down view on a 3D field, too, but I'm
> really trying to avoid having to get into the 3D stuff for now.)
>
> Thoughts?

The easiest thing to do is just to offset all the submorphs. There is a limit, 
though, to positions in Morphic; I think that we may be limited to +/-32K. 
Beyond this you may have to remove invisible morphs from the World (perhaps 
adding them as children of a separate, hidden morph) and put them back later 
when they become available. Or you could move them just offscreen and save 
their actual position in a property. When you pan the world you just adjust 
the offsets and saved positions.

If you add translation to the world (or scaling, for that matter) you will 
find that there are a number of cases where transformations will have to be 
applied to event coordinates. I've tracked down a number of these over the 
years but there are still some left.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list