[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] video synch



jabberwocky wrote:
Sorry my explanation was very bad. I mean that my
levels need several seconds to have updated, because
there are a lot of images to blit, so my text label
instead of to be visible for 10 seconds(example) I can
see it only for 3-4 seconds, because in the first
seconds the label is not yet appeared, because of all
that images to be drawn.
I still don't understand this. If you want a loading message to appear during all the processing have your program work like this..

screen.blit(loadingmessage, (10, 10))
pygame.display.flip()

load5secondsworthofimages()
blit5secondsworthofimages()

# ... 10 seconds later
# (with load message visible this entire time)
pygame.display.flip()


So I need a way to know when all the images are really
blitted, updated and visible on the screen...so I blit
my label that will be really visible for 10 seconds
The pygame blit function is a syncronous operation. You don't need to wait for it to finish, it is done when the function returns. Same with the display.flip() function.