SVG images?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
mrguyman
Prole
Posts: 1
Joined: Sat Aug 07, 2010 2:01 pm

SVG images?

Post by mrguyman »

Does Love2D support vector graphics made in Inkscape?
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: SVG images?

Post by thelinx »

No.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: SVG images?

Post by bartbes »

Not in any vector format anyway.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: SVG images?

Post by Jasoco »

SVG is an open XML format. You might be able to write your own loader and reader, but it would take a lot of work.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: SVG images?

Post by Robin »

Lua tables are much simpler to make vector graphics with in LÖVE. If you want to use Inkscape to create graphics, you might find this interesting: http://github.com/gvx/space/tree/master/asseteditor/

It is a converter from SVG to Lua tables, written by CyaNox for (my game) Space. I have no idea how it works, but it does, so I'm happy. :P
Help us help you: attach a .love.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: SVG images?

Post by s-ol »

Robin wrote:Lua tables are much simpler to make vector graphics with in LÖVE. If you want to use Inkscape to create graphics, you might find this interesting: http://github.com/gvx/space/tree/master/asseteditor/

It is a converter from SVG to Lua tables, written by CyaNox for (my game) Space. I have no idea how it works, but it does, so I'm happy. :P
Note to self: try it, look for holes, host publicly for the rest of LÖVE

Edit: better yet, port to python. The actual implementation part is less than 20% of that (well done, but PHP) mess.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: SVG images?

Post by ivan »

Jasoco wrote:SVG is an open XML format. You might be able to write your own loader and reader, but it would take a lot of work.
A while ago, I wrote a lib that supports the basic SVG functionality (except for stroke, fill rules, gradients and textures):
viewtopic.php?f=5&t=78537&start=10#p181146
It's possible to support every SVG feature in Lua but it's slow and requires a lot of extra math.
For games, it's better to convert the SVGs to a more reasonable format and load that.
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: SVG images?

Post by Xgoff »

a few years ago i considered writing an svg-handling lib, but even svg tiny's spec is over 400 pages so i just went "nope"

this was also before Meshes were added to love so it probably would have not been the most pleasant thing to implement
User avatar
SiENcE
Party member
Posts: 805
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: SVG images?

Post by SiENcE »

Some time ago, I was also thinking about an SVG workflow for love2d.

When you want to support different resolutions, it's a pain to work with raster graphics.

During my research I found this:

SVG Path Extractor for Corona SDK in Lua Language
https://github.com/singularity-is-i/SVG-Path-in-Lua

Lua library for easy SVG generation
https://github.com/cappelnord/EzSVG

nanoSVG
https://github.com/memononen/nanosvg

nanoSVG seems to me the best choice, but you have to write a nativ plugin for Love or a Binding via FFI (LUaJit).
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests