I'm just want to set a timer of 20 seconds in a function then jump to another:
Function 1:
example_gif = gif_pygame.load("giphy (1).gif")
def animatedgif():
while True:
example_gif.render(screen, (200 - example_gif.get_width() * 0.5, 150 - example_gif.get_height() * 0.5))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit();
sys.exit()
crt_shader()
Function 2:
def first_question():
while True:
#screen.fill((255,255,255))
render_text("Teste Teste",text_font,(255,255,255),0,0)
for e in pygame.event.get():
if e.type == pygame.QUIT:
quit()
crt_shader()
I already tried threads ou multiprocess but i'm a quite beginner and the dont really understand how the explanations works.
The pygame.time.wait or time.wait won't working to. I'm looking to open a function after all, not waiting like a loading screen or something like the duplicates.
returnwhen you see that particular event. See thepygame.timemodule, as the duplicates already tell you to do; it shouldn't be a big leap to seereturnas a thing you can do whenevent.get()returns you a timer event scheduled withpygame.time.set_timer().