Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson6_diy2

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 31f395c5 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent cc90337a c186615l1384p256a14205/wx255273
Hide whitespace changes
Inline Side-by-side
Showing with 17 additions and 2 deletions
  • my_music.py
my_music.py
View file @ 31f395c5
......@@ -83,10 +83,18 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
#获取时间
play_time = pygame.mixer.music.get_pos()#毫秒
play_time = int(play_time/1000)#秒
play_m = play_time//60
play_s = play_time%60
info = str(play_m)+":"+str(play_s)
new_logo = pygame.transform.rotate(logo_img, angle)
# 校正旋转图片的中心点
if play_button == stop_img:
if play_button == stop_img:
angle -= 1
# 校正旋转图片的中心点
newRect = new_logo.get_rect(center=(320, 200))
position = (newRect[0], newRect[1])
angle -= 1
......@@ -96,5 +104,11 @@ while True:
screen.blit(new_logo, position) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
basic_font = pygame.font.Font('neuropol.ttf',14)
#绘制时间
time = basic_font.render(info,True,(255,255,255))
screen.blit(time,(120,440))
# 刷新画面
pygame.display.update()
\ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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