Click or drag to resize

GuiTooltip Constructor

A controller for the Unity GUI tooltip.

Namespace:  KSPDev.GUIUtils
Assembly:  KSPDev_Utils.2.6 (in KSPDev_Utils.2.6.dll) Version: 2.6 for KSP v1
Syntax
C#
public GuiTooltip(
	bool alwaysEmitTheControl = false,
	float hideDelay = 0.2f
)
Request Example View Source

Parameters

alwaysEmitTheControl (Optional)
Type: SystemBoolean
If set to true, then an empty label will be presented even if there is no active tooltip in the frame. It may be useful for the fixed size layouts.
hideDelay (Optional)
Type: SystemSingle
Tells for how long the empty tooltip is to be show as an element until a new non-empty value is obtained. It helps to mitigate the UI flickering when the tooltip controls are located close to each other. The value is of the seconds unit. The sparse dialogs may want to set this value to zero. On the other hand, the compact dialogs with a lot of hinted elements may want to set some delay. As a rule of thumb, in UX a 200ms delay is considered to be not noticeable by a regular human user.
Remarks
It gives a better control on how and when the GUI element tooltip is shown. The tooltip content is rendered as a GUILayout.Label with the style provided. The Unity GUI layout mechanism applies limitations on when the code can decide if the control should or should not be shown. This class handles all the requirements.
See Also