Commit da64c8ed by BellCodeEditor

save project

parent 72f1fef1
Showing with 12 additions and 0 deletions
......@@ -11,6 +11,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo
font=pygame.font.Font("neuropol.ttf",15)
volume = 0.2
pygame.mixer.music.load('test.wav')
pygame.mixer.music.set_volume(volume)
......@@ -80,12 +81,22 @@ while True:
new_loge = pygame.transform.rotate(logo_img,angle)
newRect=new_loge.get_rect(center=(320,200))
pos =(newRect[0],newRect[1])
play_time = pygame.mixer.music.get_pos()
play_time = int(play_time/1000)
play_m = play_time//60
play_s = play_time%60
if play_s<10:
play_s = '0'+str(play_s)
info = str(play_m)+':'+str(play_s)
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(new_loge, pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
play_time = font.render(info,True,(255,255,255))
screen.blit(play_time,(120,440))
# 刷新画面
pygame.display.update()
fps.tick(60)
\ 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