Repository navigation
Expand file tree
/
Copy pathview01_guide.lua
More file actions
249 lines (211 loc) · 6.4 KB
/
Copy pathview01_guide.lua
File metadata and controls
249 lines (211 loc) · 6.4 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
--튜토리얼 장면 1부터 7
local loadsave = require( "loadsave" )
local composer = require( "composer" )
local scene = composer.newScene()
local widget = require("widget")
local json = require( "json" )
local objectsToDestroy = {}
local function fitFullBleed(image)
local scale = math.max(
display.actualContentWidth / image.width,
display.actualContentHeight / image.height
)
image.xScale = scale
image.yScale = scale
image.x = display.screenOriginX + display.actualContentWidth * 0.5
image.y = display.screenOriginY + display.actualContentHeight * 0.5
return image
end
function scene:create( event )
local sceneGroup = self.view
local loadedSettings = loadsave.loadTable( "settings.json" )
local image = display.newImage("이미지/(신)튜토리얼/0_6-2/" .. 0 .. ".png")
fitFullBleed(image)
image:toBack()
image.alpha = 0
sceneGroup:insert(image)
table.insert(objectsToDestroy, image)
local image1 = display.newImage("이미지/(신)튜토리얼/0_6-2/" .. 0 .. ".png")
fitFullBleed(image1)
image1:toBack()
table.insert(objectsToDestroy, image1)
local startBt = display.newImage("이미지/(신)튜토리얼/start버튼.png")
startBt.x,startBt.y = display.contentWidth * 0.69, display.contentHeight * 0.42
startBt.alpha = 1
sceneGroup:insert(startBt)
table.insert(objectsToDestroy, startBt)
local skipBt = display.newImage("이미지/(신)튜토리얼/skip버튼.png")
skipBt.x,skipBt.y = display.contentWidth * 0.84, display.contentHeight * 0.42
skipBt.alpha = 1
sceneGroup:insert(skipBt)
table.insert(objectsToDestroy, skipBt)
-- finger animation
local sheetOptions =
{
width = 300,
height = 300,
numFrames = 18,
sheetContentWidth=1800, sheetContentHeight=900
}
local fingerMotion = graphics.newImageSheet("이미지/(신)튜토리얼/손가락.png",sheetOptions)
local sequencesFinger = {
name = "finger",
start = 1,
count = 17,
time = 1000,
loopCount = 0,
loopDirection = "forward"
}
local finger = display.newSprite(fingerMotion,sequencesFinger)
finger.anchorX,finger.anchorY = 0,0
finger.x, finger.y = 1169.13+140,56.63 + 200
finger.alpha = 0
sceneGroup:insert(finger)
table.insert(objectsToDestroy, finger)
finger:play()
finger.rotation = 270
--finger location & rotation--
local fingerLocation = {
{56.75 - 100 ,890.24 - 250 }, -- 앨범 아이콘
{1031.57 - 250 ,405.87 + 250}, -- 앨범 블리
{190.53 - 100,890.97 - 250}, -- 설정 아이콘
{1395.39 + 330,201.72 - 120}, -- 오디오 설정 x버튼
{87 + 800,30}, -- 스탯창
{87 + 800,30}, -- 스탯창
{1169.13 + 600,56.63 + 180}, -- 달력
{1169.13+140,56.63 + 200}, -- 코인창
{1470.7 - 100,891.34 - 250} -- 스케줄 아이콘
}
local isFinger = {
1,1,0,1,0,
1,1,1,0,0,
1,1,0,0,1,
0,0
}
local fingerRotation = {
360, -- 아래
270, -- 오른쪽,
360,
90, -- 왼쪽
90,
90,
90,
270,
360
}
--투명 유령버튼 코드
local ghost_button = display.newImage("이미지/(신)튜토리얼/투명버튼.png")
sceneGroup:insert(ghost_button)
table.insert(objectsToDestroy, ghost_button)
local isButton = {
1,1,0,1,0,
1,0,0,0,0,
0,0,0,0,1,
0,0
}
local buttonLocation = {
{56.75 - 100 ,890.24 - 250 + 500 }, -- 앨범 아이콘
{1031.57 - 250 + 500 ,405.87 + 250}, -- 앨범 블리
{190.53 - 100,890.97 - 250 + 500 }, -- 설정 아이콘
{1395.39 + 330 - 500,201.72 - 120}, -- 오디오 설정 x버튼
{1470.7 - 100,891.34 - 250 + 500} -- 스케줄 아이콘
}
local index = 0
local i = 1
--유령버튼 인덱스
local gi = 1
local function nextScript(event)
if(index==0) then
startBt.alpha = 0
skipBt.alpha = 0
image.alpha=1
ghost_button:addEventListener("tap",nextScript)
end
index = index +1
if(index > 17) then
ghost_button:removeEventListener("tap",nextScript)
sceneGroup = nil
composer.removeScene("view01_guide")
composer.gotoScene("view01_guide2")
end
if(isFinger[index]==1) then
finger.alpha = 1
finger.x, finger.y = fingerLocation[i][1], fingerLocation[i][2]
finger.rotation = fingerRotation[i]
i = i+1
else
finger.alpha = 0
end
--유령버튼코드
if(isButton[index]==1) then
ghost_button.x, ghost_button.y = buttonLocation[gi][1], buttonLocation[gi][2]
gi = gi+1
if(isButton[index-1]== 0) then
ghost_button:scale( 0.2, 0.2)
end
else
ghost_button.x, ghost_button.y = display.contentWidth/2,display.contentHeight/2
if(isButton[index-1]~= 0) then
ghost_button:scale( 5, 5)
end
end
image.fill = {
type = "image",
filename = "이미지/(신)튜토리얼/0_6-2/" .. index .. ".png"
}
end
local function goRoom(event)
ghost_button:removeEventListener("tap",nextScript)
composer.removeScene("view01_guide")
composer.gotoScene("view01_month")
end
startBt:addEventListener("tap",nextScript)
skipBt:addEventListener("tap",goRoom)
end
local function destroyObjects()
for i = 1, #objectsToDestroy do
display.remove(objectsToDestroy[i])
objectsToDestroy[i] = nil
end
objectsToDestroy = nil
end
function scene:show( event )
local sceneGroup = self.view
local phase = event.phase
if phase == "will" then
-- Called when the scene is still off screen and is about to move on screen
elseif phase == "did" then
-- Called when the scene is now on screen
--
-- INSERT code here to make the scene come alive
-- e.g. start timers, begin animation, play audio, etc.
end
end
function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase
if event.phase == "will" then
-- Called when the scene is on screen and is about to move off screen
--
-- INSERT code here to pause the scene
-- e.g. stop timers, stop animation, unload sounds, etc.)
elseif phase == "did" then
-- Called when the scene is now off screen
end
end
function scene:destroy( event )
local sceneGroup = self.view
destroyObjects()
-- Called prior to the removal of scene's "view" (sceneGroup)
--
-- INSERT code here to cleanup the scene
-- e.g. remove display objects, remove touch listeners, save state, etc.
end
---------------------------------------------------------------------------------
-- Listener setup
scene:addEventListener( "create", scene )
scene:addEventListener( "show", scene )
scene:addEventListener( "hide", scene )
scene:addEventListener( "destroy", scene )
-----------------------------------------------------------------------------------------
return scene