Commit 3c4a8e68 by BellCodeEditor

save project

parent ce75acf0
Showing with 23 additions and 0 deletions
...@@ -61,6 +61,8 @@ while True: ...@@ -61,6 +61,8 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music = pygame.mixer.Sound(path + "\\" + music_list[num])
musiclen = int(music.get_length())
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -74,6 +76,8 @@ while True: ...@@ -74,6 +76,8 @@ while True:
num = len(music_list) - 1 num = len(music_list) - 1
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music = pygame.mixer.Sound(path + "\\" + music_list[num])
musiclen = int(music.get_length())
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -87,6 +91,8 @@ while True: ...@@ -87,6 +91,8 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music = pygame.mixer.Sound(path + "\\" + music_list[num])
musiclen = int(music.get_length())
if click % 2 == 0: if click % 2 == 0:
new_logo = pygame.transform.rotate(logo_img,angle) new_logo = pygame.transform.rotate(logo_img,angle)
...@@ -105,6 +111,20 @@ while True: ...@@ -105,6 +111,20 @@ while True:
plays = str(plays) plays = str(plays)
text = playm +':'+ plays text = playm +':'+ plays
info1 = font1.render(text,True,(255,255,255)) info1 = font1.render(text,True,(255,255,255))
musicm = musiclen//60
if musicm < 10:
musicm = '0' + str(musicm)
else:
musicm = str(musicm)
musics = musiclen%60
if musics < 10:
musics = '0' + str(musics)
else:
musics = str(musics)
text = '/' + musicm +':'+ musics
info2 = font1.render(text,True,(0,0,0))
text = music_list[num][:-4]
info3 = font1.render(text,True,(255,255,255))
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
...@@ -112,5 +132,7 @@ while True: ...@@ -112,5 +132,7 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
screen.blit(info1, (130, 410)) screen.blit(info1, (130, 410))
screen.blit(info2, (200, 410))
screen.blit(info3, (420, 30))
# 刷新画面 # 刷新画面
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