-
Notifications
You must be signed in to change notification settings - Fork 0
/
piece.lua
82 lines (53 loc) · 1.92 KB
/
piece.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
72
73
74
75
76
77
78
79
80
81
82
-- 화면 클릭
local composer = require("composer")
local scene = composer.newScene()
local widget = require("widget")
local json = require("json")
local function ontreeRelease()
composer.showOverlay('piece')
return true -- indicates successful touch
end
function scene:create(event)
local sceneGroup = self.view
local textbox = display.newImageRect("ui/dialog.png", display.contentCenterX+630, display.contentHeight - 500)
textbox.x = 640
textbox.y = 610
local speaker = display.newText( "대관람차...", display.contentWidth * 0.45, display.contentHeight * 0.85, display.contentWidth - 180, 150)
speaker:setFillColor(0, 0, 0)
speaker.size = 43
speaker.alignX = "left"
local content = display.newText( "낡긴 했지만 그렇다고 이렇게 쓰러져버릴 줄이야. 이러면 사람들이 와도 대관람차를 탈 수 없어…", display.contentWidth * 0.45, display.contentHeight * 0.87, display.actualContentWidth - 180, -120)
content:setFillColor(0, 0, 0) -- Set the fill color to black
content.size = 37
content.alignX = "left"
function textbox:tap( event )
composer.hideOverlay('tree')
end
textbox:addEventListener("tap", textbox)
sceneGroup:insert(textbox)
sceneGroup:insert(speaker)
sceneGroup:insert(content)
end
function scene:show(event)
local sceneGroup = self.view
local phase = event.phase
if phase == "will" then
elseif phase == "did" then
end
end
function scene:hide(event)
local sceneGroup = self.view
local phase = event.phase
if event.phase == "will" then
elseif phase == "did" then
composer.removeScene("tree")
end
end
function scene:destroy(event)
local sceneGroup = self.view
end
scene:addEventListener("create", scene)
scene:addEventListener("show", scene)
scene:addEventListener("hide", scene)
scene:addEventListener("destroy", scene)
return scene