-
Notifications
You must be signed in to change notification settings - Fork 0
/
MenuScreen.lua
71 lines (62 loc) · 1.94 KB
/
MenuScreen.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module(..., package.seeall)
function new()
local localGroup = display.newGroup()
--> This is how we start every single file or "screen" in our folder, except for main.lua
-- and director.lua
--> director.lua is NEVER modified, while only one line in main.lua changes, described in that file
------------------------------------------------------------------------------
------------------------------------------------------------------------------
local ui = require("ui")
local background = display.newImage("erosion_title_image_02.png", 20, 40)
local state
local playBtnRelease = function( event )
print("gameScreen")
director:changeScene ("GameScreen", "fade")
end
local howToBtnRelease = function( event )
print("how to")
director:changeScene ("HowToScreen", "fade")
end
local highScoreBtnRelease = function( event )
print("high score")
director:changeScene ("HighScoreScreen", "fade")
end
playBtn = ui.newButton{
default = "redBtn.png",
over = "pressedRedBtn.png",
onRelease = playBtnRelease,
text = "Play Game",
id = "playBtn"
--emboss = true
}
howToBtn = ui.newButton{
default = "redBtn.png",
over = "pressedRedBtn.png",
onRelease = howToBtnRelease,
text = "How-To",
id = "howToBtn"
--emboss = true
}
highScoreBtn = ui.newButton{
default = "redBtn.png",
over = "pressedRedBtn.png",
onRelease = highScoreBtnRelease,
text = "High Scores",
id = "highScoreBtn"
--emboss = true
}
--[[ print(display.viewableContentHeight)
print(display.contentHeight)
print(display.contentWidth)
]]
playBtn.x = 240; playBtn.y = 220
howToBtn.x = 80; howToBtn.y = 300
highScoreBtn.x = 240; highScoreBtn.y = 380
localGroup:insert(background)
localGroup:insert(playBtn)
localGroup:insert(howToBtn)
localGroup:insert(highScoreBtn)
------------------------------------------------------------------------------
------------------------------------------------------------------------------
return localGroup
end