-
Notifications
You must be signed in to change notification settings - Fork 0
/
mystBox.lua
72 lines (59 loc) · 1.27 KB
/
mystBox.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
--
-- created with TexturePacker (http://www.codeandweb.com/texturepacker)
--
-- $TexturePacker:SmartUpdate:28edeb2d895b6a8d8471cdf0664a0632:2383e9fbd458a3b63a458939abe5817e:f1bced9571060f1d11600fe6b7434e80$
--
-- 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=1,
y=1,
width=104,
height=104,
},
{
-- 2
x=107,
y=1,
width=104,
height=104,
},
{
-- 3
x=213,
y=1,
width=104,
height=104,
},
{
-- 4
x=319,
y=1,
width=104,
height=104,
},
},
sheetContentWidth = 424,
sheetContentHeight = 106
}
SheetInfo.frameIndex =
{
["1"] = 1,
["2"] = 2,
["3"] = 3,
["4"] = 4,
}
function SheetInfo:getSheet()
return self.sheet;
end
function SheetInfo:getFrameIndex(name)
return self.frameIndex[name];
end
return SheetInfo