Hi Joshua Worth,
I wonder why nobody has answered you? Or have they?
As you will be now aware if you are still in the forum, that the game image is all bitmap oriented. What I propose is a QUASI SVG function. i.e. First extract the object descriptions from SVG File which is XML. Then get the name of the object from that, by a bit of scripting, e.g. "CIRCLE"
Then the script feed those details extract from the file, into a circle function. The function draws the bitmap on the game, or, it erases pixels from the game screen in a circle.
We would need people to submit functions, one for each of the KEYWORDS found in the XML. Those shapes need not be made all at once, and things like blur, and gradient, are probably not worth including. I think it best to make a very simple thing first, which is solid [i.e. code you cant break]. Then maybe that function will show the way for the form of the others? A lot can be done with simple line and pixel graphics in painting!
I am currently taking a look at the circle function, and I have planned an algorithm for n sided polygon.
If anyone can make helpful suggestions, on how to erase say a line or pixel, when you want it no longer, in your game screen, I will be grateful. Also I want to know, how to set a pixel to a colour, and how to read the colour of a pixel located at x, y ? That is what is blocking progress at present.
###########################################
"Vector graphics drawing software is used for creating and editing vector graphics. It provides graphic designers with the ability to create precise, scalable and layered images. Both 3-D graphics and CAD (computer-aided design) technology rely heavily on vector graphics."
I just looked at Inkscape which is the professional favourite free editor. I had the idea that it is right to draw in the editor, purpose-built for SVG drawing. Inkscape exports 3 styles of svg file. The third is encoded compressed so we can not see what it draws by reading into it in a text editor.
The other two are plain text XML types, which we can read. I found an older type in the supplied clipart in WINK, a famous free screencasting recorder. It is here along with Wax; a great free video fx studio :
http://www.debugmode.com/wink/Type one>
=========
<svg
addresses [urls], canvas size, id of svg
<g
<path
transform, style
</g>
</svg>
Type two>
=========
<svg
addresses [urls], canvas size, id ,sodopody version
<defs
id="defs1347" />
<sodipodi:namedview
id, canvas size,
<metadata
addresses [urls]
</metadata>
<g
Layer id
<path
object type "arc"
transform
</g>
</svg>
Type three>
=========
<?xml version
<!DOCTYPE svg PUBLIC
url
<svg
<linearGradient
id
</linearGradient>
<polygon points="13.413 76.5, 13.413 16, 17.085 17.252, 16.775 74.956", style
<g id=... />
</svg>
~~~~~~~~~~~~~
They are all in xml forms [extended metadata language ?]. I drew a simple shape. Saving it in two forms from Inkscape, I looked at the code. I show them above, with a lot of the detail removed. It shows that it wont be too hard to identify the structure. Then a script could be written which would strip the unwanted text [from my viewpoint] to leave just the simple descriptions of the shapes. The whole image could have its data stored in a C Script
'structure', so that the sizes/locations etc. of existing drawings, can be stored there, in a temporary format, used by the GE Script.
The data could be overwritten if it is allowed to use the game as a drawing surface, i.e. that the file is editable whilst in play. I suggest that Inkscape be used as a good external editor, which would need a convertor function, to format the 'structure' into the XML correctly.
Now, Inkscape can do many fancy things like blurs and gradients, which one could ignore initially, to make a test piece. That script would read a xml into ram, strip out and save the shapes, and the numbers defining them. As long as we have functions in GE Script to draw the shapes onto a canvas filled with colour, we have a way of representing the images we draw in Inkscape and saveto file, drawing into a GE canvas. Stretch your imaginations!
SVG
Postby Joshua Worth » 16 Feb 2006, 21:38
REMINDS US
>>Huge levels that dont take up much space AT ALL.
Yes but there are many major advantages, notwithstanding the benefit that many people will have practised Inkscape for years...The SVG is infinitely resizeable, without the edges of shapes becoming blurred. Also they are accurately drawn in Inkscape, and can be layered, in a similar way in GE. This should be no harder work than to open a sprite in a bitmap editor, make changes, and to re-save and re-open in place of the original.
I am working on a simple polygon draw idea. I borrowed my formula model, from a mathematics book, but have altered it to suit canvas drawing using lines. I think if you can test a pixel colour, that you can follow the drawn outline in a function, to draw lines to the centre of the polygon, for a colour fill polygon. Holes in a polygon may be drawn in a layer above ? I am guessing.
Food for thought!