List of Nasal extension functions: Difference between revisions

Jump to navigation Jump to search
(Created page with "{{Template:Nasal Navigation}} == FlightGear extension functions == === <tt>cmdarg()</tt> === cmdarg() is a mechanism to pass arguments to a nasal script (wrapped in propert...")
 
Line 286: Line 286:
  var fp = flightplan();
  var fp = flightplan();
  var fp = flightplan('/some/path/to/a/flightplan.xml');
  var fp = flightplan('/some/path/to/a/flightplan.xml');
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>
<references/>

Navigation menu