Commit 6d389824 by BellCodeEditor

save project

parent 6727c4a5
Showing with 9 additions and 0 deletions
...@@ -10,6 +10,8 @@ stop_img = pygame.image.load('stop.png') ...@@ -10,6 +10,8 @@ stop_img = pygame.image.load('stop.png')
last_img = pygame.image.load('last.png') last_img = pygame.image.load('last.png')
next_img = pygame.image.load('next.png') next_img = pygame.image.load('next.png')
logo_img = pygame.image.load('logo.png') logo_img = pygame.image.load('logo.png')
mfont=pygame.font.Font('neuropol.ttf',30)
music_list = [] music_list = []
path = "C:\\Users\\XMBC\\Desktop\\test" path = "C:\\Users\\XMBC\\Desktop\\test"
filelist = os.listdir(path) filelist = os.listdir(path)
...@@ -78,10 +80,17 @@ while True: ...@@ -78,10 +80,17 @@ while True:
loge=pygame.transform.rotate(logo_img,angle) loge=pygame.transform.rotate(logo_img,angle)
if play_button == stop_img: if play_button == stop_img:
angle += 1 angle += 1
time=pygame.mixer.music.get_pos()
m=time//1000//60
s=time//1000%60
info=str(m)+':'+str(s)
f=mfont.render(info,True,(0,0,0))
pos=loge.get_rect(center=(320,200)) pos=loge.get_rect(center=(320,200))
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(loge, (pos[0],pos[1])) # 中间logo图 screen.blit(loge, (pos[0],pos[1])) # 中间logo图
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(f, (400, 450))
pygame.display.update() pygame.display.update()
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