kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
f46f44f454
commit
f546b9fcb4
|
@ -0,0 +1,5 @@
|
|||
azul
|
||||
amarel
|
||||
verde
|
||||
verdinho
|
||||
marrom
|
|
@ -0,0 +1,27 @@
|
|||
126 abalado
|
||||
131 abalar
|
||||
132 abalo
|
||||
133 abanar
|
||||
134 abancar
|
||||
135 abar
|
||||
136 abarcar
|
||||
141 abater
|
||||
142 abatido
|
||||
143 abc
|
||||
144 abdicar
|
||||
145 abdome
|
||||
146 abeirar
|
||||
151 abelha
|
||||
152 aberta
|
||||
153 aberto
|
||||
154 abertura
|
||||
155 abismo
|
||||
156 abissal
|
||||
161 abóbada
|
||||
162 abóbora
|
||||
163 abolido
|
||||
164 abolir
|
||||
165 abonar
|
||||
166 abono
|
||||
211 abordar
|
||||
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 103 KiB |
|
@ -0,0 +1,49 @@
|
|||
cat = 0
|
||||
|
||||
def setup():
|
||||
global tag_names, categorias, tags
|
||||
size(400, 400)
|
||||
textSize(18)
|
||||
categorias = loadStrings("categorias.txt")
|
||||
print categorias[cat]
|
||||
tags = setup_tags()
|
||||
|
||||
def draw():
|
||||
background(100, 0, 100)
|
||||
draw_tags()
|
||||
|
||||
def draw_tags():
|
||||
for tag in tags:
|
||||
x, y = tags[tag]['x'], tags[tag]['y']
|
||||
w, h = tags[tag]['w'], tags[tag]['h']
|
||||
noFill()
|
||||
rect(x, y, w, h)
|
||||
if tags[tag]['state']:
|
||||
fill(200, 0, 0)
|
||||
elif mouse_over_tag(tag):
|
||||
fill(255)
|
||||
else:
|
||||
fill(0)
|
||||
text(tag, x, y + h * 0.75)
|
||||
|
||||
def mouseReleased():
|
||||
for tag in tags:
|
||||
if mouse_over_tag(tag):
|
||||
tags[tag]['state'] ^= 1
|
||||
|
||||
def mouse_over_tag(tag):
|
||||
x, y = tags[tag]['x'], tags[tag]['y']
|
||||
w, h = tags[tag]['w'], tags[tag]['h']
|
||||
return (x < mouseX < x + w
|
||||
and y < mouseY < y + h)
|
||||
|
||||
def setup_tags():
|
||||
pos = lambda i : 10 + i * 30
|
||||
tag_names = loadStrings("tags.txt")
|
||||
return {tag: {'state': False,
|
||||
'x': 30 if pos(i) < height else 200,
|
||||
'y': pos(i) if pos(i) < height else 10 + pos(i) - height,
|
||||
'w': textWidth(tag),
|
||||
'h': 20,
|
||||
}
|
||||
for i, tag in enumerate(tag_names)}
|
|
@ -26,6 +26,12 @@ Here are listed some of the tools I have been using:
|
|||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[sketch_2020_10_29a](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_10_29a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[sketch_2020_10_28b](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_10_28b) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
|
Ładowanie…
Reference in New Issue