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

Re: [pygame] Sprite colours dont maintain same palette indicies



ah, thats kind of akward syntax, but I think I can manage if I wrap it properly, thanks!

On Fri, Jul 30, 2010 at 2:04 PM, Mel Collins <mel@xxxxxxxxxxxxx> wrote:
On 30 July 2010 19:10, John Anderson <corporalmustard@xxxxxxxxx> wrote:
> it seems that if I change the colours in the main palette (the display
> surface palette), all the sprites onscreen, rather than staying in
> their respective indicies on the palette, shift to the closest colour
> on the palette to their original colours.

 IIRC this is the behaviour when you use .set_palette_at(). To keep
the same indices, thus changing the colours, you need to use
.set_palette() to replace the entire palette at once.
 I seem to remember having the same problem while trying to
procedurally generate some graphics.

 - Mel C