Hii
I need help about pygame
I'm under python 3.7.2
64 bits
So I'm bassically working about a smooth way to exit a window
I thought to create a fade out animation by using pygame.SRCALPHA
on a surface
Let me introduce the problem : it's isn't work at all
:(
for e in pygame.event.get():
if e.type == QUIT:
window = 'left'
run = False
loop = False
c = 0
for i in range(50):
fade('out')
time.sleep(0.05)
pygame.display.update()
pygame.display.quit()
sys.exit()
to understand well all of this I give you critical others lines
alpha = pygame.Surface((1920, 1080), pygame.SRCALPHA)
this one is the creation of the surface
def fade(f_type): # must set c at 255 or 1
global c, alpha
c += 1 if f_type == 'out' else -1
alpha.fill((0,0,0,c))
screen.blit(alpha, (0,0))
And this is the fade() function to progress fading
Oh, and this is my traceback, I mean, a error message that I didn't know appear, maybe could help you :D
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: iCCP: known incorrect sRGB profile <- this line
[Finished in 35.5s]
Someone know were the problem come from ? @here