colorkey alpha; fader reset
This commit is contained in:
parent
cc1127f45f
commit
3305644a41
|
@ -153,9 +153,13 @@ class Sprite(Animation):
|
|||
def fade(self, length=0, out=None, index=None):
|
||||
if index is None:
|
||||
for location in self.locations:
|
||||
location.fader.start(length, out)
|
||||
fader = location.fader
|
||||
fader.reset()
|
||||
fader.start(length, out)
|
||||
else:
|
||||
self.locations[index].fader.start(length, out)
|
||||
fader = self.locations[index].fader
|
||||
fader.reset()
|
||||
fader.start(length, out)
|
||||
|
||||
def set_alpha(self, alpha):
|
||||
self.alpha = alpha
|
||||
|
@ -305,7 +309,7 @@ class Fader(Surface):
|
|||
self.blit(frame, (0, 0))
|
||||
frame.set_alpha(sprite.alpha)
|
||||
if not self.location.is_hidden():
|
||||
if frame.get_flags() & SRCALPHA:
|
||||
if frame.get_colorkey() is None:
|
||||
ratio = self.get_alpha() / 255.0
|
||||
pixels = PixelArray(frame.copy())
|
||||
color = Color(0, 0, 0)
|
||||
|
|
Loading…
Reference in New Issue