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 (408)
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  
  java vector based drawing program  (Read 1670 times)
0 Members and 1 Guest are viewing this topic.
Offline askoruli

Senior Newbie





« Posted 2007-08-11 13:29:09 »

Is there any program that lets you draw basic shapes on the screen and then gives you the coresponding java2D code to draw those inside a program. I'm planning on doing my current game using only java 2D drawing code as opposed to images but I don't know if it's worth it if I have to spend ages writing+testing all the drawing code.

Offline keldon85

Senior Member


Medals: 1



« Reply #1 - Posted 2007-08-11 16:56:07 »

Gimp and Inkscape (google) both output SVG files which can then be turned into Java paths. I think there is also an SVG library, but if there isn't I've got a method that takes some of the Gimp's output and converts it into a Shape.

Offline cylab

JGO Knight


Medals: 30



« Reply #2 - Posted 2007-08-12 19:30:26 »

I think there is also an SVG library
Batik: http://xmlgraphics.apache.org/batik/

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline dishmoth
« Reply #3 - Posted 2007-08-13 10:59:31 »

Is there any program that lets you draw basic shapes on the screen and then gives you the coresponding java2D code to draw those inside a program. I'm planning on doing my current game using only java 2D drawing code as opposed to images but I don't know if it's worth it if I have to spend ages writing+testing all the drawing code.

If no existing applications do what you want, you might consider writing a simple 'viewer' rather than a full-blown 'editor'.

For example, you could have a simple ASCII text file that describe the shapes you want to display (e.g., "C 0 0 10" for a circle at (0,0) with radius 10), and edit that file in Notepad (or whatever).  The 'viewer' application would read in the text file and display the shapes on a canvas (using the same code that your game would use).  If the shapes aren't quite right, then you use Notepad to make changes, and hit the 'reload' button on the viewer to see what they look like.

Editing the shapes in this way wouldn't be as nice as clicking and dragging on a proper editor, but unless you want to draw a lot of shapes then you're probably saving a lot of development time overall.

Just a suggestion.
Simon

P.S.  Since we're talking about Java2D shapes here, you could probably define your drawings directly as Java source code, rather than inventing an ASCII text file format.  You could edit a source file as usual, compile it into a class file, and have the viewer reload and execute that class file.

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #4 - Posted 2007-08-13 15:57:19 »

Batik is a full featured SVG render library. It's pretty big and for games it's clearly overkill.

You could check out tinyline and svgsalamander. Both are a lot smaller. However, their license is somewhat sucky.

You could also write your own SVG parser. If you only handle a few basic things it's certainly doable.

弾幕 ☆ @mahonnaiseblog
Offline keldon85

Senior Member


Medals: 1



« Reply #5 - Posted 2007-08-13 21:56:37 »

Like I said, I've made code that does just that. Gimp's output is easy to parse in Java; probably because it uses a reduced subset of the available instructions.

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!
 
Get high quality music tracks for your game!

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 (109 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

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

UnluckyDevil (212 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.763 seconds with 20 queries.