Debian Codegraph @

Nasal/canvas/map/airports-nd.draw

raw
1 # WARNING: *.draw files will be deprecated, see: http://wiki.flightgear.org/MapStructure
2 ##
3 # draws a single airport (ND style)
4 #
5 var draw_apt = func (group, apt, controller=nil, lod=0) {
6 var lat = apt.lat;
7 var lon = apt.lon;
8 var name = apt.id;
9 # print("drawing nd airport:", name);
10
11 var apt_grp = group.createChild("group", name);
12
13 # FIXME: conditions don't belong here, use the controller hash instead!
14 # if (1 or getprop("instrumentation/efis/inputs/arpt")) {
15 var icon_apt = apt_grp.createChild("path", name ~ " icon" )
16 .moveTo(-17,0)
17 .arcSmallCW(17,17,0,34,0)
18 .arcSmallCW(17,17,0,-34,0)
19 .close()
20 .setColor(0,0.6,0.85)
21 .setStrokeLineWidth(3);
22 var text_apt = apt_grp.createChild("text", name ~ " label")
23 .setDrawMode( canvas.Text.TEXT )
24 .setTranslation(17,35)
25 .setText(name)
26 .setFont("LiberationFonts/LiberationSans-Regular.ttf")
27 .setColor(0,0.6,0.85)
28 .setFontSize(28);
29 apt_grp.setGeoPosition(lat, lon); # FIXME: this needs to be configurable!!
30 #}
31
32 # draw routines should always return their canvas group to the caller for further processing
33 }