Slick Forums Forum Index Slick Forums
Discuss the Slick 2D Library
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Improved SVG Engine: Javascript, Animations & More!

 
Post new topic   Reply to topic    Slick Forums Forum Index -> Extensions
View previous topic :: View next topic  
Author Message
ACE91



Joined: 27 Aug 2008
Posts: 7

PostPosted: Sat Sep 06, 2008 4:20 pm    Post subject: Improved SVG Engine: Javascript, Animations & More! Reply with quote

Hello everyone! I have recently finished a two-week-long project which has resulted in something that Slick users have (probably) been wanting for quite some time: A much more complete SVG engine. It has decent, if buggy, support for the following features that the old engine lacked:

* Holes in paths, thanks to my path splitter class.
* JavaScript, powered by Mozilla Rhino
* Actual support for SVG path definitions beyond the limited subset that Inkscape uses, including the S, Q, and T tokens and relative values.
* SMIL animation -- supports <animateColor>, <animateTransform>, <animateMotion>, <set>, and event-driven animations.
* Images and text, including SVG fonts and <tspan> elements.
* Everything is stored in a pseudo-DOM tree which is faster than a complete DOM tree but exposes all of the same methods to scripting.
* Groups and <use> elements are actually handled correctly.
* The <polyline> and <circle> elements, which for some reason didn't work before.
* Fill-opacity and stroke-opacity properties.
* Stroke size is actually scaled correctly when the view is zoomed.
* DOM mouse events. (They currently use a lot of CPU power, though.)
* CSS style data specified in <style> tags. Classes and element styles are handled properly.
* Patterns that reference SVG elements, not just images.
* The ability to create many SVGDocumentViewer objects to display multiple SVG documents on one screen. Each viewer has its own translation and scale values, and handles its own events and animations.

You can download the SVG viewer below:

NOTE: SECTOR91.com is currently down, and the link is broken. Sorry about that. It will be back soon.
http://www.sector91.com/resources/downloads/svgview1.0.zip

Unzip the file somewhere, then double-click on svgviewer.jar. You will see the first of my SVG demos, a pendulum animation that is powered by JavaScript (taken from pilat.free.fr but modified). You can scroll around by dragging the middle mouse button or with the arrow keys, and zoom with the mouse wheel or the period and comma keys. You can also enter a file name in the address bar at the top (sorry, URLs don't work yet) and press Enter to view another file. Here's the files that are included with the viewer:

* holetest.svg - Demonstrates holes in polygons. Notice the seam in the center--I haven't figured out how to fix that yet.
* holetest2.svg - Demonstrates multiple holes.
* fonttest.svg - Demonstrates text elements and inline <tspan> elements.
* quad.svg - Demonstrates support for quadratic beizers, and for CSS stylesheets. A W3C demo.
* cubic.svg - Demonstrates more text support, and smooth cubic beizers. A W3C demo.
* motiontest.svg - Modified cubic.svg which demonstrates animateMotion tags.
* anim01.svg - A W3C demo which shows off all major types of animation.
* patterntest.svg - Demonstrates support for patterns. A W3C demo.
* bridge.svg - The bridge of the player's ship from my SVG-powered game, Project Gamma. An excellent stress test and demonstration of animations and mouse events. Try moving the mouse over the Galaxy Map, and clicking the red buttons.
* undergroundfactory.svg - A cool-looking animation from Project Gamma. Some of the gradients and patterns are missing due to a bug.

You can also copy any other SVG files that you want to test into the program's folder, and then simply enter their names to view them. Be forwarned: this is still buggy, and anything that makes heavy use of complex JavaScript, <use> elements, or animation may fail spectacularly. Most SVG games, toys and such that you can find on the internet don't work at all. This is still very much a work in progress.

If you're wondering where the source code is, I haven't posted it yet because I haven't decided how I want to distribute it. Most of the software from my website has been distributed under a "conditional open-source" license, which requires credit to be given in a blatantly obvious way (like a SECTOR91 logo on a game's main menu screen) in order to use the source code. That would obviously be inconvenient if the source code became a part of Slick, as I expect most people will want it to be. However, I don't just want to give it away without getting credit somehow. I'll have to negotiate this a bit.

Anyway, try out the SVG viewer and don't forget to ask questions if you have some and report bugs if you find any. Just bear in mind that it's incomplete and will have some bugs.


Last edited by ACE91 on Wed Sep 24, 2008 5:50 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
NateS
Game Developer


Joined: 25 May 2008
Posts: 577

PostPosted: Sat Sep 06, 2008 5:56 pm    Post subject: Reply with quote

Very cool! I haven't had a chance to use SVG in a game yet, but I keep it in mind.
Back to top
View user's profile Send private message Visit poster's website
ACE91



Joined: 27 Aug 2008
Posts: 7

PostPosted: Wed Sep 24, 2008 5:49 pm    Post subject: Reply with quote

Sorry to say this, but SECTOR91.com is currently down and may be down for a while, so the download link is currently broken. I will try to get the file hosted somewhere else, or to get the site back up as soon as possible.
Back to top
View user's profile Send private message Visit poster's website
manunderground
Oldbie


Joined: 17 Jun 2008
Posts: 336

PostPosted: Wed Sep 24, 2008 6:03 pm    Post subject: Reply with quote

If you are interested why not host it on Google Code under the same license Slick uses?
_________________
My website about game development http://anotherearlymorning.com
Back to top
View user's profile Send private message Visit poster's website
Fletch



Joined: 26 Feb 2007
Posts: 16

PostPosted: Mon Feb 16, 2009 3:51 am    Post subject: Reply with quote

Any movement on this? It'd like to play around with some SVG...

Cheers,
Rob
_________________
Rob
Terraflubb Game Dev Blog
Back to top
View user's profile Send private message Visit poster's website
kdnewton
Regular


Joined: 07 May 2009
Posts: 123
Location: Okanagan, BC, Canadia

PostPosted: Sat Jul 25, 2009 5:10 pm    Post subject: Reply with quote

1. Don't ever ask for "cracked" anything on a public forum, especially this one.

2. Your message belongs in it's own thread because you started a new topic.

3. If you want "completely free" then you should be looking at "open source".

4. http://lmgtfy.com/?q=open+source+animation Check out Pencil
Back to top
View user's profile Send private message Visit poster's website
arielsan



Joined: 07 Apr 2009
Posts: 49
Location: Uruguay

PostPosted: Mon Jan 04, 2010 1:24 pm    Post subject: Reply with quote

I would like to try it too. Where can I find it?

Like manunderground said, you should try Google Code.

Or try upload it to Megaupload or something like that otherwise.

Thanks in advance.
Back to top
View user's profile Send private message Visit poster's website
h3ckboy
Regular


Joined: 23 Feb 2009
Posts: 113

PostPosted: Mon Jan 04, 2010 2:09 pm    Post subject: Reply with quote

kdnewton wrote:
1. Don't ever ask for "cracked" anything on a public forum, especially this one.

2. Your message belongs in it's own thread because you started a new topic.

3. If you want "completely free" then you should be looking at "open source".

4. http://lmgtfy.com/?q=open+source+animation Check out Pencil


sry but the new post brought my attention here

you do know this is a bot right?
Back to top
View user's profile Send private message
kdnewton
Regular


Joined: 07 May 2009
Posts: 123
Location: Okanagan, BC, Canadia

PostPosted: Mon Jan 04, 2010 4:02 pm    Post subject: Reply with quote

h3ckboy wrote:

sry but the new post brought my attention here

you do know this is a bot right?


Yes.

But I did not know before your message.
_________________
Linux and free software enthusiast.
Back to top
View user's profile Send private message Visit poster's website
zenzei



Joined: 02 Jun 2009
Posts: 21

PostPosted: Tue Jan 05, 2010 1:07 pm    Post subject: Reply with quote

Hi! Your post brings my attention about this subject. Anyone has the code of this svg animator???

Thanks and happy new year mates!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Slick Forums Forum Index -> Extensions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group