size(400, 400)
colormode(RGB, 255)
background(255, 255, 255)
nofill()
nostroke()
fotosfundo = [“muse5.jpg”, “muse3.jpg”, “muse1.jpg”, “muse7.jpg”]
tipografiaparacima = [“Flama”, “Candara”, “Helvetica”,”Impact”, “Corbel”]
tipografiaparabaixo = [“Flama”, “Candara”, “Helvetica”, “Impact”, “Corbel”]
textoparacima = [“Are the best”, “Awesome”, “Great´s”, “They Rock´s”, “My favotite!!”, “Rock n´Roll” ]
textoparabaixo = [“United States Of Eurasia”, “Supermassive Black Hole”, “Resistance”, “Invincible “, “Hate This And I’ll Love “,”Uprising” ]
#variaveis (var)
var(“imagensfundo”, NUMBER, 0, 0, 5)
var(“posicaoimagemx”, NUMBER, -100, -400, 400)
var(“posicaoimagemy”, NUMBER, -100, -400, 400)
var(“rotacao”, NUMBER, 0, 0, 361)
var(“escalarhoriz”, NUMBER, 0, 0, 3)
var(“escalarvert”, NUMBER, 0, 0, 3)
var(“distorcaohoriz”, NUMBER, 0, 0, 2)
var(“distorcaovert”, NUMBER, 0, 0, 2)
# tudo
var(“linha”, NUMBER, 2, 0.25, 6)
var(“linhacor”, NUMBER, 0, 0, 256)
# superior
var(“cimaox”, NUMBER, 40, -200, 700)
var(“cimaoy”, NUMBER, 80-48, -200, 700)
var(“rotacaocima”, NUMBER, 0, 0, 361)
var(“tipografiacima”, NUMBER, 0, 0, 6)
var(“tamanhocima”, NUMBER, 48, 12, 72)
var(“textocima”, NUMBER, 0, 0, 11)
var(“corcima”, NUMBER, 255, 0, 255)
# inferior
var(“baixoox”, NUMBER, 40, -200, 700)
var(“baixooy”, NUMBER, 400-48, -200, 700)
var(“rotacaobaixo”, NUMBER, 0, 0, 361)
var(“tipografiabaixo”, NUMBER, 0, 0, 11)
var(“tamanhobaixo”, NUMBER, 48, 12, 72)
var(“textobaixo”, NUMBER, 0, 0, 7)
var(“corbaixo”, NUMBER, 255, 0, 255)
imagemfundo = imagensparafundo[int(imagensfundo)]
nofill()
nostroke()
transform(CENTER)
scale(escalarhoriz, escalarvert)
rotate(rotacao)
skew(distorcaovert, distorcaohoriz)
image(imagemfundo, posicaoimagemx, posicaoimagemy, 600, 600)
reset()
nofill()
nostroke()
textocima = textosparacima[int(textoscima)]
textobaixo = textosparabaixo[int(textosbaixo)]
tipografiacima = tipografiasparacima[int(tipografiascima)]
tipografiabaixo = tipografiasparabaixo[int(tipografiasbaixo)]
stroke(linhacor)
strokewidth(linha)
fill(corcima)
font(tipografiacima)
fontsize(tamanhocima)
transform(CENTER)
rotate(rodarcima)
textpath(textocima, posicaocimax, posicaocimay)
reset()
fill(corbaixo)
font(tipografiabaixo)
fontsize(tamanhobaixo)
transform(CENTER)
rotate(rodarbaixo)
textpath(textobaixo, posicaobaixox, posicaobaixoy)
size(300, 300)
colormode(RGB, 255)
background(255, 255, 255)
# o texto e a imagem da banda
image(“kings of leon.jpg”, 0, 0)
font(“flama”, 15)
def get_line(lines):
if l.isupper():
l = get_line(lines)
return l
else:
return l
texto = open(“texto.txt”)
lines = mensagem.readlines()
l1 = get_line(lines)
l2 = get_line(lines)
fill(1)
stroke(0)
textpath(l1, 10, 50)
textpath(l2, 10, 380)
size (500, 1000) colormode(RGB, 255) fundos = [color(138, 168, 116), color(62,65,55), color(26,56,55)] background (choice(fundos)) textos = [“love”, “pain”, “rage”] textoc = choice(textos) texto = “Feel %s” % (textoc) # tamanhos = [50,55, 60, 80,82] # cores = [color(124,94,118), color(124,94,118)] def retangulos (x, y, tamanho=7, contorno=5): fill (0, 0, 0) stroke (2, 2, 2) strokewidth (contorno) rect (x, y, tamanho, tamanho) reset () for x, y in grid (40, 65, 20, 20): retangulos(x, y, contorno = random(5, 9)) nostroke() fill(0) rect(0, 200, 500, 200) nostroke() fill(255) font(“impact”) fontsize(120) text(texto, 20, 350, 530)
size (300,300)
background(0)
for x, y in grid(9, 20, 30, 40):
star(23+x, 9+y, 50, 9)
fill(random(11,9.2),random(6,0.9),random(0.8,0.6))
size (500,600)
background(0)
for x, y in grid( 11, 30, 50, 40):
rect (10+x, 20+y, 10, 13)
fill(0.5,random(3.7,1),random(9,4))
fill (1)
font ( “Helvetica”, 25)
text(“GAME OVER”,160,214)
size(500, 500)
background (1)
for x, y in grid (10, 10, 50, 50):
scale(y/300.)
fill(0)
oval(10+x, 10+y, 20, 20)
reset()
print y/300.
size(2500,300)
background (0)
inicios = [“U2”, “King of Leon”, “Muse”]
meios = [“ótimos”, “estranhos”, “excêntricos”]
fins = [ “muitas pessoas”, “os idosos”, “os meus pais”]
a = [ “para os jovens”, “para mim”, “para os meus amigos”]
b = [ “super excelentes”,”brutais” ,”os melhores”]
c = [“os beatles” ,”os scorpions”, “os queen”]
d = [“os da moda”, “aqueles que vendiam”]
x = 40
y = 60
inicio = choice(inicios)
meio = choice(meios)
fim = choice(fins)
a = choice(a)
b = choice(b)
c = choice(c)
d = choice(d)
frase = “Os %s são %s para %s mas %s eles são %s e não há melhor,no entanto %s, na sua época eram %s” % (inicio, meio, fim,a,b,c,d)
fill(1)
font(“helvetica”, 20)
text(frase, x, y)
size (475,475)
background(0)
fill(1)
font(“AndradePro”,60)
fill (0.6)
text(“CIRCLES”,120,250)
fill(1,0.15)
for x, y in grid(15, 15, 30, 30):
oval(10+x, 10+y, 40, 30)
Código:
size (500, 500)
background(0)
x = 20
y = 80
frases = [“Good Night”, “Hello”, “Good Morning!”, “Goodbye.”]
fill(1)
font(“Georgia”, 14)
print range(10)
for numero in range(10):
text(choice(frases), x, y)
y = y + 30
trabalho da aula:
size(200,200)
background(0.8,0.8,0.8)
# rectangulo cizento de cima
nostroke()
fill(0.2)
rect (10,18,180,50)
# mudamos a cor de fundo
stroke(1,0,0.2)
fill(0.5,0.3,0.12)
# circulo
oval(10,10,100,100)
#rectagulo de baixo
nofill()
#mudar largura do contorno
strokewidth(3)
rect(10,140,180,50)
stroke (40)
beginpath(30,50)
lineto(40,90)
endpath()