main.py 文件源码

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

项目:ETC_Modes 作者: critterandguitari 项目源码 文件源码
def draw(screen, etc):
    global words, word1, word2, count, word_index

    color = etc.color_picker()
    size = etc.knob1 * 300 + 10
    x = etc.knob2 * 400
    y = etc.knob3 * 400
    font = pygame.freetype.Font(etc.mode_root + "/font.ttf", size)

    if etc.audio_trig or etc.midi_note_new : 
        count += 1
        count %= 3
        if count == 1 :
            word_index = random.randint(0,len(words))
            word1 = unicode(words[word_index][1])
        if count == 2 :
            word2 = unicode(words[word_index][0])

    if (count == 0) :
        pass

    if (count == 1) :
        (text, textpos1) = font.render(word1, color)
        textpos1 =(x, y)
        screen.blit(text, textpos1)

    if (count == 2) :
        (text, textpos1) = font.render(word1, color)
        textpos1 =(x, y)
        screen.blit(text, textpos1)
        (text, textpos1) = font.render(word2, color)
        textpos1 =(x, y + size)
        screen.blit(text, textpos1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号