Commit a41613cd by BellCodeEditor

save project

parent 3c4a8e68
Showing with 8 additions and 4 deletions
......@@ -26,6 +26,7 @@ click = 0
play_button = stop_img
angle = 0
font1 = pygame.font.Font('neuropol.ttf',15)
font2 = pygame.font.Font('simhei.ttf',25)
while True:
for event in pygame.event.get():
......@@ -33,12 +34,12 @@ while True:
exit()
# 按键,控制声音大小
if event.type == locals.KEYDOWN:
if event.key == locals.K_w:
if event.key == locals.K_UP:
volume += 0.1
if volume > 1:
volume = 1
pygame.mixer.music.set_volume(volume)
if event.key == locals.K_s:
if event.key == locals.K_DOWN:
volume -= 0.1
if volume < 0:
volume = 0
......@@ -124,7 +125,9 @@ while True:
text = '/' + musicm +':'+ musics
info2 = font1.render(text,True,(0,0,0))
text = music_list[num][:-4]
info3 = font1.render(text,True,(255,255,255))
info3 = font2.render(text,True,(255,255,255))
rect1 = info3.get_rect(center = (320,25))
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
......@@ -133,6 +136,6 @@ while True:
screen.blit(next_img, (420, 350)) # 下一曲
screen.blit(info1, (130, 410))
screen.blit(info2, (200, 410))
screen.blit(info3, (420, 30))
screen.blit(info3, (rect1[0],rect1[1]))
# 刷新画面
pygame.display.update()
\ No newline at end of file
File added
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