Commit b82b1b2d by BellCodeEditor

save project

parent 7f585115
Showing with 14 additions and 8 deletions
......@@ -89,9 +89,7 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
music = pygame.mixer.Sound(music_list[num])
music_len=music.get_length()
music_len = int(music_len)
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
......@@ -102,13 +100,21 @@ while True:
nrect = nlogo.get_rect(center=(330,200))
nrect = (nrect[0],nrect[1])
music = pygame.mixer.Sound(music_list[num])
music_len=music.get_length()
music_len = int(music_len)
music_lenm = music_len//60
music_lens = music_len%60
music_len = "/"+str(music_lenm)+":"+str(music_lens)
if time_s<10:
info = str(time_m)+":0"+str(time_s) +"/"+str(music_len)
info = str(time_m)+":0"+str(time_s)
else:
info = str(time_m)+":"+str(time_s) +"/"+str(music_len)
text = my_font.render(info,True,(0,0,0))
screen.blit(text, (320, 440))
info = str(time_m)+":"+str(time_s)
text = my_font.render(info,True,(255,255,255))
text1 = my_font.render(music_len,True,(0,0,0))
screen.blit(text, (300, 440))
screen.blit(text1, (380, 440))
screen.blit(nlogo, nrect) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
......
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