Loading

Paste #p06x3z2hw

  1. function Graphics:loadAnimations(dir, prefix)
  2.   if self.cache.anims[prefix] then
  3.     return self.cache.anims[prefix]
  4.   end
  5.  
  6.   local sheet = self:loadSpriteTable(dir, prefix .. "Spr-0")
  7.   local anims = TH.anims()
  8.   print(anims)
  9.   anims:setSheet(sheet)
  10.   if not anims:load(
  11.   self.app:readDataFile(dir, prefix .. "Start-1.ani"),
  12.   self.app:readDataFile(dir, prefix .. "Fra-1.ani"),
  13.   self.app:readDataFile(dir, prefix .. "List-1.ani"),
  14.   self.app:readDataFile(dir, prefix .. "Ele-1.ani"))
  15.   then
  16.     error("Cannot load animations " .. prefix)
  17.   end
  18.  
  19.   self.cache.anims[prefix] = anims
  20.   self.load_info[anims] = {self.loadAnimations, self, dir, prefix}
  21.   return anims
  22. end

Comments