Modifying world size?

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

Modifying world size?

Casey Ransberger-2
I'd like to have worlds that are bigger than the screen, wherein the user can scroll about using a floating desktop pager, a la Self's demo snapshot.

I've tried changing e.g., the height of the world, but it seems to snap right back. Anyone know what's doing that?

--
Casey Ransberger

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

Re: Modifying world size?

K K Subbu
On Tuesday 28 Dec 2010 12:25:59 am Casey Ransberger wrote:
> I'd like to have worlds that are bigger than the screen, wherein the user
> can scroll about using a floating desktop pager, a la Self's demo snapshot.
>
> I've tried changing e.g., the height of the world, but it seems to snap
> right back. Anyone know what's doing that?
World size is derived from the display plugin and then scaled, if necessary.
If you need a larger world, then you will have to intercept calls to primitive
(92?) that gets width/height/depth and then scale it up. You will also need to
program keys to pan World within the display screen. The changes are non-
trivial.

See DisplayScreen class side methods, if you are still curious.

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

Re: Modifying world size?

Bert Freudenberg
In reply to this post by Casey Ransberger-2
On 27.12.2010, at 19:55, Casey Ransberger wrote:

> I'd like to have worlds that are bigger than the screen, wherein the user can scroll about using a floating desktop pager, a la Self's demo snapshot.
>
> I've tried changing e.g., the height of the world, but it seems to snap right back. Anyone know what's doing that?

It's in the Morphic main loop. See doOneCycleNowFor: which sends checkForNewScreenSize which sends displaySizeChanged to the current project which sends restoreMorphicDisplay to the World which sets its extent.

There are two ways to make a "virtual screen". Either a low-level one where you actually use a larger Display than the physical Squeak window size. Or you leave Display alone and do it in Morphic, making the World scrollable.

The first alternative is more general because it works in both MVC and Morphic. Also, there still are places in Morphic that directly reference Display and Sensor (fast window frame dragging, for example).

Andreas implemented this for Etoys. We use a virtual screen with a fixed 1200@900 resolution and scale it to the actual window size. That way projects can easily be shared. Just download Etoys and resize its window to see.

The beef is in class OLPCVirtualScreen. Changing it from scaling to panning should be quite straightforward.

The only drawback is that with the current implementation we actually have two Display bitmaps - one of the actual screen size plus one for the full virtual display. Making the latter store only the visible portion of the Display requires a bit more work (we did not need that because the whole world is always visible).

Actually, since you do not need scaling, a single bitmap of the screen size would suffice. If I were to implement this, I'd subclass DisplayScreen and add a virtual size and offset. Every BitBlt operation would need to use that offset.

Have fun :)

- Bert -


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