content: String
Tooltip
A tooltip component that displays informational text when hovering over visual elements.
This class provides a tooltip implementation that can be attached to any visual element as a component. The tooltip displays text content in a styled bubble with a pointer triangle, appearing on hover and disappearing when the pointer leaves the element.
Features
- Automatic positioning relative to the target element
- Theme-based styling with customizable appearance
- Speech bubble design with pointer triangle
- Hover-based show/hide behavior
- Component-based attachment system
Usage Examples
// Add a tooltip to any visual element
var button = new Button();
Tooltip.tooltip(button, "Click me to save your work");
// Update tooltip content
Tooltip.tooltip(button, "Updated tooltip text");
// Remove tooltip
Tooltip.tooltip(button, null);
// Create tooltip manually
var myTooltip = new Tooltip("Custom tooltip content");
someVisual.component('tooltip', myTooltip);
Static Members
Adds, updates, or removes a tooltip from a visual element.
This static method provides a convenient way to manage tooltips on visual elements. It automatically creates, updates, or removes tooltip components as needed.
Name | Type | Description |
---|---|---|
visual |
ceramic.Visual | The visual element to attach the tooltip to |
content |
String | The tooltip text to display, or null to remove the tooltip * ## Examples haxe // Add a tooltip Tooltip.tooltip(myButton, "Click to save"); * // Update tooltip content Tooltip.tooltip(myButton, "Click to save (Ctrl+S)"); * // Remove tooltip Tooltip.tooltip(myButton, null); |
Instance Members
Default is false
, automatically set to true
when any of this instance's observable variables has changed.
The theme used for styling this tooltip. If null, the context's default theme will be used.
The text content displayed in the tooltip. This is the main message shown to the user.
The visual element this tooltip is attached to. @private
Creates a new tooltip with the specified content.
The tooltip is automatically added to the context view with high depth to ensure it appears above other UI elements. The visual structure includes a background bubble, pointer triangle, and text content.
Name | Type | Description |
---|---|---|
content |
String | The text content to display in the tooltip |
Private Members
The text visual that displays the tooltip content. @private
The background bubble quad for the tooltip. @private
The triangle pointer that points to the target element. @private
Event when any observable value as changed on this instance.
Name | Type |
---|---|
instance |
Tooltip |
fromSerializedField |
Bool |
Event when theme field changes.
Name | Type |
---|---|
current |
Theme |
previous |
Theme |
Event when content field changes.
Name | Type |
---|---|
current |
String |
previous |
String |
Binds this tooltip as a component to its entity.
Sets up the hover behavior for showing and hiding the tooltip. The tooltip appears when the pointer enters the entity and disappears when it leaves. Positioning is automatically calculated relative to the entity's center.
@private
Updates the layout and positioning based on the current text content.
Recalculates the size and positions of all visual elements (text, bubble, triangle) to accommodate the current content. The tooltip is automatically sized to fit the text with appropriate padding.
@private
Updates the visual styling of the tooltip based on the current theme.
Applies theme colors and fonts to all visual elements. If no custom theme is set, uses the context's default theme. The bubble and triangle use overlay colors with appropriate alpha values.
@private
Name | Type |
---|---|
entity |
ceramic.Entity |
Returns |
---|
ceramic.Entity |
Metadata
Name | Parameters |
---|---|
:build |
tracker.macros.ObservableMacro.build() |
:autoBuild |
tracker.macros.ObservableMacro.build() |
:build |
ceramic.macros.ComponentMacro.build() |
:autoBuild |
ceramic.macros.ComponentMacro.build() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |