Board index FlightGear Development Nasal

displaying naivaid list on screen

Nasal is the scripting language of FlightGear.

displaying naivaid list on screen

Postby gkick » Wed Jun 12, 2019 4:44 pm

Hi all,

How to display Navaid Info to screen ?
The function below produces a list of naivaids within a nominated range to the console.
var navs = findNavaidsWithinRange(10);
foreach(var nav; navs){
print(nav.name, " (ID: ", nav.id, ")");
}

What would be the best way to
a sort that list by runway id
b left align the fields evenly spaced
c redirect the output to the screen via something like
var nap = screen.display.new(410,-130);
var shownap = func() {
if (getprop("/sim/time/sun-angle-rad") > 1.57) { nap.setcolor(1,0.9,0);
}
if (getprop("/sim/time/sun-angle-rad") < 1.57) { nap.setcolor(0,0,0);
}
nap.format = "%.5g";
nap.add("/tracking/airport");
I can do it with properties no problem on a line by line basis, however the output of the function varies depending on available navaids.
gkick
 
Posts: 106
Joined: Sun Jan 01, 2017 11:04 pm

Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest