-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
58 lines (49 loc) · 1.39 KB
/
main.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
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------
-- Import widget.
local widget = require("widget")
display.setDefault("background", 245 / 255, 245 / 255, 220 / 255)
-- The internal counter.
local count = 0
-- Init the text.
local text = display.newText({
text = count .. " click",
x = display.contentCenterX,
y = display.contentHeight * 0.5,
fontSize = 24,
})
-- Set the color of the text.
text:setFillColor(0 / 255, 0 / 255, 0 / 255)
-- Declare the listener of the button.
local function btnListener(event)