Guest User

Untitled

a guest
Mar 20th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. function setup()
  2.     links = {}
  3.     -- random links
  4.     links[1] = 'http://twolivesleft.com/Codea'
  5.     links[2] = 'http://google.com'
  6.     links[3] = 'http://facebook.com'
  7.     links[4] = 'http://twitter.com'
  8.     links[5] = 'http://gmail.com'
  9. end
  10.  
  11. function draw()
  12.     background(40, 40, 50)
  13. end
  14.  
  15. function validTouch(x1,x2,y1,y2)
  16.     if (x1<CurrentTouch.x and CurrentTouch.x<=x2 and y1<CurrentTouch.y and CurrentTouch.y<=y2) then
  17.         return 1
  18.     end
  19.     return nil
  20. end
  21.  
  22. function touched()
  23.     for section = 1, 5, 1 do
  24.         if(validTouch( (section-1)*WIDTH/5, section*WIDTH/5, 0, HEIGHT) ) then
  25.             openURL(links[section])
  26.         end
  27.     end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment