Module:SpriteFile: Difference between revisions

No edit summary
No edit summary
Line 43: Line 43:
local file = args.name .. ' ' .. id .. '.png'
local file = args.name .. ' ' .. id .. '.png'
local altText = file .. ': Sprite image for ' .. id .. ' in Minecraft'
if link ~= '' then
altText = altText .. ' linking to ' .. link
end
local sprite = mw.html.create( 'span' ):addClass( 'sprite-file' )
local sprite = mw.html.create( 'span' ):addClass( 'sprite-file' )
local img = '[[File:' .. file .. '|' .. size .. '|link=' .. link .. '|class=pixel-image|' .. ( args.title or '' ) .. ']]'
local img = '[[File:' .. file .. '|' .. size .. '|link=' .. link .. '|alt=' .. altText .. '|class=pixel-image|' .. ( args.title or '' ) .. ']]'
sprite:node( img )
sprite:node( img )