1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| def on_blink_off():
if IT_RP_4T == "CLI_RP_4T":
pygame.display.update(fenetre.blit(Bouton_4T_a, (F_4T, O_RP)))
if IT_RP_JC2 == "CLI_RP_JC2":
pygame.display.update(fenetre.blit(Bouton_JC2_DA_a, (F_JC2_DA, O_RP)))
def on_blink_on():
#Bouton d itineraire
if IT_RP_4T == "CLI_RP_4T":
pygame.display.update(fenetre.blit(Bouton_4T_e, (F_4T, O_RP)))
if IT_RP_JC2 == "CLI_RP_JC2":
pygame.display.update(fenetre.blit(Bouton_JC2_DA_e, (F_JC2_DA, O_RP)))
BLINK_ON = USEREVENT+1
BLINK_OFF= USEREVENT+2
def mainloop():
for event in pygame.event.get():
if event.type == BLINK_OFF:
on_blink_off()
pygame.time.set_timer(BLINK_ON, 500)
elif event.type == BLINK_ON:
on_blink_on()
pygame.time.set_timer(BLINK_OFF, 500)
elif event.type == QUIT:
break |
Partager