Commit 6f7263e0 by BellCodeEditor

save project

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