main.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ETC_Modes 作者: critterandguitari 项目源码 文件源码
def draw(screen, etc) : 
    global xpos, ypos, xdirection, ydirection, rIght, bOttom, lEft, tOp, unistr, word, coloryo, avg

    color = etc.color_picker()
    auDio = etc.audio_peak / 128
    if auDio > 255 : auDio = 255

    coloryo = (auDio,color[1],color[2])

    size = int(100*etc.knob3)+1
    font = pygame.freetype.Font(etc.mode_root + "/font.ttf", size)

    unistr = unicode(stringList[word])

    (text, textpos) = font.render(unistr, (coloryo))

    xspeed = int(etc.knob1 * 50) + 1
    yspeed = int(etc.knob2 * 50) + 1

    xpos = xpos + (xspeed * xdirection)
    ypos = ypos + (yspeed * ydirection) 

    rIght = xpos + text.get_width()
    bOttom = ypos + text.get_height()
    lEft = xpos
    tOp = ypos

    screen.blit(text, (xpos,ypos))

    if rIght >= 1280 or lEft <= 0  : 
        xdirection *= -1
        word = (word+1)%7

    if bOttom >= 720 or tOp <= 0  : 
        ydirection *= -1
        word = (word+1)%7
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号