Module:Sprite: Difference between revisions

Give me enchants or give me death
m (Back to trophy, from skull)
(Give me enchants or give me death)
Line 230: Line 230:
if settings.image then
if settings.image then
append("background", settings.image.url)
append("background", settings.image.url)
append("mask-image", settings.image.url)
end
end


append ("background-size", settings.sheetWidth * settings.scale .. 'px auto')
append ("background-size", settings.sheetWidth * settings.scale .. 'px auto')
append ("mask-size", settings.sheetWidth * settings.scale .. 'px auto')


local t = settings.size * settings.scale .. 'px'
local t = settings.size * settings.scale .. 'px'
Line 244: Line 246:
local top = math.floor( pos / settings.tiles ) * settings.size * settings.scale
local top = math.floor( pos / settings.tiles ) * settings.size * settings.scale
append("background-position", '-' .. left .. 'px -' .. top .. 'px')
append("background-position", '-' .. left .. 'px -' .. top .. 'px')
 
append("mask-position", '-' .. left .. 'px -' .. top .. 'px')


return table.concat( styles, "; " )
return table.concat( styles, "; " )
184

edits