-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathship_explosion.lua
More file actions
63 lines (51 loc) · 1.19 KB
/
ship_explosion.lua
File metadata and controls
63 lines (51 loc) · 1.19 KB
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 - https://www.codeandweb.com/texturepacker
--
-- $TexturePacker:SmartUpdate:de14f4ea11e1b26c89a0bc189b384026:e42512f32628d9a0afe166ebb46dc20b:9c5fb3b1f6e1c7d6e8215568306651bf$
--
-- 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 = {
{
-- explosion_0
x=0,
y=0,
width=128,
height=128,
},
{
-- explosion_1
x=128,
y=0,
width=128,
height=128,
},
{
-- explosion_2
x=256,
y=0,
width=128,
height=128,
},
},
sheetContentWidth = 384,
sheetContentHeight = 128
}
SheetInfo.frameIndex =
{
["explosion_0"] = 1,
["explosion_1"] = 2,
["explosion_2"] = 3,
}
function SheetInfo:getSheet()
return self.sheet;
end
function SheetInfo:getFrameIndex(name)
return self.frameIndex[name];
end
return SheetInfo