Commit 6f7263e0 by BellCodeEditor

save project

parent 618162ce
Showing with 10 additions and 2 deletions
......@@ -4,6 +4,7 @@ import os
angle=0
pygame.init() # 初始化
FPS=pygame.time.Clock()
# 创建窗口
screen = pygame.display.set_mode((640, 480))
# 载入图片、资源
......@@ -13,7 +14,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
my_font=pygame.font.Font("neuropol.ttf",19)
music_list = []
path = "C:\\Users\\Administrator\\Desktop\\test (2)"
filelist = os.listdir(path)
......@@ -89,6 +90,10 @@ while True:
sb=(new_rect[0],new_rect[1])
if play_button==stop_img:
angle+=1
play_time=pygame.mixer.music.get_pos()
play_time=int(play_time/1000)
play_m=play_time//60
play_s=play_time%60
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
......@@ -96,6 +101,8 @@ while True:
screen.blit(new_logo,sb) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
info=str(play_m)+":"+str(play_s)
text=my_font.render(info,True,(250,250,250))
screen.blit(text,(120,440))
pygame.display.update()
FPS.tick(60)
\ 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