Documentation
¶
Overview ¶
Package svgimport turns an SVG drawing into map wall outlines, so a level's geometry can be drawn in Inkscape/Figma/Illustrator and imported instead of typed by hand.
The parser is adapted from kutta's stdlib-only foil/svg.go (same author). The difference is the coordinate handling: foil normalizes every shape into its [0,1] y-up ".dat" convention, whereas a Linefire map wants the drawing's own coordinates. The game world is Y-DOWN, exactly like SVG, so shapes import 1:1 with no flip and no rescale — what you draw is where it lands. Curves (cubic, quadratic, arc) are flattened to polylines, so a wall is always a plain polygon, which is all the collision/flood field needs.
Supported: path (M L H V C S Q T A Z and their relative forms), rect, circle, ellipse, polygon and polyline. Not interpreted: transform attributes, fill rules and strokes — flatten transforms in the editor before exporting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Centroid ¶
Centroid is the average of a shape's points — where a spawn marker drops its entity.