Module:SpriteTest

local p = {}

function p.test(frame) local root = mw.html.create('div') local sprite = mw.html.create( 'div' ) sprite:wikitext("") sprite:cssText(table.concat({"left:-" .. frame.args.size*frame.args.x .. "px", "top:-" .. frame.args.size*frame.args.y .. "px", "position: absolute"}, ';')) root:cssText(table.concat({"width: " .. frame.args.size .. "px", "height: " .. frame.args.size .. "px", "overflow: hidden", "position: relative"}, ';')) root:node(sprite) return tostring(root) end

return p