Commit ed5a1591 by BellCodeEditor

save project

parent 89bd5f4e
Showing with 20 additions and 1 deletions
......@@ -27,6 +27,8 @@ play_button = stop_img
angle=1
FPS=pygame.time.Clock()
font=pygame.font.Font("neuropol.ttf",18)
music_length=0
while True:
for event in pygame.event.get():
......@@ -68,6 +70,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
......@@ -80,6 +85,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
......@@ -87,11 +95,20 @@ 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_time=pygame.mixer.music.get_pos()
play_time=play_time//1000
play_a=play_time//60
play_b=play_time%60
music_length_a=music_length//60
music_length_b=music_length%60
play_c=str(play_a)+":"+str(play_b)
music_length_c="/"+str(music_length_a)+":"+str(music_length_b)
wcc=font.render(music_length_c,True,(0,0,0))
wee=font.render(play_c,True,(0,0,0))
new_logo=pygame.transform.rotate(logo_img,angle)
newRect=new_logo.get_rect(center=(320,200))
......@@ -105,6 +122,7 @@ while True:
screen.blit(new_logo, pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
screen.blit(wee,(360,20))
screen.blit(wee,(120,440))
screen.blit(wcc,(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