Advertisement
horozov86

pause button

Jun 20th, 2024
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. paused = False
  2.  
  3. def pause():
  4.     global paused
  5.    
  6.     if paused:
  7.         pygame.mixer.music.unpause()
  8.         paused = False
  9.     else:
  10.         pygame.mixer.music.pause()
  11.         paused = True
  12.    
  13.    
  14.    
  15.    
  16. pause_btn = Button(controls_frame, image=pause_btn_img, borderwidth=0, command=pause)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement