Module:Sprite: Difference between revisions

28 bytes removed ,  29 May 2022
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 12: Line 12:
local col = tonumber(frame.args['col']) - 1
local col = tonumber(frame.args['col']) - 1
local image = frame.args['image']
local image = frame.args['image']
local imagePath = frame:callParserFunction{ name = 'filepath', args = image }
local link = frame.args['link']
local cellWidth = sheetWidth / noOfColumns
local cellWidth = sheetWidth / noOfColumns
local cellHeight = sheetHeight / noOfRows
local cellHeight = sheetHeight / noOfRows
local outline = frame.args['outline']
local outline = frame:getArgument('outline')
local imageClass
local imageClass
if outline ~= '' then
if outline ~= nil then
imageClass = "pixelart blackstroke"
imageClass = "pixelart blackstroke"
else
else
Line 31: Line 29:
display = 'inline-block',
display = 'inline-block',
['vertical-align'] = 'middle',
['vertical-align'] = 'middle',
['--blackstroke-color'] = outline
['--blackstroke-color'] = ""
})
})
:tag('span')
:tag('span')
Line 41: Line 39:
left = tostring((offsetX - cellWidth * col) * ratio) .. 'px'
left = tostring((offsetX - cellWidth * col) * ratio) .. 'px'
})
})
:allDone()
:wikitext(string.format('[[%s|%dpx|class=pixelart]]', image, sheetWidth * ratio))
:done()
return tostring(span)
return tostring(span)
end
end


return p
return p