Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a game that uses simple 2d vector graphics. I want a tool that will let me visually draw things like arbitrary polygons by placing points.

A perfect tool would present a grid that I could scale larger or smaller (ie: the window is 10 units across or the window is 20 units across). It would let me draw a polygon on this grid, and will tell me, simply, the coordinates of each point.

It would be great if this tool could then export a file format that was something like

0, 5
3, -2
0, 0
-3, -2

For bonus points, it would be great to be able to assign other attributes to each point. In the end, this will get passed to OpenGL, so things like color and opacity could possibly be used.

share|improve this question

Well, Flash, Illustrator and so on allow you to draw vectors while snapping to a grid. You could then export as SVG and do some processing on the SVG data, but be warned, I've heard it said that the SVG specification is nightmare.

Why not write your own? Seems really straightforward to do, from what you've said. Set up your onscreen grid according to the scaling the user has specified. Do some simple math, on mouse release, to see what the closest point on the on-screen grid is, and snap to that. I would write this in something like Adobe AIR (Flash for desktop) since Flash supports easy-to-use vector drawing in code. While normal Flash can't access the file system, AIR can, so you can just write your CSV-like file to disk. You could write each vertex as something like

[x, y, (metadata1, metadata2, ...)] elaborate on your example.

You could even use a bit of Flex for the UI part of it, if you wanted to go that far. Sounds like a good FOSS project in fact -- although I don't doubt there are similar things out there, somewhere.

share|improve this answer
You could also use a "image map" editor (for drawing/editing HTML image maps), since they simply generate a list of vertex coordinates. There's no way to add metadata there however. – bummzack Aug 21 '11 at 12:00
Yep good point bummzack. – Arcane Engineer Aug 21 '11 at 12:22
Yeah, I have been considering doing this. Though I will probably use Python and Pyglet, since I am already working in that. – Mike Cooper Aug 21 '11 at 15:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.