Commit 44a442ea by BellCodeEditor

auto save

parent 0b84ea20
Showing with 2 additions and 5 deletions
...@@ -15,7 +15,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮 ...@@ -15,7 +15,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
my_font = pygame.font.Font('neuropol.ttf',18) my_font = pygame.font.Font('neuropol.ttf',18)
music_list = [] music_list = []
path = "C:\Users\tang\Documents\pygame_lesson6_diy1" path = "C:\\Users\\tang\\Documents\\pygame_lesson6_diy1"
filelist = os.listdir(path) filelist = os.listdir(path)
num = -1 num = -1
for i in filelist: for i in filelist:
...@@ -89,6 +89,7 @@ while True: ...@@ -89,6 +89,7 @@ while True:
click += 2 click += 2
else: else:
click += 1 click += 1
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
num += 1 num += 1
...@@ -122,7 +123,6 @@ while True: ...@@ -122,7 +123,6 @@ while True:
music_s = "0"+str(music_s) music_s = "0"+str(music_s)
info2 = str(music_m)+":"+str(music_s) info2 = str(music_m)+":"+str(music_s)
#print(play_time) #print(play_time)
#图片旋转 #图片旋转
new_logo = pygame.transform.rotate(logo_img,angle) new_logo = pygame.transform.rotate(logo_img,angle)
#返回一个元组:前两个数值代表左上角数值,后两个数值代表图片大小 #返回一个元组:前两个数值代表左上角数值,后两个数值代表图片大小
...@@ -131,18 +131,15 @@ while True: ...@@ -131,18 +131,15 @@ while True:
pos = (new_rect[0],new_rect[1]) pos = (new_rect[0],new_rect[1])
if play_button == stop_img: if play_button == stop_img:
angle+=1 angle+=1
# 绘制画面 # 绘制画面
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(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 = my_font.render(info,True,(255,255,255)) scoreSurf = my_font.render(info,True,(255,255,255))
screen.blit(scoreSurf,(120,440)) screen.blit(scoreSurf,(120,440))
#加载总时长的渲染 #加载总时长的渲染
scoreSurf2 = my_font.render('/'+info2,True,(0,0,0)) scoreSurf2 = my_font.render('/'+info2,True,(0,0,0))
screen.blit(scoreSurf2,(180,440)) screen.blit(scoreSurf2,(180,440))
......
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