docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Tooltip

    The tooltip popup type.

    Inheritance
    object
    Popup
    Popup<Tooltip>
    AnchorPopup<Tooltip>
    Tooltip
    Inherited Members
    AnchorPopup<Tooltip>.placement
    AnchorPopup<Tooltip>.currentPlacement
    AnchorPopup<Tooltip>.offset
    AnchorPopup<Tooltip>.crossOffset
    AnchorPopup<Tooltip>.containerPadding
    AnchorPopup<Tooltip>.shouldFlip
    AnchorPopup<Tooltip>.arrowVisible
    AnchorPopup<Tooltip>.outsideClickDismissEnabled
    AnchorPopup<Tooltip>.outsideScrollEnabled
    AnchorPopup<Tooltip>.outsideClickStrategy
    AnchorPopup<Tooltip>.anchor
    AnchorPopup<Tooltip>.SetPlacement(PopoverPlacement)
    AnchorPopup<Tooltip>.SetOffset(int)
    AnchorPopup<Tooltip>.SetCrossOffset(int)
    AnchorPopup<Tooltip>.SetContainerPadding(int)
    AnchorPopup<Tooltip>.SetShouldFlip(bool)
    AnchorPopup<Tooltip>.SetArrowVisible(bool)
    AnchorPopup<Tooltip>.SetAnchor(VisualElement)
    AnchorPopup<Tooltip>.SetOutsideClickDismiss(bool)
    AnchorPopup<Tooltip>.SetOutsideScrollEnabled(bool)
    AnchorPopup<Tooltip>.SetOutsideClickStrategy(OutsideClickStrategy)
    AnchorPopup<Tooltip>.GetMovableElement()
    Popup<Tooltip>.shown
    Popup<Tooltip>.dismissed
    Popup<Tooltip>.SetContainerView(VisualElement)
    Popup<Tooltip>.SetKeyboardDismiss(bool)
    Popup<Tooltip>.SetLastFocusedElement(Focusable)
    Popup.keyboardDismissEnabled
    Popup.view
    Popup.containerView
    Popup.referenceView
    Popup.contentView
    Popup.rootView
    Popup.Dismiss()
    Popup.Dismiss(DismissType)
    Popup.Show()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    public sealed class Tooltip : AnchorPopup<Tooltip>

    Fields

    defaultPlacement

    The default placement of the tooltip.

    Declaration
    public const PopoverPlacement defaultPlacement = Bottom
    Field Value
    Type Description
    PopoverPlacement

    Properties

    content

    The content Visual Element of the tooltip (if any).

    Declaration
    public VisualElement content { get; }
    Property Value
    Type Description
    VisualElement

    template

    The template to display inside the popup.

    Declaration
    public VisualElement template { get; }
    Property Value
    Type Description
    VisualElement

    text

    The text to display inside the popup.

    Declaration
    public string text { get; }
    Property Value
    Type Description
    string

    Methods

    AnimateViewOut(DismissType)

    Start the hide animation for this popup.

    Declaration
    protected override void AnimateViewOut(DismissType reason)
    Parameters
    Type Name Description
    DismissType reason

    The reason for the dismissal.

    Overrides
    AnchorPopup<Tooltip>.AnimateViewOut(DismissType)

    Build(VisualElement)

    Build a new Tooltip.

    Declaration
    public static Tooltip Build(VisualElement referenceView)
    Parameters
    Type Name Description
    VisualElement referenceView

    An arbitrary UI element used as reference for the application context to attach to the popup.

    Returns
    Type Description
    Tooltip

    A Tooltip instance.

    Remarks

    In the Application element, only one Tooltip is create and moved at the right place when hovering others UI elements. The Tooltip is handled by the TooltipManipulator.

    Exceptions
    Type Condition
    ArgumentNullException

    If referenceView is null.

    FindSuitableParent(VisualElement)

    Find the parent VisualElement where the popup will be added.

    Declaration
    protected override VisualElement FindSuitableParent(VisualElement element)
    Parameters
    Type Name Description
    VisualElement element

    An arbitrary UI element inside the panel.

    Returns
    Type Description
    VisualElement

    The popup container VisualElement in the current panel.

    Overrides
    Popup.FindSuitableParent(VisualElement)
    Remarks

    This is usually one of the layers from the Panel root UI element. If no Panel is found, the method will return the visual tree root of the given element.

    SetContent(VisualElement)

    Set the content of the tooltip.

    Declaration
    public Tooltip SetContent(VisualElement content)
    Parameters
    Type Name Description
    VisualElement content

    The content to display inside the tooltip.

    Returns
    Type Description
    Tooltip

    The Tooltip.

    Remarks

    Passing null will clear the content of the tooltip.

    SetText(string)

    Set a new value for the text property.

    Declaration
    public Tooltip SetText(string value)
    Parameters
    Type Name Description
    string value

    The new value (will be localized).

    Returns
    Type Description
    Tooltip

    The Tooltip.

    ShouldAnimate()

    Implement this method to know if the popup should call AnimateViewIn() and AnimateViewOut(DismissType) methods or not.

    Declaration
    protected override bool ShouldAnimate()
    Returns
    Type Description
    bool

    True if you want to animate the popup, False otherwise.

    Overrides
    Popup.ShouldAnimate()

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Fields
      • defaultPlacement
    • Properties
      • content
      • template
      • text
    • Methods
      • AnimateViewOut(DismissType)
      • Build(VisualElement)
      • FindSuitableParent(VisualElement)
      • SetContent(VisualElement)
      • SetText(string)
      • ShouldAnimate()
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)