Commit f97e2ee4 by BellCodeEditor

save project

parent 77c9e8bb
Showing with 12 additions and 1 deletions
...@@ -12,7 +12,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -12,7 +12,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮 last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮
display_fonts=pygame.font.Font('neuropol.ttf',18)
music_list = [] music_list = []
path = "C:\\Users\\students\\Desktop\\test" path = "C:\\Users\\students\\Desktop\\test"
filelist = os.listdir(path) filelist = os.listdir(path)
...@@ -88,10 +88,20 @@ while True: ...@@ -88,10 +88,20 @@ while True:
pygame.mixer.music.play() pygame.mixer.music.play()
# 绘制画面 # 绘制画面
play_time=pygame.mixer.music.get_pos()
mtimes=int(play_time/1000)
mtimes_m=mtimes//60
mtimes_s=mtimes%60
if mtimes_s<10:
mtimes_s="0"+str(mtimes_s)
display_time=str(mtimes_m)+":"+str(mtimes_s)
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(a,b) # 中间logo图 screen.blit(a,b) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
time_content=display_fonts.render(display_time,True,(255,255,255))
screen.blit(time_content,(120,450))
# music_content=display_fonts.render("/"+dis_music,True,(0,0,0))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
\ No newline at end of file
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