Module:Sprite: Difference between revisions

comment out mask-image, mask-size, and mask-position, uncomment if we ever find out how to get cors to work, cry if not
(Give me enchants or give me death)
(comment out mask-image, mask-size, and mask-position, uncomment if we ever find out how to get cors to work, cry if not)
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)
-- 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')
-- append ("mask-size", settings.sheetWidth * settings.scale .. 'px auto')


local t = settings.size * settings.scale .. 'px'
local t = settings.size * settings.scale .. 'px'
Line 246: 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')
-- append("mask-position", '-' .. left .. 'px -' .. top .. 'px')


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

edits