Commit 21d3e107 by BellCodeEditor

save project

parent 046e68a3
Showing with 15 additions and 1 deletions
...@@ -63,6 +63,9 @@ while True: ...@@ -63,6 +63,9 @@ while True:
num=len(music_list)-1 num=len(music_list)-1
pygame.mixer.music.load(parth+"\\" +music_list[num]) # 载入音乐 pygame.mixer.music.load(parth+"\\" +music_list[num]) # 载入音乐
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(parth+"\\" +music_list[num])
music_len=music.get_length()
music_len=int(music_len)
click=0 click=0
play_button = stop_img play_button = stop_img
if x>420 and x<520 and y>350 and y<400: if x>420 and x<520 and y>350 and y<400:
...@@ -71,6 +74,9 @@ while True: ...@@ -71,6 +74,9 @@ while True:
num=0 num=0
pygame.mixer.music.load(parth+"\\" +music_list[num]) # 载入音乐 pygame.mixer.music.load(parth+"\\" +music_list[num]) # 载入音乐
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(parth+"\\" +music_list[num])
music_len=music.get_length()
music_len=int(music_len)
click=0 click=0
play_button = stop_img play_button = stop_img
...@@ -82,6 +88,9 @@ while True: ...@@ -82,6 +88,9 @@ while True:
pygame.mixer.music.load(parth+"\\" +music_list[num]) # 载入音乐 pygame.mixer.music.load(parth+"\\" +music_list[num]) # 载入音乐
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(parth+"\\" +music_list[num])
music_len=music.get_length()
music_len=int(music_len)
new_img=pygame.transform.rotate(logo_img,angle) new_img=pygame.transform.rotate(logo_img,angle)
new_rect=new_img.get_rect(center=(320,200)) new_rect=new_img.get_rect(center=(320,200))
pos=(new_rect[0],new_rect[1]) pos=(new_rect[0],new_rect[1])
...@@ -92,7 +101,11 @@ while True: ...@@ -92,7 +101,11 @@ while True:
time_n=time//60 time_n=time//60
time_s=time%60 time_s=time%60
info=str(time_n)+"i"+str(time_s) info=str(time_n)+"i"+str(time_s)
test=my_font.render(info,True,(255,0,255)) test=my_font.render(info,True,(255,0,255))
music_m=music_len//60
music_s=music_len%60
info2='/'+str(music_m)+":"+str(music_s)
test1=my_font.render(info2,True,(255,0,255))
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
...@@ -100,6 +113,7 @@ while True: ...@@ -100,6 +113,7 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
screen.blit(test,(100,400)) screen.blit(test,(100,400))
screen.blit(test1,(150,400))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(50) FPS.tick(50)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment