-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbg_sheets.lua
63 lines (51 loc) · 1.18 KB
/
bg_sheets.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
--
-- created with TexturePacker (http://www.codeandweb.com/texturepacker)
--
-- $TexturePacker:SmartUpdate:2e8d87be9edf34ba9075dce14433b860:dcd0cb5cdea192ab4bf4e9e373875b44:befb12fafd6522eddf773d8ec8fb1765$
--
-- 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 = {
{
-- bg_blue1
x=2,
y=2,
width=320,
height=480,
},
{
-- bg_blue2
x=324,
y=2,
width=320,
height=480,
},
{
-- bg_blue3
x=646,
y=2,
width=320,
height=480,
},
},
sheetContentWidth = 968,
sheetContentHeight = 484
}
SheetInfo.frameIndex =
{
["bg_blue1"] = 1,
["bg_blue2"] = 2,
["bg_blue3"] = 3,
}
function SheetInfo:getSheet()
return self.sheet;
end
function SheetInfo:getFrameIndex(name)
return self.frameIndex[name];
end
return SheetInfo