166
edits
(Remove some old stuff...) |
|||
Line 1: | Line 1: | ||
{{Template:Canvas Navigation}} | {{Template:Canvas Navigation}} | ||
=== | === Vector Image Support === | ||
The SVG parser basically just maps the xml structure to the property tree. It is implemented in Nasal on top of the XML parsing facilities alread provided by FlightGear. Using separate canvas elements instead of a single image will always be slower as every little piece of the canvas hat to be triangulated and afterwards rendered every time the canvas gets updated instead of just copying an image. On the other hand you if you use the canvas you can dynamically update the contents of the image and also get (theoretically) unlimited resolution, even changeable at runtime. For SVG already existing tools (Inkscape) can be used to create images and then just load them via Nasal and add some dynamic features to them. | |||
<!-- Integration-wise, there are some lessons to be learnt from the way SMIL works via SVG and ECMAScript (JavaScript). --> | |||
Integration-wise, there are some lessons to be learnt from the way SMIL works via SVG and ECMAScript (JavaScript). | |||
== Basic example == | == Basic example == | ||
Line 42: | Line 37: | ||
== Supported SVG features == | == Supported SVG features == | ||
The SVG file used for this demo has been created using [http://inkscape.org Inkscape]. Using paths (also with linestipple/dasharray), text, groups and cloning is supported, but don't try to use more advanced features like gradients, as the SVG parser doesn't interpret every part of the SVG standard. (You can always have a look at the [https://gitorious.org | The SVG file used for this demo has been created using [http://inkscape.org Inkscape]. Using paths (also with linestipple/dasharray), text, groups and cloning is supported, but don't try to use more advanced features like gradients, as the SVG parser doesn't interpret every part of the SVG standard. (You can always have a look at the [https://gitorious.org/fg/fgdata/blobs/master/Nasal/canvas/svg.nas implementation] and also improve it if you want ;-) ) | ||
edits