Advertisement
kekellner

Prueba python

Mar 22nd, 2021
1,454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. LED0 = [200, 200, 0]
  2. # [coordX, coordY,
  3. boton0 = [100, 100, 50]
  4.  
  5. def setup():
  6.     size(500, 500)
  7.  
  8. def draw():
  9.     background(0)
  10.     pintarLED(LED0)
  11.     pintarBoton(boton0)
  12.     # pintarBoton(boton1)
  13.     # pintarBoton(boton2)
  14.     # pintarBoton(boton3)
  15.  
  16.  
  17. def pintarLED(a):
  18.     fill(128)
  19.     circle(a[0], a[1], 50)
  20.  
  21. def pintarBoton(datos):
  22.     fill(180,0,0)
  23.     square(datos[0], datos[1], datos[2])
  24.  
  25.     if mousePressed:
  26.         if mouseX > datos[0] and mouseX < datos[0] + datos[2] and mouseY > datos[1] and mouseY < datos[1] + datos[2]:
  27.             fill(0,180,180)
  28.             square(datos[0], datos[1], datos[2]*0.8)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement