Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson6_diy2
This project
Loading...
Sign in
Toggle navigation
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
fd059dc3
authored
3 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
bf3084a1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
my_music.py
my_music.py
View file @
fd059dc3
...
@@ -60,6 +60,7 @@ while True:
...
@@ -60,6 +60,7 @@ while True:
else
:
else
:
play_button
=
play_img
play_button
=
play_img
pygame
.
mixer
.
music
.
pause
()
pygame
.
mixer
.
music
.
pause
()
if
x
>
420
and
x
<
520
and
y
>
350
and
y
<
450
:
#暂停
if
x
>
420
and
x
<
520
and
y
>
350
and
y
<
450
:
#暂停
pygame
.
mixer
.
music
.
stop
()
pygame
.
mixer
.
music
.
stop
()
play_button
=
stop_img
play_button
=
stop_img
...
@@ -68,12 +69,22 @@ while True:
...
@@ -68,12 +69,22 @@ while True:
else
:
else
:
click
+=
1
click
+=
1
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
num
+=
1
num
+=
1
if
num
>
len
(
music_list
)
-
1
:
if
num
>
len
(
music_list
)
-
1
:
num
=
0
num
=
0
pygame
.
mixer
.
music
.
load
(
music_list
[
num
])
pygame
.
mixer
.
music
.
load
(
music_list
[
num
])
pygame
.
mixer
.
music
.
play
()
pygame
.
mixer
.
music
.
play
()
qq
=
pygame
.
mixer
.
Sound
(
music_list
[
num
])
time_1
=
qq
.
get_length
()
time_2
=
int
(
time_1
)
time_3
=
time_2
//
60
time_4
=
time_2
%
60
info2
=
str
(
time_3
)
+
":"
+
str
(
time_4
)
eaxm2
=
play_get
.
render
(
'/'
+
info2
,
True
,(
255
,
255
,
255
))
# 旋转图片(注意:这里要搞一个新变量,存储旋转后的图片)
# 旋转图片(注意:这里要搞一个新变量,存储旋转后的图片)
new_logo
=
pygame
.
transform
.
rotate
(
logo_img
,
angle
)
#旋转图片,会生成一个新图片,第二个参数是角度,正数就是逆时针,负数就是顺时针
new_logo
=
pygame
.
transform
.
rotate
(
logo_img
,
angle
)
#旋转图片,会生成一个新图片,第二个参数是角度,正数就是逆时针,负数就是顺时针
# 校正旋转图片的中心点
# 校正旋转图片的中心点
...
@@ -96,7 +107,8 @@ while True:
...
@@ -96,7 +107,8 @@ while True:
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
))
# 下一曲
screen
.
blit
(
eaxm
,(
0
,
0
))
screen
.
blit
(
eaxm
,(
120
,
440
))
screen
.
blit
(
eaxm2
,(
170
,
440
))
# 刷新画面
# 刷新画面
pygame
.
display
.
update
()
pygame
.
display
.
update
()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment