I needed SVGs for my game, so I wrote a simple SVG parser, but I'd happily add more features in the future (I'm only having trouble *filling* complex shapes, since I can't use the löve-native triangulate function for that)
https://github.com/Bananicorn/lvg
Have a look and tell me what features you'd need for your projects!
LVG - Loveable vector graphics ;)
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: LVG - Loveable vector graphics ;)
What license is this available under. I recommend MIT. Also I might use this in my project.
Re: LVG - Loveable vector graphics ;)
It's a good start. I've written similar things in the past, but it's hard to support all of the features from the SVG format.
My suggestion would be to separate the rendering from the parser so there is no "love." code in the project.
Anyways good luck!
My suggestion would be to separate the rendering from the parser so there is no "love." code in the project.
Anyways good luck!
-
- Prole
- Posts: 37
- Joined: Thu Apr 12, 2018 9:59 am
Re: LVG - Loveable vector graphics ;)
As it stands, I simply forgot to add a license - whoopsbobbyjones wrote: ↑Thu Oct 11, 2018 2:14 am What license is this available under. I recommend MIT. Also I might use this in my project.
I guess I'd go for the zlib license, like Löve itself.
I'll add a license file right now, so you can safely use it for whatever you use Löve itself
Edit:
zlib license added!
Btw, feel free to tell me what you think would be the next most important feature to be added, the list is so long, I can barely decide
Last edited by Bananicorn on Wed Oct 24, 2018 3:06 pm, edited 1 time in total.
-
- Prole
- Posts: 37
- Joined: Thu Apr 12, 2018 9:59 am
Re: LVG - Loveable vector graphics ;)
Thanks!
I actually stumbled upon your library just today, while researching a problem I encountered.
I didn't pay too much attention to sepearating parsing from rendering, because I'm already using love.math.newBezierCurve in my parser and I didn't want to code my own implementation, which would have ended up much slower and more error-prone^^
That being said, it would certainly be much cleaner and more reuseable if I did that, maybe I'll have a look at how you handled Beziers in your library
I'm definitely gonna take some inspiration from you - if I actually *steal* a piece of code, I'm gonna credit you of course
Re: LVG - Loveable vector graphics ;)
Thanks Bananicorn, sure be my guest. My code is an interesting experiment of what can be done in pure Lua, but only useful for education purposes:
viewtopic.php?f=5&t=78537&start=20#p195245 (requires an old version of Love2D)
I wrote a software implementation for Bezier curves, it was not very good (in particular, estimating the length of the curves needs work). BTW, there are much harder problems to tackle in pure Lua like triangulation, stroke, fill rules, gradients, etc. So yea, perhaps you're better off using Love2D's built-in functionality.
Good luck!
viewtopic.php?f=5&t=78537&start=20#p195245 (requires an old version of Love2D)
I wrote a software implementation for Bezier curves, it was not very good (in particular, estimating the length of the curves needs work). BTW, there are much harder problems to tackle in pure Lua like triangulation, stroke, fill rules, gradients, etc. So yea, perhaps you're better off using Love2D's built-in functionality.
Good luck!
Who is online
Users browsing this forum: Bing [Bot] and 2 guests