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
评论列表
文章目录