[Q][balloon2D] is transparency supported?

Baveco, Hans Hans.Baveco at wur.nl
Fri Feb 25 21:41:59 UTC 2005


To illustrate my problem, compare the result of the two code fragments, the upper one provided by Boris, the second one illustrating what I have been doing. I would really like to have the result of the first fragment, but not on the Display but on a morph...

Hans

    | bc fs ramp |
  ramp := (0 to: 360 by: 60) collect:
      [:h | h / 360.0 -> (Color h: h s: 0.7 v: 0.8 alpha: 0.2)].
  fs := GradientFillStyle ramp: ramp.
  fs origin: (10 at 10).

  fs direction: 600 at 300.
  fs radial: false.
  bc := BalloonCanvas on: Display.
  bc aaLevel: 2.
  bc drawPolygon: (Array with: 10 at 10 with: 500 at 300 with: 300 @500 with: 50 @ 300)
     fillStyle: fs
     borderWidth: 2
     borderColor: ((Color red) alpha: 0.3).


     | bc fs ramp form |
 form := Form extent: 600 at 600 depth: Display depth.
  ramp := (0 to: 360 by: 60) collect:
      [:h | h / 360.0 -> (Color h: h s: 0.7 v: 0.8 alpha: 0.2)].
  fs := GradientFillStyle ramp: ramp.
  fs origin: (10 at 10).

  fs direction: 600 at 300.
  fs radial: false.
  bc := BalloonCanvas on: form "Display" .
  bc aaLevel: 2.
  bc drawPolygon: (Array with: 10 at 10 with: 500 at 300 with: 300 @500 with: 50 @ 300)
     fillStyle: fs
     borderWidth: 2
     borderColor: ((Color red) alpha: 0.3).
 ^form asMorph openInWorld

 

 

 

On Friday 25 February 2005 7:26 am, Baveco, Hans wrote:
> When displaying polygons on a BalloonCanvas, setting the alpha of the
> fill-color apparently does not work.
> It changes the color though: when alpha approaches 1.0 the original
> color shows, when alpha approaches 0.0 the resulting color approaches
> black/opaque. Is this a known limitation, or a bug.... (the code looks
> like transparency should be handled). The final drawing is done in
> primitives, so a bit difficult to check..

I think the problem is more in the way that you displayed the contents of the
BalloonCanvas. Was there an intermediate canvas?

If you look at (for instance) the fill in the inside of Connectors (which are
rendered with Balloon2D) you will see that they can have translucency.

--
Ned Konz


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 5922 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20050225/f00a2f47/attachment.bin


More information about the Squeak-dev mailing list