Class TooltipRenderer
Static class responsible for rendering tooltips throughout the UI system
Inherited Members
Namespace: PopcorningGuineaPig.Engine.UI
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public static class TooltipRenderer
Methods
| Edit this page View SourceClearQueue()
Drops any queued tooltips without rendering. Editor viewports flush the queue before each RenderTexture2D pass so a tooltip queued by one viewport's update cannot bleed into another viewport's render.
Declaration
public static void ClearQueue()
QueueTooltip(string, Vector2)
Queues a tooltip for rendering at the end of the frame to ensure proper Z-order
Declaration
public static void QueueTooltip(string text, Vector2 mousePosition)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The tooltip text to display |
| Vector2 | mousePosition | Current mouse position |
RenderAllQueuedTooltips()
Renders all queued tooltips and clears the queue This should be called at the end of the frame after all other UI elements are drawn
Declaration
public static void RenderAllQueuedTooltips()
RenderTooltip(string, Vector2, int, int)
Renders a tooltip at the specified position with the given text
Declaration
public static void RenderTooltip(string text, Vector2 mousePosition, int screenWidth, int screenHeight)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The tooltip text to display |
| Vector2 | mousePosition | Current mouse position |
| int | screenWidth | Screen width for boundary checking |
| int | screenHeight | Screen height for boundary checking |
SetLocalizationService(ILocalizationService?)
Sets the localization service to use for automatic font management in tooltips.
Declaration
public static void SetLocalizationService(ILocalizationService? service)
Parameters
| Type | Name | Description |
|---|---|---|
| ILocalizationService | service | The localization service to use |
SetTooltipStyle(Color?, Color?, Color?, int?, Vector2?)
Sets the tooltip styling properties
Declaration
public static void SetTooltipStyle(Color? backgroundColor = null, Color? borderColor = null, Color? textColor = null, int? fontSize = null, Vector2? padding = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Color? | backgroundColor | Background color |
| Color? | borderColor | Border color |
| Color? | textColor | Text color |
| int? | fontSize | Font size |
| Vector2? | padding | Padding around text |