Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (407)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Vector graphics as sprites?  (Read 1258 times)
0 Members and 1 Guest are viewing this topic.
Offline wmjoers

Senior Newbie




Nobody can be uncheered with a balloon.


« Posted 2003-10-24 07:51:22 »

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?
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #1 - Posted 2003-10-25 23:42:28 »

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 Smiley.  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.

Offline Smoke

Senior Newbie




games rock!


« Reply #2 - Posted 2003-10-26 11:06:08 »

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.
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2003-10-26 22:51:03 »

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.


Polygons were good enough for my small 2d game that I wrote a while back too Smiley

Why complicate things if the simple option works?

Will.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (88 views)
2013-05-17 21:29:12

alaslipknot (96 views)
2013-05-16 21:24:48

gouessej (128 views)
2013-05-16 00:53:38

gouessej (123 views)
2013-05-16 00:17:58

theagentd (131 views)
2013-05-15 15:01:13

theagentd (119 views)
2013-05-15 15:00:54

StreetDoggy (161 views)
2013-05-14 15:56:26

kutucuk (184 views)
2013-05-12 17:10:36

kutucuk (185 views)
2013-05-12 15:36:09

UnluckyDevil (191 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.099 seconds with 20 queries.