Commit 6f711ea9 by BellCodeEditor

save project

parent 4180e948
Showing with 13 additions and 5 deletions
...@@ -6,6 +6,7 @@ pygame.init() # 初始化 ...@@ -6,6 +6,7 @@ pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
# 载入图片、资源 # 载入图片、资源
FPS=pygame.time.Clock()
bg_img = pygame.image.load('background.png') # 背景图 bg_img = pygame.image.load('background.png') # 背景图
play_img = pygame.image.load('play.png') # 播放按钮 play_img = pygame.image.load('play.png') # 播放按钮
stop_img = pygame.image.load('stop.png') # 暂停按钮 stop_img = pygame.image.load('stop.png') # 暂停按钮
...@@ -85,8 +86,12 @@ while True: ...@@ -85,8 +86,12 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
p_t=pygame.mixer.music.get_pos()
# 绘制画面 p_t=int(p_t/1000)
p_m=p_t//60
p_s=p_t%60
info=str(p_m)+":"+str(p_s)
# 绘制画面\
new_logo=pygame.transform.rotate(logo_img,angle) new_logo=pygame.transform.rotate(logo_img,angle)
newrect=new_logo.get_rect(center=(320,200)) newrect=new_logo.get_rect(center=(320,200))
pos=(newrect[0],newrect[1]) pos=(newrect[0],newrect[1])
...@@ -96,6 +101,9 @@ while True: ...@@ -96,6 +101,9 @@ while True:
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(new_logo,pos) # 中间logo图 screen.blit(new_logo,pos) # 中间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))
scoresurf=basic_font.render(info,True,(255,255,255))
screen.blit(scoresurf,(120,440)) # 下一曲
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
\ No newline at end of file
\ 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