Howto:Add new fgcommands to FlightGear: Difference between revisions

Jump to navigation Jump to search
m
→‎Background: http://forum.flightgear.org/viewtopic.php?f=4&t=24198&p=261526#p261526
m (→‎Background: http://forum.flightgear.org/viewtopic.php?f=4&t=24198&p=261526#p261526)
Line 21: Line 21:
});
});
fgcommand("hello");
fgcommand("hello");
</syntaxhighlight>
to process arguments, you can pass a property tree with nodes:
<syntaxhighlight lang="php">
addcommand("hello", func(node) {
print("hello ", node.getNode('name').getValue() );
});
fgcommand("hello", props.Node.new({'name': 'Johan G'}) );
</syntaxhighlight>
</syntaxhighlight>


Navigation menu