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

Re: [pygame] "tint" a surface?



On Sat, Sep 19, 2009 at 12:44 PM, Eric Pavey <warpcat@xxxxxxxxx> wrote:
I want to 'tint' my whole Surface based on the Color.  Preferably, I'd do this at every loop, it wouldn't be 'baked' into the image.
What you're doing requires three surfaces.  I recommend "tinting" the surface as you've done and saving that as a separate surface.  That way, you will have two surfaces--the original and the tinted.  You will probably want to cache the result, i.e., not do it every frame. 

There are other ways to tint the surface; such as using the surfarray, pixelarray, using transparency, and so on.  These work like your method, although none is simpler.

There isn't a tint() function in PyGame, though.

Ian