I’m looking for a way to import and work with vector graphics.
I was thinking about buying SVG Importer but after reading some reviews from this year it looks like they don’t support it properly anymore and the tool seems to have its flaws.
So my question is if those of you working with vector graphics can recommend some plugin worth spending money for.
I bought SVG 2 month ago and I asked Unity to give me my money back because SVG has lots of bugs.
I don’t know about alternatives, no one has made any thing like that, even Unity doesn’t provide vector graphics. So I think the only way is to leave Unity and program your own game engine.
I saw an extension that can import SVG files called RageTools. But it was last updated in 2015.
Another option would be to use a tool that allows to create vector-like graphics inside of Unity. I’m working on an extension like this: ProtoShape 2D. It doesn’t have as much options and flexibility as dedicated vector editors though but I plan to keep adding them.
I’m looking for c# code that allows the user to draw their own SVG dynamically.
In ActionScript 3.0 it was simple.
I was able to create all my 8 bit vector graphics with code.
I think c# would nee me to create an array of coordinates first, then put them into the instructions to draw a shape.
It’s never easy getting information. I’ll never understand why it’s so hard to get decent references.
private var lever_0_0_0:Sprite = new Sprite();
private var _lever_0_0_0:Graphics = lever_0_0_0.graphics;
You seem to be confusing some concepts. It’s not “ActionScript 3.0” that made it simple to create vector graphics with code, it was Flash. Because it was made to do that. ActionScript is simply a language used to program Flash and use a vector drawing API. Likewise, C# is a language, not a graphics API, and a generic C# book will not help. You would need an underlying engine or library to do that, and the language isn’t relevant.
Unity does have their own SVG package which works with Unity 2018 and later, which can import SVG files or create vector graphics on the fly with code. There’s some information about the API in the Unity docs.
Yes, it took banging my head against a wall (figuratively) for a few days to realize that Unity uses meshes made with triangles rather than scalable vector graphics. I would have to learn a lot more about creating my own class to add this functionality to Unity. But I think I can manage to create meshes with coordinates almost the same way I would create an SVG. Now, I wonder if there’s an easy way to get the vertices of a mesh as a list from a mesh I import into Unity.
What I’m actually trying to do is create these meshes dynamically. I don’t know enough about Unity, but through trial and error I did figure out that my Flash game would benefit from quicker processing speeds when I wrote code to represent the sprites rather than count on external vector files. I’m not sure I’m making myself clear, but if you think you understand my meaning and you have a solution to offer then please do.
Okay, this is all still new to me… but I’m exploring my options. I already appreciate how easy Unity is to use, and the response time of the community in answering my questions. The quicker I can understand what I need to do the sooner I’ll have games out for everyone to enjoy.
I really need this, so I can leave the town I reside in and start my life without having to worry about government support.
Well, from what I understand this class is very limited. I don’t actually need to animate the sprites using a rig. But I’m worried that I won’t be able to animate using a series of frames. This is all new to me, I’m exploring my options currently. I don’t want to spend months researching and trying things like I had to in Flash with ActionScript 3.0.
I always find that learning to write in a new language is an ordeal.
So, I have to ask now, how do I interpret this information?
I would like to write what’s necessary to draw my Super Mario sprite dynamically (as a test don’t get excited - copyright).
I’ve found a way to extract the vertices coordinates from my original svg file.
When I try to make a simple Bézier or line I try creating an array like they show here in the example but it won’t take integers and it won’t accept floats.
Should I maybe create variables of some kind? What am I doing wrong?
Well, if you’re looking to use SVG graphics to create pixels, you’re probably doing it wrong. It’s entirely possible to take this approach, but it is also kind of a waste. The benefit of using Vector-based graphics is in making smooth, scale-able graphics with clean, smooth lines. Low-resolution pixel-based graphics fly in the face of this.
To be honest, you would probably be better off trying to “convert” these graphics into basic 3D models. Polygons are not as expensive as they used to be, and most “vector” drawing in Unity really boils down to 3D models anyway. It would even be possible to optimize them somewhat to take up the lowest possible number of polygons. This isn’t exactly the typical approach for these kinds of graphics, but it would work, and it would provide certain advantages.
But you see, I really would like to create these images dynamically.
When I import an svg file I have to break it up into 3 different files. It’s just so complicated for nothing.
And I have used Blender to make these vector graphics into 3D meshes as a test but I’m not satisfied with that.
I want to take the coding approach. So please, how do I interpret the API reference where drawing a simple vector shape is concerned?
I found a way to do this in the past writing in ActionScript 3.0.
The structure made sense to me. I don’t understand how this works in C#. What elements do I need to setup?
using Unity.VectorGraphics;
an array…
something to a shape with…
I was expecting these instructions to be straight forward. Why the mystery?
Cause I don’t enjoy melting my brain like a grilled cheese sandwich.
Or how does one go about tesselating a scene when creating vector graphics?
Isn’t there a simple guide?
Why is coding in Unity a secret?
I can throw graphics into the program, they’ll work well enough. But I’m not interested in taking this approach because laziness is not my goal.
What I want is control. That’s why I need to write this rather than just use the simple U.I…