Commit 08bb56c3 by BellCodeEditor

save project

parent 85f2f20b
Showing with 8 additions and 3 deletions
...@@ -15,6 +15,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮 ...@@ -15,6 +15,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
my_font = pygame.font.Font('neuropol.ttf', 18) my_font = pygame.font.Font('neuropol.ttf', 18)
music_list = [] music_list = []
path = "C:\\Users\\EDZ\\Desktop\\music" path = "C:\\Users\\EDZ\\Desktop\\music"
filelist = os.listdir(path) filelist = os.listdir(path)
...@@ -29,6 +30,7 @@ play_button = stop_img ...@@ -29,6 +30,7 @@ play_button = stop_img
a=0 a=0
ab=pygame.transform.rotate(logo_img,a) ab=pygame.transform.rotate(logo_img,a)
a1,a2=0,0 a1,a2=0,0
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -81,15 +83,16 @@ while True: ...@@ -81,15 +83,16 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
p=pygame.mixer.music.get_pos() p=pygame.mixer.music.get_pos()
p=int(p/1000) p=int(p/1000)
pm=p//60 pm=p//60
ps=p%60 ps=p%60
pms=str(pm)+':'+str(ps) pms=str(pm)+':'+str(ps)
print(pms) txt=my_font.render(pms,True,(0,0,0))
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
...@@ -110,5 +113,6 @@ while True: ...@@ -110,5 +113,6 @@ 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(txt,(100,420))
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