-
Notifications
You must be signed in to change notification settings - Fork 0
/
explode.lua
127 lines (111 loc) · 2.44 KB
/
explode.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
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
--
-- created with TexturePacker (http://www.codeandweb.com/texturepacker)
--
-- $TexturePacker:SmartUpdate:65b024c4afff77dd116965c0002af2d8:684b9da14362ff215852eefb0e3b3e2c:ab75e8734710b0ef28fe41421e861e3f$
--
-- local sheetInfo = require("mysheet")
-- local myImageSheet = graphics.newImageSheet( "mysheet.png", sheetInfo:getSheet() )
-- local sprite = display.newSprite( myImageSheet , {frames={sheetInfo:getFrameIndex("sprite")}} )
--
local SheetInfo = {}
SheetInfo.sheet =
{
frames = {
{
-- 1
x=165,
y=67,
width=36,
height=40,
sourceX = 32,
sourceY = 21,
sourceWidth = 104,
sourceHeight = 104
},
{
-- 2
x=57,
y=69,
width=46,
height=44,
sourceX = 27,
sourceY = 16,
sourceWidth = 104,
sourceHeight = 104
},
{
-- 3
x=1,
y=69,
width=54,
height=52,
sourceX = 22,
sourceY = 12,
sourceWidth = 104,
sourceHeight = 104
},
{
-- 4
x=105,
y=67,
width=58,
height=58,
sourceX = 19,
sourceY = 9,
sourceWidth = 104,
sourceHeight = 104
},
{
-- 5
x=161,
y=1,
width=66,
height=64,
sourceX = 15,
sourceY = 5,
sourceWidth = 104,
sourceHeight = 104
},
{
-- 6
x=85,
y=1,
width=74,
height=64,
sourceX = 10,
sourceY = 8,
sourceWidth = 104,
sourceHeight = 104
},
{
-- 7
x=1,
y=1,
width=82,
height=66,
sourceX = 5,
sourceY = 12,
sourceWidth = 104,
sourceHeight = 104
},
},
sheetContentWidth = 228,
sheetContentHeight = 126
}
SheetInfo.frameIndex =
{
["1"] = 1,
["2"] = 2,
["3"] = 3,
["4"] = 4,
["5"] = 5,
["6"] = 6,
["7"] = 7,
}
function SheetInfo:getSheet()
return self.sheet;
end
function SheetInfo:getFrameIndex(name)
return self.frameIndex[name];
end
return SheetInfo