Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup()
- links = {}
- -- random links
- links[1] = 'http://twolivesleft.com/Codea'
- links[2] = 'http://google.com'
- links[3] = 'http://facebook.com'
- links[4] = 'http://twitter.com'
- links[5] = 'http://gmail.com'
- end
- function draw()
- background(40, 40, 50)
- end
- function validTouch(x1,x2,y1,y2)
- if (x1<CurrentTouch.x and CurrentTouch.x<=x2 and y1<CurrentTouch.y and CurrentTouch.y<=y2) then
- return 1
- end
- return nil
- end
- function touched()
- for section = 1, 5, 1 do
- if(validTouch( (section-1)*WIDTH/5, section*WIDTH/5, 0, HEIGHT) ) then
- openURL(links[section])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment