GUI Messages: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Moving up suitable first section; Fix spelling; + Related resources)
Line 5: Line 5:


== Background ==
== Background ==
Whatever is written to <code>/sim/messages/*</code> at runtime is shown on-screen for a few seconds, then moved away. When the next message is written to that node, that is moved on-screen.
Behind the scenes, this works by using a property listener/callback that is triggered whenever the property tree branch is modified.


{{FGCquote
{{FGCquote
Line 19: Line 17:
   }}
   }}
}}
}}
Whatever is written to <code>/sim/messages/*</code> at runtime is shown on-screen for a few seconds, then moved away. When the next message is written to that node, that is moved on-screen.
Behind the scenes, this works by using a property listener/callback that is triggered whenever the property tree branch is modified.


== Features ==
== Features ==

Revision as of 11:28, 14 February 2016

This article is a stub. You can help the wiki by expanding it.
Note  This article needs a few screenshots


On-screen GUI messages can be rendered in FlightGear using a simple property-based messaging system which is using property listeners and the PUI GUI system.

Background

Cquote1.png The ATC subsystem shouldn't really generate the message *and* display it, no matter which method is used. It should rather only set a property to the generated message, for example /sim/messages/atc. A different subsystem should then take this message and display it -- using the same code for ATC and other screen messages. It should be glue code that decides what to do with the message property (c++ and Nasal listeners). Send it to the screen like now, print it to the console, forward it to the speech synthesis module
— Melchior FRANZ (Feb 4th, 2006). [Flightgear-devel] Re: screen.nas: log windows.
(powered by Instant-Cquotes)
Cquote2.png


Whatever is written to /sim/messages/* at runtime is shown on-screen for a few seconds, then moved away. When the next message is written to that node, that is moved on-screen. Behind the scenes, this works by using a property listener/callback that is triggered whenever the property tree branch is modified.

Features

This system is primarily used by the following features:

None of those are hard-coded, those are all going through the property tree and gui.nas, so you can "disable" things there. The higher-level features are limits.nas (or the failure manager) and the tutorial system.

The corresponding code can be found in gui.nas and screen.nas

To change the font size

Cquote1.png Set /sim/gui/style[1]/fonts/message-display/name
— Csaba Halász  (Nov 23rd, 2008). Re: [Flightgear-devel] screen.window size of font.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png with TIMES_24
— gerard robin (Nov 23rd, 2008). Re: [Flightgear-devel] screen.window size of font.
(powered by Instant-Cquotes)
Cquote2.png

To disable the system completely, set /sim/screen/nomap=true to prevent default message mapping - e.g. as a startup option --prop:/sim/screen/nomap=1 and/or by editing $FG_HOME/Preferences.xml

In addition, there's the tooltip system which is meanwhile using the Canvas 2D rendering API

Related content

Wiki articles

Forum topics

Source code