[Etoys] how to crop display

Bert Freudenberg bert at freudenbergs.de
Tue Oct 14 05:11:55 EDT 2008


Am 14.10.2008 um 10:46 schrieb Ties Stuij:

> We want to present individual Epaath projects through a web-browser
> and want to do away with the sugar navigation bar so we can use the
> screen real-estate for html navigation.
>
> Removing the bar itself isn't the problem, but the hole it leaves
> behind is, as is the coordinate system. So I'm looking for a way to
> crop the display. There seems to be some provision for this in the
> Display classes (the instance variable clippingBox for example, and
> zooming functions), but I'm having difficulty finding where, and/or
> how to change the code so as to do some actual cropping.


The regular DisplayScreen cannot do this, but you could certainly hack  
OLPCVirtualScreen to do cropping. The magic happens in #forceToScreen:  
and currently only uses a scale and offset, which are calculated to  
center the full virtual display in the actual display.

- Bert -




More information about the Etoys mailing list