-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtabShopScreen.lua
More file actions
80 lines (58 loc) · 2.15 KB
/
tabShopScreen.lua
File metadata and controls
80 lines (58 loc) · 2.15 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
module(..., package.seeall)
--====================================================================--
-- SCENE: GO FISHING SCREEN
--====================================================================--
--[[
- Version: [1.0]
- Made by: tsengvn
- Mail: nmhien88@gmail.com
******************
- INFORMATION
******************
--]]
function new()
------------------
-- Groups
------------------
local localGroup = display.newGroup()
-- begin create screen
local background = display.newImage("images/background/BackGround_forAll.png", true)
local header = display.newImage("images/Button_MainMenu_RiverSea_River_Selected.png", true)
local pic = display.newImageRect("images/Pic_S1.png", display.contentWidth , 250)
pic:setReferencePoint(display.TopLeftReferencePoint);
pic.y = header.height
pic.x = 0
local buttonRiver = display.newImageRect("images/Button_S1_RiverFishingGears.png", 100 , 50)
buttonRiver:setReferencePoint(display.TopLeftReferencePoint);
buttonRiver.x = display.contentWidth - 120
buttonRiver.y = 83
buttonRiver.id = 1
local buttonSea = display.newImageRect("images/Button_S1_SeaFishingGears.png", 100 , 50)
buttonSea:setReferencePoint(display.TopLeftReferencePoint);
buttonSea.x = display.contentWidth - 120
buttonSea.y = buttonRiver.y + buttonRiver.height + 15
buttonSea.id = 2
local buttonTicket = display.newImageRect("images/Button_S1_Tickets.png", 100 , 50)
buttonTicket:setReferencePoint(display.TopLeftReferencePoint);
buttonTicket.x = display.contentWidth - 120
buttonTicket.y = buttonSea.y + buttonSea.height + 15
buttonTicket.id = 3
local function clickButton(event)
if ( event.phase == "began" ) then
elseif ( event.phase == "ended") then
print("clickButton " .. event.target.id)
gotoShopListEquipmentScreen()
end
end
buttonRiver:addEventListener("touch", clickButton)
buttonSea:addEventListener("touch", clickButton)
buttonTicket:addEventListener("touch", clickButton)
localGroup:insert(background)
localGroup:insert(header)
localGroup:insert(pic)
localGroup:insert(buttonRiver)
localGroup:insert(buttonSea)
localGroup:insert(buttonTicket)
-- end create screen
return localGroup
end