Debian Codegraph @

Nasal/canvas/map/fix.draw

raw
1 # WARNING: *.draw files will be deprecated, see: http://wiki.flightgear.org/MapStructure
2 ##
3 # draw a single fix symbol
4 #
5
6 var draw_fix = func (group, fix, controller=nil, lod=0) {
7 var lat = fix.lat;
8 var lon = fix.lon;
9 var name = fix.id;
10
11 var fix_grp = group.createChild("group",'fix-'~name); # one group for each fix
12
13 # the fix symbol
14 var icon_fix = fix_grp.createChild("path", "fix-icon-"~ name)
15 .moveTo(-15,15)
16 .lineTo(0,-15)
17 .lineTo(15,15)
18 .close()
19 .setStrokeLineWidth(3)
20 .setColor(0,0.6,0.85);
21
22 # the fix label
23 var text_fix = fix_grp.createChild("text", 'fix-label-'~name)
24 .setDrawMode( canvas.Text.TEXT )
25 .setText(name)
26 .setFont("LiberationFonts/LiberationSans-Regular.ttf")
27 .setFontSize(28)
28 .setTranslation(5,25);
29
30 # the fix position
31 fix_grp.setGeoPosition(lat, lon);
32
33 }