Module:Superposition

From Battlerite Royale Wiki
Jump to: navigation, search
{{#invoke:Superposition|main
|c1=
|c2=
|x2=
|y2=
|c3=
|x3=
|y3=
...}}
   c1: Base content
   c2, c3, c4 ...: Content to overlay, add as many as needed
   x1, x2, x3 ...: In pixels, x coordinate
   y1, y2, y3 ...: In pixels, y coordinate

local p = {}

function p.main(frame)
	local htmlOutput = ''
	if frame.args['c1'] or frame.args['c2'] then
		htmlOutput = '<span style="display:inline-block;position:relative;">'
		local i = 2
		while frame.args['c' .. i] ~= nil do
			htmlOutput = htmlOutput .. ('<span style="position:absolute;left:%spx;top:%spx;padding:0;">%s</span>'):format(
				frame.args['x' .. i] or '0', frame.args['y' .. i] or '0', frame.args['c' .. i])
			i = i + 1
		end
	end
	htmlOutput = htmlOutput .. (frame.args['c1'] or '') .. '</span>'
	return htmlOutput
end
return p