Vector graphics as sprites?

Hi,
I’m looking for an easy way to import and use vectorbased images (such as wmf or svg) and use that images as sprites.

The problem is not the sprite part…it’s the import part. I have been looking at the open source based project to use SVG i Java (batik) but as far as I understand, the batik API is only for viewing SVG, convert SVG to other formats or transfering Java2D to SVG.

Does anyone have any idea?

I implemented vecort based sprites using regular Java2D Shape objects (Polygon actually)

I have a basic game that works entirely with Shapes to draw the level and the sprites… I posted the source code here a couple weeks ago but nobody commented on it - I guess it sucked too bad :). I would write a loader for wmf or SVG that returns a Shape - but I guess that is ultimately what you are asking about.

I should get it into a WebStartable Jar and stick on a website. i intended to use the code base as the starting point for some tutorials here. Basically I will be learning some as I go as well.

BTW, I don’t think this is necessarily the best way to do vector sprites… I started this way because it was the easiest… I will optimize as necessary.

heres a page with a list of java libraries for image format conversion and stuff; has a section for vector based formats:

http://www.geocities.com/marcoschmidt.geo/java-image-coding.html

just glimpsed over it but i think it should be possible to use the “batik rastrizer” component to convert svg to an Image, after all it can convert svg to raster formats.

you could also look at the “black dirt” page, they have a swing component that can display svg.

[quote]I implemented vecort based sprites using regular Java2D Shape objects (Polygon actually)

BTW, I don’t think this is necessarily the best way to do vector sprites… I started this way because it was the easiest… I will optimize as necessary.
[/quote]
Polygons were good enough for my small 2d game that I wrote a while back too :slight_smile:

Why complicate things if the simple option works?

Will.