FlightGear Newsletter September 2012: Difference between revisions

Jump to navigation Jump to search
Line 42: Line 42:


=== Flightplan access via Scripting ===
=== Flightplan access via Scripting ===
James has improved the "flightplan()" extension function of the [[Nasal]] scripting interpreter, which makes it possible to retrieve a hash representation of the flight plan stored in the route manager.
In advance of converting the Map and NavDisplay to use the [[Canvas]], James has improved the "flightplan()" extension function of the [[Nasal]] scripting interpreter to expose the full route-path vector for each flight plan leg, as a vector on the leg .
 
 
<syntaxhighlight lang="php">
var fp = flightplan();
for (var i=0; i<fp.getPlanSize(); i += 1)
{
  var leg = fp.getWP(i);
  debug.dump(leg.path());
}
</syntaxhighlight>


With these changes in place, it is already possible to directly show a SVG image for each waypoint and connect them using OpenVG paths, even without separate "icon" support.
With these changes in place, it is already possible to directly show a SVG image for each waypoint and connect them using OpenVG paths, even without separate "icon" support.

Navigation menu