Debian Codegraph @

Nasal/canvas/map/waypoint.draw

raw
1 # WARNING: *.draw files will be deprecated, see: http://wiki.flightgear.org/MapStructure
2 ##
3 # Draw a waypoint symbol and waypoint name (Gijs' 744 ND.nas code)
4
5 #
6 var drawwp = func (group, lat, lon, alt, name, i, wp) {
7 var wp_group = group.createChild("group","wp");
8 wp[i] = wp_group.createChild("path", "wp-" ~ i)
9 .setStrokeLineWidth(3)
10 .moveTo(0,-25)
11 .lineTo(-5,-5)
12 .lineTo(-25,0)
13 .lineTo(-5,5)
14 .lineTo(0,25)
15 .lineTo(5,5)
16 .lineTo(25,0)
17 .lineTo(5,-5)
18 .setColor(1,1,1)
19 .close();
20 #####
21 # The commented code leads to a segfault when a route is replaced by a new one
22 #####
23 #
24 # text_wp[i] = wp_group.createChild("text", "wp-text-" ~ i)
25 #
26 if (alt != 0)
27 name ~= "\n"~alt;
28 var text_wps = wp_group.createChild("text", "wp-text-" ~ i)
29 .setDrawMode( canvas.Text.TEXT )
30 .setText(name)
31 .setFont("LiberationFonts/LiberationSans-Regular.ttf")
32 .setFontSize(28)
33 .setTranslation(25,35)
34 .setColor(1,1,1);
35 wp_group.setGeoPosition(lat, lon);
36 };