Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. module (..., package.seeall)
  2.  
  3. function new()
  4.  
  5. local _H = display.contentHeight
  6. local _W = display.contentWidth
  7.  
  8. local menuGroup = display.newGroup()
  9.  
  10. local background = display.newImage("graphics/mainMenuBackground.png")
  11. background.x = _W/2
  12. background.y = _H/2
  13.  
  14. local clefs = display.newImage("graphics/clefs.PNG")
  15. clefs.x = _W/2
  16. clefs.y = _H/4
  17. clefs.scene = "clefs"
  18. clefs.alpha = 0.8
  19.  
  20. local stave = display.newImage("graphics/stave.PNG")
  21. stave.x = _W/2
  22. stave.y = _H/2.5
  23. stave.scene = "stave"
  24. stave.alpha = 0.8
  25.  
  26. local notes = display.newImage("graphics/notes.PNG")
  27. notes.x = _W/2
  28. notes.y = _H/1.8
  29. notes.scene = "notes"
  30. notes.alpha = 0.8
  31.  
  32. local timeSignatures = display.newImage("graphics/timeSignatures.PNG")
  33. timeSignatures.x = _W/2
  34. timeSignatures.y = _H*0.7
  35. timeSignatures.scene = "timeSignatures"
  36. timeSignatures.alpha = 0.8
  37.  
  38. local howToWrite = display.newImage("graphics/howToWrite.PNG")
  39. howToWrite.x = _W/2
  40. howToWrite.y = _H*0.85
  41. howToWrite.scene = "howToWrite"
  42. howToWrite.alpha = 0.8
  43.  
  44.  
  45. menuGroup:insert(background)
  46. menuGroup:insert(stave)
  47. menuGroup:insert(clefs)
  48. menuGroup:insert(notes)
  49. menuGroup:insert(timeSignatures)
  50. menuGroup:insert(howToWrite)
  51.  
  52. stave:addEventListener("touch", changeScene)
  53. clefs:addEventListener("touch", changeScene)
  54. notes:addEventListener("touch", changeScene)
  55. timeSignatures:addEventListener("touch", changeScene)
  56. howToWrite:addEventListener("touch", changeScene)
  57.  
  58. return menuGroup
  59.  
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement