Advertisement
lavalevel

sheet_backgrounds

Aug 28th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.53 KB | None | 0 0
  1. --
  2. -- created with TexturePacker (http://www.codeandweb.com/texturepacker)
  3. --
  4. -- $TexturePacker:SmartUpdate:29c7e614e690668f3aae3eb8eed23ab1:1/1$
  5. --
  6. -- local sheetInfo = require("mysheet")
  7. -- local myImageSheet = graphics.newImageSheet( "mysheet.png", sheetInfo:getSheet() )
  8. -- local sprite = display.newSprite( myImageSheet , {frames={sheetInfo:getFrameIndex("sprite")}} )
  9. --
  10.  
  11. local SheetInfo = {}
  12.  
  13. SheetInfo.sheet =
  14. {
  15.     frames = {
  16.    
  17.         {
  18.             -- img_Backdrop1
  19.             x=2,
  20.             y=2,
  21.             width=80,
  22.             height=160,
  23.  
  24.         },
  25.         {
  26.             -- img_Backdrop2
  27.             x=2,
  28.             y=164,
  29.             width=80,
  30.             height=88,
  31.  
  32.             sourceX = 0,
  33.             sourceY = 72,
  34.             sourceWidth = 80,
  35.             sourceHeight = 160
  36.         },
  37.         {
  38.             -- img_darkmog1
  39.             x=84,
  40.             y=146,
  41.             width=80,
  42.             height=70,
  43.  
  44.             sourceX = 0,
  45.             sourceY = 7,
  46.             sourceWidth = 80,
  47.             sourceHeight = 160
  48.         },
  49.         {
  50.             -- img_darkmog2
  51.             x=166,
  52.             y=74,
  53.             width=80,
  54.             height=70,
  55.  
  56.             sourceX = 0,
  57.             sourceY = 7,
  58.             sourceWidth = 80,
  59.             sourceHeight = 160
  60.         },
  61.         {
  62.             -- img_darkmog3
  63.             x=84,
  64.             y=74,
  65.             width=80,
  66.             height=70,
  67.  
  68.             sourceX = 0,
  69.             sourceY = 7,
  70.             sourceWidth = 80,
  71.             sourceHeight = 160
  72.         },
  73.         {
  74.             -- img_darkmog4
  75.             x=166,
  76.             y=2,
  77.             width=80,
  78.             height=70,
  79.  
  80.             sourceX = 0,
  81.             sourceY = 7,
  82.             sourceWidth = 80,
  83.             sourceHeight = 160
  84.         },
  85.         {
  86.             -- img_darkmog5
  87.             x=84,
  88.             y=2,
  89.             width=80,
  90.             height=70,
  91.  
  92.             sourceX = 0,
  93.             sourceY = 7,
  94.             sourceWidth = 80,
  95.             sourceHeight = 160
  96.         },
  97.     },
  98.    
  99.     sheetContentWidth = 256,
  100.     sheetContentHeight = 256
  101. }
  102.  
  103. SheetInfo.frameIndex =
  104. {
  105.  
  106.     ["img_Backdrop1"] = 1,
  107.     ["img_Backdrop2"] = 2,
  108.     ["img_darkmog1"] = 3,
  109.     ["img_darkmog2"] = 4,
  110.     ["img_darkmog3"] = 5,
  111.     ["img_darkmog4"] = 6,
  112.     ["img_darkmog5"] = 7,
  113. }
  114.  
  115. function SheetInfo:getSheet()
  116.     return self.sheet;
  117. end
  118.  
  119. function SheetInfo:getFrameIndex(name)
  120.     return self.frameIndex[name];
  121. end
  122.  
  123. return SheetInfo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement