04-19-2018, 03:51 AM
Yes, you can have color cycling in sprites too
The Sprite object has the get_palette() method that returns its current palette. One you have it, you can setup a color cycle animation in the same way you already do with your background layer:
Keep in mind that by default all sprites that share the same Spriteset, also share the same Palette, so if you setup a palette animation on a sprite, all sprites that are associated to the smae Spriteset will have the palette animation effect. If you want the animation effect on a single sprite, the you first have to clone() the palette of the sprite, assign the cloned palette to the sprite with its set_palette() method, and attach the animation effect to the cloned palette too:
There aren't specific tutorials about many features. There are some examples and the complete API reference. So feel free to ask specific questions about how to do things if you can't find a suitable example or the documentation is not clear
The Sprite object has the get_palette() method that returns its current palette. One you have it, you can setup a color cycle animation in the same way you already do with your background layer:
Code:
palette = sprite.get_palette()
animation.set_palette_animation(palette, sequence, False)
Keep in mind that by default all sprites that share the same Spriteset, also share the same Palette, so if you setup a palette animation on a sprite, all sprites that are associated to the smae Spriteset will have the palette animation effect. If you want the animation effect on a single sprite, the you first have to clone() the palette of the sprite, assign the cloned palette to the sprite with its set_palette() method, and attach the animation effect to the cloned palette too:
Code:
palette = sprite.get_palette()
cloned_palette = palette.clone()
sprite.set_palette(cloned_palette)
animation.set_palette_animation(cloned_palette, sequence, False)
There aren't specific tutorials about many features. There are some examples and the complete API reference. So feel free to ask specific questions about how to do things if you can't find a suitable example or the documentation is not clear