LibSVG-1.0
LibSVG is a library for rendering and, to some extent, manipulation of Scalable Vector Graphics in WoW. If you're just interested in trying out LibSVG without having to implement it in an addon first, try RenderMon!
Element support:
- Objects:
- rect
- circle
- ellipse
- polygon
- polyline
- line (via polyline)
- path (
A/a, C/c, L/l, M/m, S/s, Q/q, Z/z
)
- Transformations
- Matrix(
a,b,c,d,e,f
) - Translate(
x[, y]
) - Scale(
x[, y]
) - Rotate(
angle[, cx, cy]
) - SkewX(
angle
) - SkewY(
angle
)
- Matrix(
- Styles:
- stroke (name of color or
#rgb
,#rrggbb
,rgb(rrr,ggg,bbb)
) - stroke-width (in pixels)
- stroke-opacity
- fill (name of color or
#rgb
,#rrggbb
,rgb(rrr,ggg,bbb)
) - fill-opacity
- linear gradients (only basic support)
- stroke (name of color or
Usage
local libsvg = LibStub("LibSVG-1.0"); local myImage = libsvg:New(); myImage:Parse("xml data as a string"); -- or you could use: -- local xml = LibXML:Import("xml data here"); -- myImage:Parse(xml); myImage:Compile(); -- Compiles the SVG into texture commands for drawing local frame = myImage:Render(); -- Renders the compiled image and returns the canvas frame.
Well, I'm impressed. I often wished WoW's textures supported vector drawing commands, and this looks nearly as capable.