Module:Sprite: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 14: Line 14:
local cellWidth = sheetWidth / noOfColumns
local cellWidth = sheetWidth / noOfColumns
local cellHeight = sheetHeight / noOfRows
local cellHeight = sheetHeight / noOfRows
local outline = tonumber(frame.args['outline'])
local outline = frame:getArgument('outline')
local outlineCss
local imageClass
if outline == 1 then
if outline ~= nil then
outlineCss = "drop-shadow(0.5px 0.5px 0 black) drop-shadow(-0.5px -0.5px 0 black) drop-shadow(-0.5px 0.5px 0 black) drop-shadow(0.5px -0.5px 0 black)"
imageClass = "pixelart blackstroke"
else
else
outlineCss = ""
imageClass = "pixelart"
end
end
local span = mw.html.create('span')
local span = mw.html.create('span')
Line 28: Line 28:
overflow = 'hidden',
overflow = 'hidden',
display = 'inline-block',
display = 'inline-block',
['vertical-align'] = 'middle'
['vertical-align'] = 'middle',
['--blackstroke-color'] = outline
})
})
:tag('span')
:tag('span')