Vector graphics

Is there a plugin or any plans to create a plugin for vector graphics in Corona? It would help make the SDK so much better because you wouldn’t have to use huge images for very simple images that you just want to scale up and down a lot.

Anyone willing to create this for payment or are there plans to make this and submit it to the store?

Would really appreciate all the help possible.

Thanks!

I know several people are working on an SVG plugin. We have the facilities in place that let people write native C code to create a bitmap and turn it into a texture that can be applied to display objects. A plugin that supports animated gif’s for example went into the Marketplace last week that uses this technology.  See: https://marketplace.coronalabs.com/plugin/impack

Rob

Great, is there any status on the SVG plugins and will they be possible with Corona without severe performance issues?

Is there anyone we can get in touch with to find out more or a website we can visit?

Is our use case possible to even achieve with Corona? We are basically wanting to display country flags in our app at a very large scale (up to 4000x4000 per country in some instances), and perhaps 10-15 countries might show on screen at a time. We wanted to use vector images so that way we can load in a smaller image and then scale it up without having to display extremely large bitmaps. Is this even possible to achieve and could an SVG plugin perhaps be the fix for that?

Any where we can find out more about this Rob? Thanks for the fast response!

I’m just hearing rumors about people working on SVG.

At the end of the day, you still have to manage your texture sizes. Vector images will be converted to bitmap pixels before it can become a texture and you still have to honor the texture memory rules. On quite a few visits that’s still going to be 2048x2048.

Rob

I am pretty sure impack handles svg.

Oh great!

Hmm alright. Dang it. Ok. Will give impack a go and see if we can manage with that, but we were looking to use vector graphics to circumvent the texture limits. It seems like we misunderstood the way things work and the 2048x2048 will always apply due to the way the SDK works.

We’ll look and see if we can make it work with the rules.

Thanks again for all the help!

Hi.

To expand on what Scott said, SVG-loading is found among the Spot support in impack (which I consider a work-in-progress / “2.0” feature at this point): Spot image The file will be loaded as a conventional image comprising RGBA pixels, though, so while it should save on disk space, from what you describe RAM / VRAM might still be an issue once it’s loaded. (Looking back, I see Rob touched on this as well.)

I’ve also been “hearing rumors”, though without any details, regarding a plugin. My guess would be something along the lines of nanovg, which seems to be totally feasible (everything in the GL implementation looks translatable with Corona’s shaders, the bitmap mechanism Rob mentioned above, etc.), or a little more minimal like this (no pretty pictures, just code  :)). There are more heavyweight options as well, like Anti-Grain, Cairo, Picasso, and Skia, where an author probably wouldn’t try to tackle the whole beast all at once. No real idea, though.