Showing 1 changed files with 25 additions and 0 deletions
+25
Nasal/map.nas
... ...
@@ -16,6 +16,7 @@ var mapClass = {
16 16
             text: 'NORTH UP',
17 17
             map: 0,
18 18
             airplane: data.hdg,
19
+            fontsize: m.device.role == 'MFD' ? 16 : 12,
19 20
         };
20 21
         m.changeZoom();
21 22
 
... ...
@@ -37,6 +38,26 @@ var mapClass = {
37 38
         m.layers.route = MapRoute.new(m.device, m.group);
38 39
         m.layers.navaids = MapNavaids.new(m.device, m.group);
39 40
 
41
+        m.mapOrientation = m.device.display.display.createGroup('MapOrientation')
42
+            .setVisible(m.visibility);
43
+        m.mapOrientation.createChild('path', 'MapOrientation-bg')
44
+            .rect(
45
+                m.device.data.mapclip.right - size(m.device.data.orientation) * (m.device.data.orientation.fontsize + 2),
46
+                m.device.data.mapclip.top + 2,
47
+                size(m.device.data.orientation) * (m.device.data.orientation.fontsize + 2),
48
+                m.device.data.orientation.fontsize + 2)
49
+            .setColor(1,1,1)
50
+            .setColorFill(0,0,0);
51
+        m.mapOrientation_text = m.mapOrientation.createChild('text', 'MapOrientation-text')
52
+            .setFontSize(m.device.data.orientation.fontsize)
53
+            .setFont('LiberationFonts/LiberationMono-Regular.ttf')
54
+            .setTranslation(
55
+                m.device.data.mapclip.right - size(m.device.data.orientation) * (m.device.data.orientation.fontsize + 2),
56
+                m.device.data.mapclip.top + m.device.data.orientation.fontsize + 2)
57
+            .setColor(1,1,1)
58
+            .setColorFill(1,1,1)
59
+            .setText(m.device.data.orientation.text);
60
+
40 61
 #        m.device.display.display.createGroup().createChild('path')
41 62
 #            .setColor(1,0,0)
42 63
 #            .setColorFill(1,0,0)
... ...
@@ -89,6 +110,9 @@ var mapClass = {
89 110
 
90 111
         me.group.setRotation(me.device.data.orientation.map * D2R);
91 112
 
113
+        me.mapOrientation_text
114
+            .setText(me.device.data.orientation.text);
115
+
92 116
         foreach (var l; keys(me.layers))
93 117
             me.layers[l].update();
94 118
     },
... ...
@@ -96,5 +120,6 @@ var mapClass = {
96 120
         me.visibility = v;
97 121
         foreach (var l; keys(me.layers))
98 122
             me.layers[l].setVisible(v);
123
+        me.mapOrientation.setVisible(v);
99 124
     },
100 125
 };