Are vector graphics possible?

Get help using Construct 2

Post » Fri Nov 18, 2011 1:39 pm

The title says it all, really. Are vector graphics a realistic possibility? Perhaps svg format or something? Would it be a performance killer or are there other reasons why this would not be feasible?
B
28
S
7
G
7
Posts: 102
Reputation: 6,483

Post » Fri Nov 18, 2011 2:15 pm

You can't draw SVG inside an HTML5 canvas. One solution would be to use an hidden SVG context as a plugin, and dump the drawing done on that SVG context in a PNG, which is then pasted inside C2's canvas...
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Fri Nov 18, 2011 3:13 pm

I think it's possible, it's just not particularly easy. Do many people use SVG graphics for games anyway? I thought most games used bitmaps. Another problem is it's not as simple as getting it in the canvas - the editor should have good SVG support too so you can accurately preview what you've done, and that's tricky too. TBH it's not high on our priority list.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Fri Nov 18, 2011 3:35 pm

Svg uses the xml format, so parsing most of it, and then using the canvas paths should be relatively straight forward.
The problem would be animating it, and as Ashley said making a reference in the editor. Then there are several other issues such as collision detection, etc.

Would people use it?
I believe so, but unlike bitmaps more detail would mean more processing time. I mean one nice looking image could have hundreds of paths.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Nov 18, 2011 10:52 pm

Yeah, I know there would be drawbacks, and most people would use bitmaps. But, I could see some situations where it would be the better choice.

Obviously you'd have to choose between certain functionality ... as with any other use of vector v bitmap. Bitmaps have drawbacks too... more detail does mean more resource usage... If C2 had the ability to actually generate the vector graphics within the game it would mean, if you did things right, a super small download in comparison?

I wouldn't expect it to be a priority. But I think it could be particularly powerful as an added bonus.

plauk2011-11-18 22:52:51
B
28
S
7
G
7
Posts: 102
Reputation: 6,483

Post » Wed Jan 11, 2012 8:43 pm

Any time you use scaling or rotation vectors always look far better than bitmaps, plus you can let it scale to suit any mobile device's resolution so you don't get the images coming up smaller on higher res screens, or having to put multiple copies of the images in at different sizes. Still it allows your games to scale to any size the user wants without any problems.
Inkscape is a v nice free SVG drawing program if you haven't seen that yet.
B
21
S
7
G
3
Posts: 33
Reputation: 4,522


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests