Tooltips: Difference between revisions

Jump to navigation Jump to search
691 bytes added ,  22 February 2015
→‎Mappings: Added nasal examples to use tooltip.
(→‎Mappings: Added nasal examples to use tooltip.)
Line 18: Line 18:
* arm-disarm, on-off, up-down and down-up - map a boolean value to a text string
* arm-disarm, on-off, up-down and down-up - map a boolean value to a text string
* nasal, evaluates a Nasal script each time the property changes. The property value is available to the script as arg[0]
* nasal, evaluates a Nasal script each time the property changes. The property value is available to the script as arg[0]
== Use from Nasal ==
Tooltips can also be shown from Nasal scripts.
More info can be found in gui.nas in $FGDATA/Nasal
Some examples:
<syntaxhighlight lang="nasal">
#Show readme in a popup
gui.popupTip("readme");
#Show readme at position 10, 10
gui.popupTip("readme", nil, nil, {y: 10, x: 10});
#Show readme at position y=10, with 2 second delay
gui.popupTip("readme", 2, nil, {y: 10});
#Show readme at position, with 6 second delay
gui.popupTip("readme", 6);
#Show readme at position x=10, y at default position
gui.popupTip("readme", nil, nil, {x: 10});
#Show readme at position 10, 10, with 10 second delay
gui.popupTip("readme", 10, nil, {"y": 10, "x": 10});
</syntaxhighlight>


== Tooltip-on-click ==
== Tooltip-on-click ==
579

edits

Navigation menu