Commit e3c203ba by BellCodeEditor

save project

parent 762b6f19
Showing with 22 additions and 2 deletions
......@@ -66,6 +66,9 @@ while True:
click += 2
else:
click += 1
music1 = pygame.mixer.Sound(path+'\\'+music_list[num])
music_length = music1.get_length()
music_length = int(music_length)
if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲
num -= 1
......@@ -78,6 +81,9 @@ while True:
click += 2
else:
click += 1
music1 = pygame.mixer.Sound(path+'\\'+music_list[num])
music_length = music1.get_length()
music_length = int(music_length)
if pygame.mixer.music.get_busy() == False:
num += 1
......@@ -85,19 +91,27 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
#歌曲时间
music1 = pygame.mixer.Sound(path+'\\'+music_list[num])
music_length = music1.get_length()
music_length = int(music_length)
#进度时间
play_timg = pygame.mixer.music.get_pos()
play_timg = int(play_timg/1000)
play_m = play_timg//60
play_s = play_timg % 60
if play_s<10:
play_s = '0'+str(play_s)
info = str(play_m) + ':' + str(play_s)
#旋转后的唱盘图片
#旋转后的唱盘图片
new_logo = pygame.transform.rotate(logo_img,sd)
nweRect = new_logo.get_rect(center = (320,200))
pos = (nweRect[0],nweRect[1])
if play_button == stop_img:
sd+=99999
sd+=2
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
......@@ -105,5 +119,10 @@ while True:
screen.blit(new_logo,pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
#绘制时间进度
scoreSurf = basic_render(info,True,(255,255,255))
screen.blit(scoreSurf,(120,440))
scoreSurf2 = basic_font.render('/' + info2,True,(0,0,0))
screen.blit(scoreSurf2,(170,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