Re: Question about GnomeCanvas transparency



Lucas Di Pentima <lucas lunix com ar> writes:

> Hi there folks!
>
> I'm using GnomeCanvas to draw a star map on a game client I'm
> developing[1], and I'm needing to draw semi transparent circles around
> the planets, as a way to mark planet's scanner ranges. The problem is
> when two or more of this big circles superpose each other, the color
> is "added", so if there are a lot of superposing circles, the
> transparency is lost and the objects below can't be seen.
>
> You can get an idea from this screenshot:
> http://www.lunix.com.ar/~ldipenti/screenshot.png
>
> Is there any way to tell GnomeCanvas not to "add" superposing
> transparent colors? I would like to get an area resulting of the
> addition of circle's surfaces.

I can't think of one off hand.  I would suggest making a
GnomeCanvasClipgroup out the union of all the circles and then
including a rectangle of the correct transparency over the entire
visible area.  The unfortunate part is that the GnomeCanvasPathDefs
that make up a GnomeCanvasClipgroup are made up of bezier curves, and
these can only be made to approximate a circle.  You should search
online for a good way to do this.

-- 
Michael Welsh Duggan
(md5i cs cmu edu)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]