Guest User

main.lua

a guest
Oct 7th, 2013
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. -----------------------------------------------------------------------------------------
  2. --
  3. -- main.lua
  4. --
  5. -----------------------------------------------------------------------------------------
  6.  
  7. Red_Button = display.newImage("Red_Button_Up.png")
  8. Red_Button.x = display.pixelWidth / 3
  9. Red_Button.y = display.pixelHeight / 3.5
  10. Red_Button_B = display.newImage("Red_Button_Down.png")
  11. Red_Button_B.x = display.pixelWidth / 3
  12. Red_Button_B.y = display.pixelHeight / 3.5
  13. Red_Button_B.isVisible = false
  14. Text = display.newImage("Do_Not_Press.png")
  15. Text.x = display.pixelWidth / 3
  16. Text.y = display.pixelHeight / 10
  17. whitelevel = 0
  18. whitesize = display.pixelHeight
  19. whiterect = display.newRect(display.pixelWidth / 3,display.pixelHeight / 3.5,0,0)
  20. whiterect.isVisible = false
  21. whiterect.alpha = whitelevel
  22. display.setStatusBar(display.HiddenStatusBar)
  23.  
  24.  
  25.  
  26.  
  27. function main()
  28.     Red_Button.isVisible = false
  29.     Red_Button_B.isVisible = true
  30.     timer.performWithDelay(500, whiteflash)
  31.  
  32.  
  33.  
  34. end
  35.  
  36. function whiteflash()
  37.     whiterect.isVisible = true
  38.     whiterect.width = whitesize
  39.     whiterect.height = whitesize
  40.     transition.to(Text, {time=300, delay=1000, alpha=0})
  41.     transition.to(Red_Button_B, {time=300, delay=1000, alpha=0})
  42.     transition.to(whiterect, {time=500, delay=1000, alpha=1})
  43.     timer.performWithDelay(200, close)
  44. end
  45.  
  46.  
  47. function close()
  48.     native.requestExit()
  49. end
  50.  
  51.  
  52.  
  53. Red_Button:addEventListener("touch", main)
Advertisement
Add Comment
Please, Sign In to add comment