I create a little loading screen that show a animation during the load of any picture.
I've tried to add a smooth animation with Thread. Basically, I create a class Booting for a nice loading screen.
class Booting(Thread):
"""Thread to boot up the program"""
def __init__(self):
super(Booting, self).__init__()
self.loop = True
def run(self):
if debug == True :
self.begin = time.time()
while self.loop:
pygame.draw.rect(screen, (16, 16, 16), (0, 0, 1920, 1080)
try:
screen.blit(icon_big, (0, 0))
screen.blit(animation[current], (0,0))
current = current + 1
if current == 9 :
current = 0
except:
pass
pygame.display.update()
As you can see, I put the pygame.display.update
in the thread
And... when I run it there is no pictures at all ! ( it work when I put it back ). So the Thread seems to be not able to solve my problem.
Someone can help me to find something that could help ? It will be better if it something simple :)