[Plugin] : SVG Canvas (vector graphics !)

Post your completed addons to share with the community

Post » Tue Feb 21, 2012 4:41 pm

Update : v1.11 - 11 october
Here's a small update.
The SVG Canvas now starts with a default SVG content string.

There's also a new method "change Text Content", to change a text string added to the SVG.

A quick demo, with @NRABrazil SVG example :
https://dl.dropbox.com/u/1412774/SVGTextChangeDemo/index.html

The new plugin : https://dl.dropbox.com/u/1412774/SVGTextChangeDemo/pode_svg.1.11.zip
The .capx : https://dl.dropbox.com/u/1412774/SVGTextChangeDemo/SVGTextChangeDemo.capx

I also realised that I never uploaded the original .capx for the original demo (the one with the screenshot further down) !
Here it is : https://dl.dropbox.com/u/1412774/SVGTextChangeDemo/SVGCanvasDemo.capx

____________________________________________________

Update : v1.1 - 16 august
Here's a quick update. There's now the possibility to dump the SVG canvas as a base64 string, to load it inside a Sprite !



If I remember well, @chrisbrobs asked for it...

There's also a new icon.
The demo : https://dl.dropbox.com/u/1412774/SVGbase64Demo/index.html
The .capx : https://dl.dropbox.com/u/1412774/SVGbase64Demo/SVGbase64Demo.capx
The plugin : https://dl.dropbox.com/u/1412774/SVGbase64Demo/pode_svg.1.1.zip

(It's not working in WebGL mode, because Ashley is already dumping canvas to write them as webgl textures, and that means ERROR MODE 18 for me - domain error. Same as CORS. It's logical, but annoying. When I'll have more time, I'll implement the workaround.)

_____________________________________________________

Edit : I didn't realised, but for those who ddin't know it : SVG means vector graphics.

The devil made me do that, sorry...

Do you like SVG ?



Here's a little plugin I started, to use SVG with C2.
It's the beginning, but you can use circle, rectangle (with rounded corners, yay ! ;)), paste SVG string (from image, for example).
You can also change a property from a specific item after it has been drawn, alhtough you need to the SVG name of the property (for example, the circle radius in SVG is just r).
It should work on all browser, even mobile (and it's a pain to debug on all platforms...)
You can expect more shapes in a near future, and filters effects (a bit like shaders, in SVG).
The plugin : http://dl.dropbox.com/u/1412774/SVGCanvas/pode_svg.0.1.zip
The demo uses septeven MultiLines plugin (http://www.scirra.com/forum/plugin-multiline-box_topic48898_post307078.html) : http://dl.dropbox.com/u/1412774/SVGCanvas/index.html
Pode2012-10-11 12:12:43
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Tue Feb 21, 2012 10:40 pm

Thanks for this. I like Veector Graphics.
B
40
S
14
G
11
Posts: 243
Reputation: 9,432

Post » Wed Feb 22, 2012 5:50 am

Html5 constructors need SVG to fight against Adobe Air. Thnaks!
B
106
S
27
G
8
Posts: 209
Reputation: 12,525

Post » Thu Feb 23, 2012 9:34 pm

Nice plugin.


@Pode: Do you want to render all the svg with your plugin (- I haven't looked in the source). Suggestion: Perhaps it's possible to build a plugin with svg-edit. With some luck this could work even during edittime.
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Fri Feb 24, 2012 10:25 am

@Joe7 : yes, I'm planning to support most of the SVG spec. And for what's not implemented, you can still paste your svg command in plain text, to let it render what I didn't made yet ;).
It's not going to be possible to make it work during edittime, since Ashley isn't using a browser library at edittime.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Tue Feb 28, 2012 8:08 pm

Hello,
I've download your plugin and I just wanted to ask. How did you get it to load an image from an URL? Is this another plugin or is it a part I'm missing?

ThanksDalekAddison2012-02-28 20:12:57
B
29
S
4
Posts: 42
Reputation: 2,391

Post » Tue Feb 28, 2012 8:29 pm

This is very cool! Thank you!
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Wed Feb 29, 2012 8:27 am

@DalekAddison : you just provide the URL of the image.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Mon Apr 16, 2012 3:25 pm

Hi,

Please I need a help with this test, it do not work, why?

SVG test.capxNRABrazil2012-04-16 15:25:43
B
90
S
5
G
8
Posts: 165
Reputation: 7,648

Post » Mon Apr 16, 2012 8:44 pm

@NRABrazil: when I try to open the file, it says that I'm missing the Touch2 plugin. Which one is it ?
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests