[BUG][FIX] Pen trails form depth (was: Re: Newbie Questions)

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Fri Jul 4 14:38:25 UTC 2003


Am Freitag, 04.07.03 um 14:46 Uhr schrieb Jeff Longland:

> I'm a new Squeak user and I'm not trying to tackle anything too 
> difficult at
> the moment, or at least I didn't think so initially.  I'm working on
> creating an object (a snake) that will travel along the edge of a 
> rectangle
> while leaving a trail.  As the snake works around the rectangle and 
> comes
> back to its starting point, the snake will view the existing trail as 
> the
> new wall - making smaller and smaller rectangles, until the snake has
> covered the surface area of the rectangle.  Ideally, I'd like to be 
> able to
> move the snake object into any shape and it will cover the surface 
> area in
> the same manner as the above mentioned rectangle.  I've been using 
> penDown
> to create a pen trail behind the snake, but my major problem is that 
> the
> sensor on my object is unable to view the pen trail.  I've searched 
> around
> quite a bit and I've seen mention of transparent playfields, adjusting 
> the
> display depth, and a method that refreshes the playfield - but Squeak
> documentation seems to be somewhat scattered.  I've been playing with 
> Squeak
> for a while now, and I'm slowly getting the hang of everything - but 
> it's
> taken quite a while.  Does anyone have any suggestions on how I can 
> make the
> pen trails visible to my sensor?  Or any other suggestions for the 
> project
> and my journey through Squeak?

I would not consider this to be a newbie question, but rather a bug 
report ;-)

This indeed seems to be a problem with dithering. The pen trails use an 
8 bit color form, while the world is displayed in 16 or 24 bits. This 
makes the color of the trails slightly different from the color in the 
color-sees tile.

Try the attached changeset. It makes the trails use the same depth the 
display has. After installing, you need to clear the pen trails once. 
See the attached picture for my implementation, I'm almost sure I did 
this faster than Edgar :-)

To install a changeset, open a file list, select the file, and chose 
"file in".

-- Bert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: snake.gif
Type: image/gif
Size: 17522 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030704/661074bf/snake.gif
-------------- next part --------------
  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: colorSeesTrails-bf.1.cs.gz
Type: application/x-gzip
Size: 524 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030704/661074bf/colorSeesTrails-bf.1.cs.bin


More information about the Squeak-dev mailing list