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 9eb535e0 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 46e94d25
Show whitespace changes
Inline Side-by-side
Showing with 14 additions and 1 deletions
  • my_music.py
my_music.py
View file @ 9eb535e0
......@@ -86,7 +86,14 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
#获取歌曲总长
#获取歌曲时间
play_time = pygame.mixer.music.get_pos()
time = int(play_time/1000)
play_m = time // 60
play_s = time % 60
mt = (str(play_m) +':'+str(play_s))
#唱片旋转
new_logo = pygame.transform.rotate(logo_img, angle)
new_rect = new_logo.get_rect(center=(320,200))
pop = (new_rect[0],new_rect[1])
......@@ -94,6 +101,12 @@ while True:
angle -= 1
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
#设置时间、字体
my_font = pygame.font.Font('neuropol.ttf',18)
font = my_font.render(mt,True,(0,0,0))
screen.blit(font,(0,0))
screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(new_logo, (pop)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
......
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