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

Administrator / pygame_lesson6_diy3

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

save project

parent 1f841c32 c54290l1384p256a14206/wx177525
Hide whitespace changes
Inline Side-by-side
Showing with 10 additions and 2 deletions
  • my_music.py
my_music.py
View file @ fccceb62
......@@ -5,6 +5,7 @@ import os
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
basit_font=pygame.font.Font('neuropol.ttf',18)
# 载入图片、资源
bg_img = pygame.image.load('background.png') # 背景图
play_img = pygame.image.load('play.png') # 播放按钮
......@@ -24,7 +25,6 @@ volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
play_button = stop_img
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -83,7 +83,12 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
h_s=pygame.mixer.music.get_pos()
s = int(h_s/1000)
play_m = s//60
play_s = s%60
info = str(play_m) + ':' + str(play_s)
new_logo = pygame.transform.rotate(logo_img,angle)
newRect = new_logo.get_rect(center=(320,200))
pos = (newRect[0], newRect[1])
......@@ -95,5 +100,7 @@ while True:
screen.blit(new_logo, pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
a=basit_font.render(info,True,(255,255,255))
screen.blit(a,(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