Commit dd17148f by BellCodeEditor

auto save

parent f78729e6
Showing with 13 additions and 1 deletions
...@@ -85,7 +85,14 @@ while True: ...@@ -85,7 +85,14 @@ while True:
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
# 选择图片(注意:这里要搞一个新变量,存储旋转后的图片) # 歌曲播放进度时间
play_time = pygame.mixer.music.get_pos()
play_time = int(play_time/1000)
play_m = play_time//60 # 分
play_s = play_time % 60 # 秒
info = str(play_m) + ":" + str(play_s)
# 旋转图片(注意:这里要搞一个新变量,存储旋转后的图片)
new_logo = pygame.transform.rotate(logo_img, angle) new_logo = pygame.transform.rotate(logo_img, angle)
# 校正旋转图片的中心点 # 校正旋转图片的中心点
newRect = new_logo.get_rect(center=(320,200)) newRect = new_logo.get_rect(center=(320,200))
...@@ -98,5 +105,9 @@ while True: ...@@ -98,5 +105,9 @@ while True:
screen.blit(new_logo, pos) # 中间logo图 screen.blit(new_logo, pos) # 中间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)) # 下一曲
# 绘制时间进度
scoreSurf = basic_font.render(info, True, (255, 255, 255))
screen.blit(scoreSurf, (120, 440))
# 刷新画面 # 刷新画面
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