Module:Sprite: Difference between revisions

uncomment out mask-image, mask-size, and mask-position
(Add Gm4RPSprite, which changes only the icons, but keeps gm4 aliases)
(uncomment out mask-image, mask-size, and mask-position)
Line 231: Line 231:
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 247: Line 247:
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