is there any plan to make cocos2dx support svg(vector graphocs) file ?

is there any plan to make cocos2dx support svg(vector graphocs) file ?

There is not plan to do it now.
What’s the benefit of it?

Minggo Zhang wrote:

There is not plan to do it now.
What’s the benefit of it?

we can scaling the svg image in our mind , but not worry about the image because not normal
我们可以任意缩放矢量图图片,而不用担心出现锯齿的情况

SVG Advantages
Advantages of using SVG over other image formats (like JPEG and GIF) are:

SVG images can be created and edited with any text editor
SVG images can be searched, indexed, scripted, and compressed
SVG images are scalable
SVG images can be printed with high quality at any resolution
SVG images are zoomable (and the image can be zoomed without degradation)
SVG is an open standard
SVG files are pure XML

and someone have found a solution with cocos2d, but i am not good at object-c, so anyone can give me a hand?
the cocos2d solution is https://github.com/lukelutman/CCSVG

qiujie tian wrote:

Minggo Zhang wrote:
> There is not plan to do it now.
> What’s the benefit of it?
>
we can scaling the svg image in our mind , but not worry about the image because not normal
我们可以任意缩放矢量图图片,而不用担心出现锯齿的情况
>
SVG Advantages
Advantages of using SVG over other image formats (like JPEG and GIF) are:
>
SVG images can be created and edited with any text editor
SVG images can be searched, indexed, scripted, and compressed
SVG images are scalable
SVG images can be printed with high quality at any resolution
SVG images are zoomable (and the image can be zoomed without degradation)
SVG is an open standard
SVG files are pure XML

It looks so great.

C Zhang wrote:

qiujie tian wrote:
> Minggo Zhang wrote:
> > There is not plan to do it now.
> > What’s the benefit of it?
>
> we can scaling the svg image in our mind , but not worry about the image because not normal
> 我们可以任意缩放矢量图图片,而不用担心出现锯齿的情况
>
> SVG Advantages
> Advantages of using SVG over other image formats (like JPEG and GIF) are:
>
> SVG images can be created and edited with any text editor
> SVG images can be searched, indexed, scripted, and compressed
> SVG images are scalable
> SVG images can be printed with high quality at any resolution
> SVG images are zoomable (and the image can be zoomed without degradation)
> SVG is an open standard
> SVG files are pure XML
>
>
>
It looks so great.

Thanks, can you covert the CCSVG to cocos2d-x ?

I may look at this. I need to use SVG files in my app.

so is now any support for SVG on cocos2d-x?

Thanks :slight_smile:

No, but we can consider it and discuss it.

Some more comments to concern.

Pros
* You only need one resource file instead of multiple files for different resolutions. Hence it simplify both your source code and resource file size
* Able to adaptive image processing

Cons
* As SVG is drawn based on vectors. There will be performance issue if your SVG files is complex (layers, objects, etc)
* Complicated to implement all features supported by SVG. Try svg editor such as Inkscape

Actually SVG can be rasterized on first launch to remove perfomance issues. Another obstacle is full SVG support: some editors like Inkscape may add non-standard extensions using XML namespaces, and such extensions work incorrectly even in frameworks like Qt or LibreOffice.

So using existing library is prefered solution, and probably full extensions support isn’t realistic, so this feature needs guidelines like “how to create cocos2d-x compatible SVG files”.

at any case, SVG would represent a big change in the game architecture, I’m not sure how would it affect the multi-resolution strategy. It’s important to remark that SVG is not valid for all graphics, so I’m not sure if it’s important to be able to base the multi-resolution system of a game just in SVG.

Just plain SVG support, as any other format, may be good, but just as an extra format, not to base the multi resolution system on it. On the other hand, as winipcfg says, it could generate performance issues instead the way of processing the graphics changes in some important way (maybe converting the SVG to a bitmap during the loading?), and we don’t want performance overhead :slight_smile:

Can Android devices handle SVG?

1 Like