Changes

Jump to: navigation, search

Canvas SVG Parser

300 bytes added, 03:09, 17 July 2012
m
Basic example
== Basic example ==
For loading a SVG file onto a Canvas we first need to create a Canvas instance (See [[Howto:Add_a_2D_canvas_instrument_to_your_aircraft]]). Afterwards we can load a SVG by just using the function ''canvas.parsesvg'' from the Canvas API, also the API now supports retrieving elements by id which enables the following simple code snippet for changing the text and color in an instrument:
<syntaxhighlight lang="php">
</syntaxhighlight>
Also the API now supports retrieving elements by id which enables the following simple code snippet for changing the text and color in an instrument:
You can lookup any type of element you want and modify them how you want (Add transformations, change colors/texts/coordinates etc.). You can also lookup an parent element and afterwards some of is child elements. By this you can use the same id multiple times but are still able to get access to every element (eg. Engine 1/Dial N1, Engine 2/Dial N1, etc.).
18,574
edits

Navigation menu