multimaze/utils/svg_writer.lua

21 lines
719 B
Lua
Raw Normal View History

2020-09-27 00:37:10 +00:00
local M = {}
function M.start(width, height)
return "<?xml version=\"1.0\" encoding=\"utf-8\"?>\
<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\
<!-- Generated by svg_writer which was written by Starbeamrainbowlabs -->\
<!-- svg_writer is a port of SvgWriter, which was also implemented by Starbeamrainbowlabs in C# -->\
<svg version=\"1.1\" x=\"0\" y=\"0\" width=\""..width.."\" height=\""..height.."\" xmlns=\"http://www.w3.org/2000/svg\">"
end
function M.finish()
return "</svg>"
end
function M.rect(x, y, width, height, fill)
return "<rect x=\""..x.."\" y=\""..y.."\" width=\""..width.."\" height=\""..height.."\" fill=\""..fill.."\" />"
end
return M