from math import *
from kandinsky import *
from ion import *
import time
print("")
print("Change la taille avec les fleches")
t=1
d=10
print("Mot/texte/nombre: ")
mot=str(input("-> "))
print("Couleur (red,blue,green,...)")
color=str(input("->: "))
if mot=="":
mot="42"
if color=="":
color="black"
while len(mot)>42:
print("Votre entree est trop grande.")
mot=str(input("Entree: "))
def interaction():
global t
global d
if keydown(KEY_UP):
t+=1
draw()
if keydown(KEY_DOWN) and t>1:
t-=1
draw()
if keydown(KEY_LEFT) and d>((10*len(mot)*t)-310)*-1:
d-=t*3
draw()
if keydown(KEY_RIGHT) and d<10:
d+=t*3
draw()
def draw():
x=0
y=200
x2=d
y2=10
fill_rect(0,0,320,222,"white")
draw_string(mot,0,200,color)
for i in range(200*len(mot)):
fill_rect(x2,y2,t,t,get_pixel(x,y))
x2+=t
if x2==(10*t)*len(mot)+d+t:
x2=d
y2+=t
x+=1
if x==10*len(mot)+1:
x=0
y+=1
fill_rect(0,199,320,1,"black")
fill_rect(0,200,320,22,"white")
draw_string(mot,0,200,color)
draw()
while True:
interaction()