Advertisement
Guest User

Untitled

a guest
Nov 20th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.57 KB | None | 0 0
  1.   add(greener => new UIState {
  2.       on(mouse clicked) --> new UIState {
  3.           implicit val twin = Linear(1 second)
  4.           val init = mouse.position.copy
  5.           val alpha = Cell(0.0) ~> 1
  6.           val rect = Rectangle(init, init+(30,30))
  7.          
  8.           draw(rect fill Color(green, alpha))
  9.          
  10.           on (mouse released) --> new UIState {
  11.               implicit val twin = Linear(1 second)
  12.               draw(rect fill Color(green, Cell(!alpha) ~> 0))
  13.              
  14.               on (twin finished) --> greener()
  15.           }
  16.       }
  17.   })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement