Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
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 1514 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!
Legends of Yore - The Casual Retro Roguelike
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.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (10 views)
2014-04-15 03:46:01

UprightPath (23 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (107 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!