Class globals screen display
screen.display ------------------------------------------------------------------------------ Class that manages a dialog, which displays an arbitrary number of properties periodically updating the values. Property names are abbreviated to the shortest possible unique part. Example: var dpy = screen.display.new(20, 10); # x/y coordinate dpy.setcolor(1, 0, 1); # magenta (default: white) dpy.setfont("SANS_12B",12); # see $FG_ROOT/gui/styles/*.xml dpy.add("/position/latitude-deg", "/position/longitude-deg"); dpy.add(props.globals.getNode("/orientation").getChildren()); The add() method takes one or more property paths or props.Nodes, or a vector containing those, or a hash with properties, or vectors with properties, etc. Internal "public" parameters may be set directly: dpy.interval = 0; # update every frame dpy.format = "%.3g"; # max. 3 digits fractional part dpy.tagformat = "%-12s"; # align prop names to 12 spaces dpy.redraw(); # pick up new settings The open() method should only be used to undo a close() call. In all other cases this is done implicitly. redraw() is automatically called by an add(), but can be used to let the dialog pick up new settings of internal variables. Methods add(), setfont() and setcolor() can be appended to the new() constructor (-> show big yellow frame rate counter in upper right corner): screen.display.new(-15, -5, 0).setfont("TIMES_24").setcolor(1, 0.9, 0).add("/sim/frame-rate");
Functions
open
add() opens already, so call open() explicitly only after close()!