Commit 192abae7 by BellCodeEditor

save project

parent 7a25f590
Showing with 10 additions and 2 deletions
...@@ -12,7 +12,7 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -12,7 +12,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') # 下一曲按钮
myfont = pygame.font.Font('neuropol.ttf',15)
music_list = [] music_list = []
path = r"C:\Users\Administrator\Desktop\新建文件夹 (2)" path = r"C:\Users\Administrator\Desktop\新建文件夹 (2)"
filelist = os.listdir(path) filelist = os.listdir(path)
...@@ -26,13 +26,19 @@ click = 0 ...@@ -26,13 +26,19 @@ click = 0
play_button = stop_img play_button = stop_img
angle = 1 angle = 1
while True: while True:
play_time = pygame.mixer.music.get_pos()
play_time = int(play_time/1000)
p_m = play_time // 60
p_s = play_time % 60
info = str(p_m)+":"+str(p_s)
text = myfont.render(info,True,(0,0,0))
new_img = pygame.transform.rotate(logo_img,angle) new_img = pygame.transform.rotate(logo_img,angle)
new_rect = new_img.get_rect(center = (320,190)) new_rect = new_img.get_rect(center = (320,190))
if click % 2 == 0: if click % 2 == 0:
angle += 1 angle += 1
l_x = new_rect[0] l_x = new_rect[0]
l_y = new_rect[1] l_y = new_rect[1]
print(new_rect,"坐标",l_x,l_y) # print(new_rect,"坐标",l_x,l_y)
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
...@@ -97,5 +103,6 @@ while True: ...@@ -97,5 +103,6 @@ while True:
screen.blit(new_img, (l_x, l_y)) # 中间logo图 screen.blit(new_img, (l_x, l_y)) # 中间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(text,(40,440))
# 刷新画面 # 刷新画面
pygame.display.update() 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