Page 1 of 1
Fun Widget: SVG Draw
Posted: 13 Aug 2013, 00:18
by CarRepairer
- Get the widget https://github.com/wagonrepairer/spring ... vgdraw.lua
- Put SVG images in luaui/images/svgdraw (Here's an example file - unzip it).
- Convert objects to paths. (Using Inkscape, Path > Object to Path )
- NO longer needed -
Convert curves to line segments. (Using Inkscape, Extensions > Modify Paths > Flatten Beziers)
- In the game, type A list of your image names will show in the console, numbered from 1 to 9.
- Position the mouse cursor and hit the key on your number pad corresponding to the image you wish to draw.
- Fun.
Provided as a service I will describe how to convert a raster image (bmp, png, etc) to SVG using Inkscape. Once you do so you can proceed to the steps above.
- Drag and drop your image into a new SVG file.
- Path > Trace Bitmap
- Uncheck Smooth, check Remove background.
- Under Options, uncheck smooth corners.
- Click on Update.
- Delete the original raster image.
Edit: Updated to version 0.004.
Works without chili util header now.
Works directly on units now.
Using bezier flattening by hokomoko.
Re: Fun Widget: SVG Draw
Posted: 13 Aug 2013, 00:45
by smoth
is the svg drawn? or does it use the spring lines? it looks like the gnu is on top of the units on the right side
Re: Fun Widget: SVG Draw
Posted: 13 Aug 2013, 04:10
by FLOZi
smoth wrote:is the svg drawn? or does it use the spring lines? it looks like the gnu is on top of the units on the right side
Spring lines hence the bezier to line segment conversion.
Re: Fun Widget: SVG Draw
Posted: 14 Aug 2013, 02:57
by Silentwings
I get Inkscape saying 'No object in selection to convert to path, even though I have my whole image selected" ... any ideas?
Re: Fun Widget: SVG Draw
Posted: 10 Oct 2013, 18:32
by CarRepairer
Silentwings wrote:I get Inkscape saying 'No object in selection to convert to path, even though I have my whole image selected" ... any ideas?
Then skip that step, it's not needed for your svg.
Re: Fun Widget: SVG Draw
Posted: 29 Oct 2013, 21:13
by CarRepairer
Not just for fun, but for other stuff too! (SVG attached as zip).

Re: Fun Widget: SVG Draw
Posted: 29 Oct 2013, 22:18
by PicassoCT
Default Picture Library?
Re: Fun Widget: SVG Draw
Posted: 20 May 2016, 17:30
by CarRepairer
Got a bezier flattening function from hokomoko. This saves you a step in the setup and potentially hundreds of megabytes by keeping your SVGs smaller. Updated widget, placed on github and updated first post.