[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Best way to darken an area
On 21 Oct 2006 at 14:49, Lenard Lindstrom wrote:
> On 21 Oct 2006 at 14:15, Farai Aschwanden wrote:
>
> > Hello all
> >
> > Anyone of you is experienced in darkening an area from daytime to
> > nighttime?
> >
> > - Alpha filter?
> > - Setting image pixels to darker value?
> > - ???
> >
> > I couldn't find anything affecting contrast in Pygame that would help
> > either.
> >
> > Any ideas are welcome.
> >
> To fade an image to black repeatedly alpha blit it with an all-black
> image having a small alpha value like 1. In fact - I have only just
> tried it - this should work as general way to fade from one image
> to another. So you can fade from a daytime to a nighttime image.
>
Actually I was too quick to post. The general case of fading from one
image to another does not work (my test program blitted to a white
background). But the fade-to-black does.
Lenard Lindstrom
<len-l@xxxxxxxxx>