Commit fccceb62 by BellCodeEditor

save project

parent 1f841c32
Showing with 10 additions and 2 deletions
......@@ -5,6 +5,7 @@ import os
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
basit_font=pygame.font.Font('neuropol.ttf',18)
# 载入图片、资源
bg_img = pygame.image.load('background.png') # 背景图
play_img = pygame.image.load('play.png') # 播放按钮
......@@ -24,7 +25,6 @@ volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
play_button = stop_img
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -83,7 +83,12 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
h_s=pygame.mixer.music.get_pos()
s = int(h_s/1000)
play_m = s//60
play_s = s%60
info = str(play_m) + ':' + str(play_s)
new_logo = pygame.transform.rotate(logo_img,angle)
newRect = new_logo.get_rect(center=(320,200))
pos = (newRect[0], newRect[1])
......@@ -95,5 +100,7 @@ while True:
screen.blit(new_logo, pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
a=basit_font.render(info,True,(255,255,255))
screen.blit(a,(120,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