Commit d1bb76ac by BellCodeEditor

save project

parent 5a2c1245
Showing with 19 additions and 1 deletions
......@@ -3,6 +3,7 @@ from pygame import locals
import os
pygame.init() # 初始化
ww=pygame.font.Font("")
# 创建窗口
screen = pygame.display.set_mode((640, 480))
q_q=pygame.time.Clock()
......@@ -27,7 +28,21 @@ click = 0
play_button = stop_img
while True:
pygame.mixer.music.get_pos()
music1=pygame.mixer.Sound(path+"\\"+music_list[num])
music_length=music1.get_length()
music_length=int(music_length)
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)
music_m=music_length//60
music_s=music_length%60
if music_s<10:
music_s="0"+str(music_s)
info2=str(music_m)+":"+str(music_s)
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
......@@ -97,5 +112,7 @@ while True:
screen.blit(new_logo, (p_p)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
scoreSurf=basic_font.render(info,True,(255,255,255))
screen.blit(scoreSurf,(120,440))
# 刷新画面
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