Module:Sprite: Difference between revisions

Jump to navigation Jump to search
this should allow for changing sizes of spritesheets, it also may just break everything.
(fix slight mistake that broke aliases)
(this should allow for changing sizes of spritesheets, it also may just break everything.)
Line 170: Line 170:
self:setPosition(self.__source.ids[itemName].pos)
self:setPosition(self.__source.ids[itemName].pos)
if self.__source.ids[itemName].spriteSheet then
if self.__source.ids[itemName].spriteSheet then
-- self.__settings.image = getSpriteSheet(self.__source.ids[itemName].spriteSheet)
                local newSettings = require(types[self.__source.ids[itemName].spriteSheet]).settings
                 self.__settings.classname = require(types[self.__source.ids[itemName].spriteSheet]).settings.classname
                 self.__settings.classname = newSettings.classname
                self.__settings.size = newSettings.size
                self.__settings.tiles = newSettings.sheetsize / newSettings.size
                self.__settings.scale = newSettings.scale
                self.__settings.autoScale = newSettings.autoscale
end
end
end
end
Line 180: Line 184:
self:setPosition(self.__source.ids[item].pos)
self:setPosition(self.__source.ids[item].pos)
if self.__source.ids[item].spriteSheet then
if self.__source.ids[item].spriteSheet then
            -- self.__settings.image = getSpriteSheet(self.__source.ids[item].spriteSheet)
              local newSettings = require(types[self.__source.ids[item].spriteSheet]).settings
            self.__settings.classname = require(types[self.__source.ids[item].spriteSheet]).settings.classname
              self.__settings.classname = newSettings.classname
              self.__settings.size = newSettings.size
              self.__settings.tiles = newSettings.sheetsize / newSettings.size
              self.__settings.scale = newSettings.scale
              self.__settings.autoScale = newSettings.autoscale
         end
         end
else
else
184

edits

Navigation menu