Menubar
| Note The existing menubar is a hard-coded feature implemented using PLIB/PUI which we are hoping to get rid of eventually to help us Unifying the 2D rendering backend via canvas for better portability and performance.
This feature will be ported to Canvas in version 2024.2. |
The in-game menubar of FlightGear is located at the top of the screen.
Menu items
For the list of default menubar items, see Menu.
Add items
To add a menu for a specific plane only you have to enhance the planes -set.xml file. Add the follow lines (example for the livery selection dialog in a Boeing 787), or any item that you want to show, above the </sim> tag. You can add as many items and menus as you like, but keep the menubar as small as possible, the larger the outside view will be.
<menubar>
<default>
<menu n="100">
<label>Boeing 787</label>
<enabled type="bool">true</enabled>
<item>
<label>Select Livery</label>
<binding>
<command>nasal</command>
<script>aircraft.livery.dialog.open()</script>
</binding>
</item>
</menu>
</default>
</menubar>
- menu n="100": creates an extra menu item, at the end of the menubar, needs to be start in 100.
- aircraft.livery.dialog.open(): the prefix 'aircraft' is coming from the tagname you choose inside the <nasal> section, eg:
<nasal>
<aircraft>
<file>Aircraft/MyAircraft/Nasal/script.nas</file>
</aircraft>
</nasal>
Use only characters that could be used to name and call a nasal function (eg: the '-' character is not valid).
Styles
The menubar is available in various styles. Currently there are two styles (both are shown below) packaged with FlightGear. The lower one is standard. You can switch between styles by pressing Shift-F10.
Creating your own
|
|
How to Change the Default Menubar Font Size
For those using bigger monitors or higher resolutions it may be necessary to increase the font size of the menubar. The change below can be applied and should be made before launching.
--- flightgear-data/fgdata/gui/styles/anthrax.xml.orig
+++ flightgear-data/fgdata/gui/styles/anthrax.xml
@@ -11,7 +11,7 @@
<fonts>
<gui>
- <name type="string">HELVETICA_12</name>
+ <name type="string">HELVETICA_18</name>
<baseline-height type="float">21</baseline-height>
</gui>
Possible font names are "default", "FIXED_8x13", "FIXED_9x15", "TIMES_10", "TIMES_24", "HELVETICA_10", "HELVETICA_12", "HELVETICA_14", "HELVETICA_18", "SANS_12B", and all font file names from $FG_ROOT/Fonts/, such as "helvetica_bold.txf".