-1

I have some color cyling of sprites I'm handling in some animations. I break each frame (child) of the animation into a subsurface of a sprite sheet (parent), and I want to color cycle the parent and have the chldren color cycle as a result. Looking at the pygame documentation, it seems like the palettes of the subsurfaces are independent of the parent. How would you go about this, without handling each frame individually. Thanks

1 Answers1

0

You can't... You answered your own question. The only way that this is possible without cycling through each one manually is to create a class, a method or something else of your choice.

So I'm going to put all of the frames or children into an array.

children = [pygame.Surface((200, 200))]

I'm only going to have one cause I'm lazy and you were too with how little work and effort you showed that you put into it.

So here is the method to update color.

def updateColor(color):
    parent.set_pallet(color)
    for child in children:
        child.set_pallete(color)

That's the easiest way that I can think of.

Other than that no, no you can not.

KodyVanRy
  • 1,110
  • 1
  • 14
  • 25