-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.lua
More file actions
60 lines (44 loc) · 1.21 KB
/
menu.lua
File metadata and controls
60 lines (44 loc) · 1.21 KB
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
module (..., package.seeall)
local director = require ("director")
local ui = require("ui")
local easyfb = require("easyfb")
local globalLayer = display.newGroup()
local _H = display.contentHeight
local _W = display.contentWidth
function playGame()
director:changeScene("level1", "fade")
end
function facebook()
local messageTopost = "I'm playing Central Defence on my iPhone! Download it from the appStore and beat my highscore!"
easyfb.publishOnFacebook(messageTopost)
end
function new()
local background = display.newImage("background.png")
globalLayer:insert(background)
background.x = _W/2
background.y = _H/2
background:scale(1.5, 1.5)
local title = display.newImage("title.png")
title.x = _W/2
title.y = _H/2 - 100
globalLayer:insert(title)
local playButton = ui.newButton {
default = "playoff.png",
over = "playon.png",
onPress = playGame
}
local fbButton = ui.newButton {
default = "fboff.png",
over = "fbon.png",
onPress = facebook
}
globalLayer:insert(playButton)
globalLayer:insert(fbButton)
playButton.x = _W/2
playButton.y = _H/2 + 110
playButton:scale(1.3, 1.3)
fbButton.x = _W + 140
fbButton.y = _H - 50
--fbButton:scale(1.3, 1.3)
return globalLayer
end