只记今朝笑_生日快乐贺卡

0 Comments

李兴球Python只记今朝笑_生日快乐贺卡

李兴球Python只记今朝笑_生日快乐贺卡

"""
    只记今朝笑_生日快乐贺卡.py    
"""
from sprites import *

width,height = 450,700            # 窗口宽度和高度

screen = Screen()
screen.bgcolor('#3DA290')
screen.setup(width,height)
screen.title('生日快乐贺卡')

logo = Sprite('cake.png',pos=(-500,70))
logo.setalpha(0)
aa = 0
def display_logo():
    global aa
    if aa<255:
        aa = aa + 1
        logo.setalpha(aa)        
        screen.ontimer(display_logo,10)
logo.goto(0,10)
display_logo()                    # logo渐显

music = '胡伟立 - 只记今朝笑(快乐得不得了)贺岁童唱版.wav'
lrc = '只记今朝笑(贺岁童唱版).lrc'
singer = Sprite('blank')
singer.sety(-320)
singer.play(music,lrc,fontstyle=("",20,"normal"))

# 标题文字从左到右旋转而来,在中间通过stamp印于屏幕上,继续旋转向右直到消失
txt2image('生日快乐','res/tcgame.png',fontsize=44,color='magenta')
tctitle = Sprite('blank',pos=(0,280))
tctitle.bk(400)
tctitle.left(40)
tctitle.shape('res/tcgame.png')
clock = Clock()
for _ in range(800):
    tctitle.addx(1)
    if tctitle.xcor()==0:tctitle.stamp()
    tctitle.right(1)
    clock.tick(120)
ft = ('',22,'normal')
tctitle.hide()

成为会员后,登陆才能继续浏览!联系微信scratch8即可办理会员。
(会员专属:能浏览所有文章,下载所有带链接的Python资源。)

标签:

发表评论