docs.unity3d.com
    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>.anchor
    AnchorPopup<Tooltip>.SetPlacement(PopoverPlacement)
    AnchorPopup<Tooltip>.SetOffset(Int32)
    AnchorPopup<Tooltip>.SetCrossOffset(Int32)
    AnchorPopup<Tooltip>.SetContainerPadding(Int32)
    AnchorPopup<Tooltip>.SetShouldFlip(Boolean)
    AnchorPopup<Tooltip>.SetArrowVisible(Boolean)
    AnchorPopup<Tooltip>.SetAnchor(VisualElement)
    AnchorPopup<Tooltip>.SetOutsideClickDismiss(Boolean)
    AnchorPopup<Tooltip>.ShowView()
    AnchorPopup<Tooltip>.ShouldDismiss(DismissType)
    AnchorPopup<Tooltip>.HideView(DismissType)
    AnchorPopup<Tooltip>.InvokeDismissedEventHandlers(DismissType)
    AnchorPopup<Tooltip>.RefreshPosition()
    AnchorPopup<Tooltip>.GetMovableElement()
    Popup<Tooltip>.m_LastFocusedElement
    Popup<Tooltip>.shown
    Popup<Tooltip>.dismissed
    Popup<Tooltip>.SetKeyboardDismiss(Boolean)
    Popup<Tooltip>.SetLastFocusedElement(Focusable)
    Popup<Tooltip>.InvokeShownEventHandlers()
    Popup.k_NextFrameDurationMs
    Popup.k_PopupShow
    Popup.k_PopupDismiss
    Popup.handler
    Popup.keyboardDismissEnabled
    Popup.view
    Popup.targetParent
    Popup.contentView
    Popup.context
    Popup.Dismiss()
    Popup.Dismiss(DismissType)
    Popup.Show()
    Popup.GetFocusableElement()
    Popup.OnViewKeyDown(KeyDownEvent)
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Syntax
    public sealed class Tooltip : AnchorPopup<Tooltip>

    Fields

    defaultPlacement

    The default placement of the tooltip.

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

    Properties

    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

    AnimateViewIn()

    Start the animation for this popup.

    Declaration
    protected override void AnimateViewIn()
    Overrides
    Unity.AppUI.UI.AnchorPopup<Unity.AppUI.UI.Tooltip>.AnimateViewIn()

    AnimateViewOut(DismissType)

    Start the hide animation for this popup.

    Declaration
    protected override void AnimateViewOut(DismissType reason)
    Parameters
    Type Name Description
    DismissType reason
    Overrides
    Unity.AppUI.UI.AnchorPopup<Unity.AppUI.UI.Tooltip>.AnimateViewOut(Unity.AppUI.Core.DismissType)

    Build(VisualElement)

    Build a new Tooltip. 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 Unity.AppUI.UI.TooltipManipulator.

    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.

    FindSuitableParent(VisualElement)

    Find the parent VisualElement where the popup will be added. This is usually one of the layers from the Panel root UI element.

    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)

    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
    Boolean

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

    Overrides
    Popup.ShouldAnimate()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023