docs.unity3d.com
    Show / Hide Table of Contents

    Class VisualElement

    Base class for objects that are part of the UIElements visual tree.

    Inheritance
    Object
    CallbackEventHandler
    Focusable
    VisualElement
    PropertyField
    SearchFieldBase<TextInputType, T>
    Toolbar
    ToolbarBreadcrumbs
    ToolbarSpacer
    BindableElement
    Box
    HelpBox
    Image
    IMGUIContainer
    ImmediateModeElement
    Scroller
    ScrollView
    TextInputBaseField<TValueType>.TextInputBase
    TwoPaneSplitView
    Inherited Members
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    Focusable.Blur()
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    Namespace: UnityEngine.UIElements
    Syntax
    public class VisualElement : Focusable, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
    Remarks

    VisualElement contains several features that are common to all controls in UIElements, such as layout, styling and event handling. Several other classes derive from it to implement custom rendering and define behaviour for controls.

    Constructors

    VisualElement()

    Initializes and returns an instance of VisualElement.

    Declaration
    public VisualElement()

    Fields

    disabledUssClassName

    USS class name of local disabled elements.

    Declaration
    public static readonly string disabledUssClassName
    Field Value
    Type Description
    String

    Properties

    cacheAsBitmap

    Declaration
    public bool cacheAsBitmap { get; set; }
    Property Value
    Type Description
    Boolean

    canGrabFocus

    Declaration
    public override bool canGrabFocus { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    Focusable.canGrabFocus

    childCount

    Number of child elements in this object's contentContainer.

    Declaration
    public int childCount { get; }
    Property Value
    Type Description
    Int32

    contentContainer

    child elements are added to this element, usually this

    Declaration
    public virtual VisualElement contentContainer { get; }
    Property Value
    Type Description
    VisualElement

    contentRect

    The rectangle of the content area of the element, in the local space of the element.

    Declaration
    public Rect contentRect { get; }
    Property Value
    Type Description
    Rect
    Remarks

    In the box model used by UI Toolkit, the content area refers to the inner rectangle for displaying text and images. It excludes the borders and the padding.

    customStyle

    Returns the custom style properties accessor for this element.

    Declaration
    public ICustomStyle customStyle { get; }
    Property Value
    Type Description
    ICustomStyle

    enabledInHierarchy

    Returns true if the VisualElement is enabled in its own hierarchy.

    Declaration
    public bool enabledInHierarchy { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    This flag verifies if the element is enabled globally. A parent disabling its child VisualElement affects this variable.

    enabledSelf

    Returns true if the VisualElement is enabled locally.

    Declaration
    public bool enabledSelf { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    This flag isn't changed if the VisualElement is disabled implicitely by one of its parents. To verify this, use enabledInHierarchy.

    experimental

    Returns the UIElements experimental interfaces.

    Declaration
    public IExperimentalFeatures experimental { get; }
    Property Value
    Type Description
    IExperimentalFeatures

    focusController

    Declaration
    public override FocusController focusController { get; }
    Property Value
    Type Description
    FocusController
    Overrides
    Focusable.focusController

    generateVisualContent

    Called when the VisualElement visual contents need to be (re)generated.

    Declaration
    public Action<MeshGenerationContext> generateVisualContent { get; set; }
    Property Value
    Type Description
    Action<MeshGenerationContext>
    Remarks

    When this delegate is handled, you can generate custom geometry in the content region of the VisualElement. For an example, see the MeshGenerationContext documentation.

    This delegate is called only when the VisualElement needs to regenerate its visual contents. It is not called every frame when the panel refreshes. The generated content is cached, and remains intact until any of the VisualElement's properties that affects visuals either changes, or MarkDirtyRepaint() is called.

    When you execute code in a handler to this delegate, do not make changes to any property of the VisualElement. A handler should treat the VisualElement as 'read-only'. Changing the VisualElement during this event might cause undesirable side effects. For example, the changes might lag, or be missed completely.

    hierarchy

    Access to this element physical hierarchy

    Declaration
    public VisualElement.Hierarchy hierarchy { get; }
    Property Value
    Type Description
    VisualElement.Hierarchy

    Item[Int32]

    Retrieves the child element at a specific index.

    Declaration
    public VisualElement this[int key] { get; }
    Parameters
    Type Name Description
    Int32 key

    The index of the element.

    Property Value
    Type Description
    VisualElement

    layout

    The position and size of the VisualElement relative to its parent, as computed by the layout system.

    Declaration
    public Rect layout { get; }
    Property Value
    Type Description
    Rect
    Remarks

    Before reading from this property, add it to a panel and wait for one frame to ensure that the element layout is computed. After the layout is computed, a GeometryChangedEvent will be sent on this element.

    localBound

    AABB after applying the transform to the rect, but before applying the layout translation.

    Declaration
    public Rect localBound { get; }
    Property Value
    Type Description
    Rect

    name

    The name of this VisualElement.

    Declaration
    public string name { get; set; }
    Property Value
    Type Description
    String
    Remarks

    Use this property to write USS selectors that target a specific element. The standard practice is to give an element a unique name.

    paddingRect

    The rectangle of the padding area of the element, in the local space of the element.

    Declaration
    protected Rect paddingRect { get; }
    Property Value
    Type Description
    Rect
    Remarks

    In the box model used by UI Toolkit, the padding area refers to the inner rectangle. The inner rectangle includes the contentRect and padding, but excludes the border.

    panel

    The panel onto which this VisualElement is attached.

    Declaration
    public IPanel panel { get; }
    Property Value
    Type Description
    IPanel

    parent

    The parent of this VisualElement.

    Declaration
    public VisualElement parent { get; }
    Property Value
    Type Description
    VisualElement
    Remarks

    Unlike the parent property, this property reflects for logical hierarchy. For example, if you add an element to a ScrollView, the logical parent of this element is the ScrollView itself, whereas the physical parent returned by the parent property returns a child of ScrollView which acts as the parent of your element.

    pickingMode

    Determines if this element can be pick during mouseEvents or Pick(Vector2) queries.

    Declaration
    public PickingMode pickingMode { get; set; }
    Property Value
    Type Description
    PickingMode

    resolvedStyle

    Returns the VisualElement resolved style values.

    Declaration
    public IResolvedStyle resolvedStyle { get; }
    Property Value
    Type Description
    IResolvedStyle

    schedule

    Retrieves this VisualElement's IVisualElementScheduler

    Declaration
    public IVisualElementScheduler schedule { get; }
    Property Value
    Type Description
    IVisualElementScheduler

    style

    Reference to the style object of this element.

    Declaration
    public IStyle style { get; }
    Property Value
    Type Description
    IStyle
    Remarks

    Contains data computed from USS files or inline styles written to this object in C#.

    styleSheets

    Returns a VisualElementStyleSheetSet that manipulates style sheets attached to this element.

    Declaration
    public VisualElementStyleSheetSet styleSheets { get; }
    Property Value
    Type Description
    VisualElementStyleSheetSet

    tooltip

    Text to display inside an information box after the user hovers the element for a small amount of time.

    Declaration
    public string tooltip { get; set; }
    Property Value
    Type Description
    String

    transform

    Returns a transform object for this VisualElement. ITransform

    Declaration
    public ITransform transform { get; }
    Property Value
    Type Description
    ITransform
    Remarks

    The transform object implements changes to the VisualElement object.

    usageHints

    A combination of hint values that specify high-level intended usage patterns for the VisualElement. This property can only be set when the VisualElement is not yet part of a UnityEngine.UIElements.Panel. Once part of a UnityEngine.UIElements.Panel, this property becomes effectively read-only, and attempts to change it will throw an exception. The specification of proper UsageHints drives the system to make better decisions on how to process or accelerate certain operations based on the anticipated usage pattern. Note that those hints do not affect behavioral or visual results, but only affect the overall performance of the panel and the elements within. It's advised to always consider specifying the proper UsageHints, but keep in mind that some UsageHints might be internally ignored under certain conditions (e.g. due to hardware limitations on the target platform).

    Declaration
    public UsageHints usageHints { get; set; }
    Property Value
    Type Description
    UsageHints

    userData

    This property can be used to associate application-specific user data with this VisualElement.

    Declaration
    public object userData { get; set; }
    Property Value
    Type Description
    Object

    viewDataKey

    Used for view data persistence (ie. tree expanded states, scroll position, zoom level).

    Declaration
    public string viewDataKey { get; set; }
    Property Value
    Type Description
    String
    Remarks

    This is the key used to save/load the view data from the view data store. Not setting this key will disable persistence for this VisualElement.

    visible

    Indicates whether or not this element should be rendered.

    Declaration
    public bool visible { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    The value of this property reflects the value of visibility for this element. The value is true for Visible and false for Hidden. Writing to this property writes to visibility. resolvedStyle style

    visualTreeAssetSource

    Stores the asset reference, if the generated element is cloned from a VisualTreeAsset.

    Declaration
    public VisualTreeAsset visualTreeAssetSource { get; }
    Property Value
    Type Description
    VisualTreeAsset

    worldBound

    AABB after applying the world transform to rect.

    Declaration
    public Rect worldBound { get; }
    Property Value
    Type Description
    Rect

    worldTransform

    Returns a matrix that cumulates the following operations (in order): -Local Scaling -Local Rotation -Local Translation -Layout Translation -Parent worldTransform (recursive definition - consider identity when there is no parent)

    Declaration
    public Matrix4x4 worldTransform { get; }
    Property Value
    Type Description
    Matrix4x4
    Remarks

    Multiplying the layout rect by this matrix is incorrect because it already contains the translation.

    Methods

    Add(VisualElement)

    Add an element to this element's contentContainer

    Declaration
    public void Add(VisualElement child)
    Parameters
    Type Name Description
    VisualElement child

    AddToClassList(String)

    Adds a class to the class list of the element in order to assign styles from USS.

    Declaration
    public void AddToClassList(string className)
    Parameters
    Type Name Description
    String className

    The name of the class to add to the list.

    BringToFront()

    Brings this element to the end of its parent children list. The element will be visually in front of any overlapping sibling elements.

    Declaration
    public void BringToFront()

    Children()

    Returns the elements from its contentContainer.

    Declaration
    public IEnumerable<VisualElement> Children()
    Returns
    Type Description
    IEnumerable<VisualElement>

    ClassListContains(String)

    Searches for a class in the class list of this element.

    Declaration
    public bool ClassListContains(string cls)
    Parameters
    Type Name Description
    String cls

    The name of the class for the search query.

    Returns
    Type Description
    Boolean

    Returns true if the class is part of the list. Otherwise, returns false.

    Clear()

    Remove all child elements from this element's contentContainer

    Declaration
    public void Clear()

    ClearClassList()

    Removes all classes from the class list of this element. AddToClassList(String)

    Declaration
    public void ClearClassList()
    Remarks

    This method might cause unexpected results for built-in Unity elements, since they might rely on classes to be present in their list to function.

    Contains(VisualElement)

    Checks if this element is an ancestor of the specified child element.

    Declaration
    public bool Contains(VisualElement child)
    Parameters
    Type Name Description
    VisualElement child

    The child element to test against.

    Returns
    Type Description
    Boolean

    Returns true if this element is a ancestor of the child element, false otherwise.

    Remarks

    This method "walks up" the hierarchy of the child element until it reaches this element or the root of the visual tree.

    ContainsPoint(Vector2)

    Checks if the specified point intersects with this VisualElement's layout.

    Declaration
    public virtual bool ContainsPoint(Vector2 localPoint)
    Parameters
    Type Name Description
    Vector2 localPoint

    The point in the local space of the element.

    Returns
    Type Description
    Boolean

    Returns true if the point is contained within the element's layout. Otherwise, returns false.

    Remarks

    Unity calls this method to find out what elements are under a cursor (such as a mouse). Do not rely on this method to perform invalidation, since Unity might cache results or skip some invocations of this method for performance reasons. By default, a VisualElement has a rectangular area. Override this method in your VisualElement subclass to customize this behaviour.

    DoMeasure(Single, VisualElement.MeasureMode, Single, VisualElement.MeasureMode)

    Declaration
    protected virtual Vector2 DoMeasure(float desiredWidth, VisualElement.MeasureMode widthMode, float desiredHeight, VisualElement.MeasureMode heightMode)
    Parameters
    Type Name Description
    Single desiredWidth
    VisualElement.MeasureMode widthMode
    Single desiredHeight
    VisualElement.MeasureMode heightMode
    Returns
    Type Description
    Vector2

    ElementAt(Int32)

    Retrieves the child element at a specific index.

    Declaration
    public VisualElement ElementAt(int index)
    Parameters
    Type Name Description
    Int32 index

    The index of the element.

    Returns
    Type Description
    VisualElement

    EnableInClassList(String, Boolean)

    Enables or disables the class with the given name.

    Declaration
    public void EnableInClassList(string className, bool enable)
    Parameters
    Type Name Description
    String className

    The name of the class to enable or disable.

    Boolean enable

    A boolean flag that adds or removes the class name from the class list. If true, EnableInClassList adds the class name to the class list. If false, EnableInClassList removes the class name from the class list.

    Remarks

    If enable is true, EnableInClassList adds the class name to the class list. If enable is false, EnableInClassList removes the class name from the class list.

    ExecuteDefaultAction(EventBase)

    Declaration
    protected override void ExecuteDefaultAction(EventBase evt)
    Parameters
    Type Name Description
    EventBase evt
    Overrides
    Focusable.ExecuteDefaultAction(EventBase)

    FindAncestorUserData()

    Searches up the hierarchy of this VisualElement and retrieves stored userData, if any is found.

    Declaration
    public object FindAncestorUserData()
    Returns
    Type Description
    Object
    Remarks

    This ignores the current userData and returns the first parent's non-null userData.

    FindCommonAncestor(VisualElement)

    Finds the lowest common ancestor between two VisualElements inside the VisualTree hierarchy.

    Declaration
    public VisualElement FindCommonAncestor(VisualElement other)
    Parameters
    Type Name Description
    VisualElement other
    Returns
    Type Description
    VisualElement

    Focus()

    Declaration
    public override sealed void Focus()
    Overrides
    Focusable.Focus()

    GetClasses()

    Retrieve the classes for this element.

    Declaration
    public IEnumerable<string> GetClasses()
    Returns
    Type Description
    IEnumerable<String>

    A class list.

    GetFirstAncestorOfType<T>()

    Walks up the hierarchy, starting from this element's parent, and returns the first VisualElement of this type

    Declaration
    public T GetFirstAncestorOfType<T>()
        where T : class
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    GetFirstOfType<T>()

    Walks up the hierarchy, starting from this element, and returns the first VisualElement of this type

    Declaration
    public T GetFirstOfType<T>()
        where T : class
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    IndexOf(VisualElement)

    Retrieves the child index of the specified VisualElement.

    Declaration
    public int IndexOf(VisualElement element)
    Parameters
    Type Name Description
    VisualElement element

    The child element to retrieve.

    Returns
    Type Description
    Int32

    The index of the child, or -1 if the child is not found.

    Insert(Int32, VisualElement)

    Insert an element into this element's contentContainer

    Declaration
    public void Insert(int index, VisualElement element)
    Parameters
    Type Name Description
    Int32 index
    VisualElement element

    MarkDirtyRepaint()

    Triggers a repaint of the VisualElement on the next frame.

    Declaration
    public void MarkDirtyRepaint()

    Overlaps(Rect)

    Declaration
    public virtual bool Overlaps(Rect rectangle)
    Parameters
    Type Name Description
    Rect rectangle
    Returns
    Type Description
    Boolean

    PlaceBehind(VisualElement)

    Places this element right before the sibling element in their parent children list. If the element and the sibling position overlap, the element will be visually behind of its sibling.

    Declaration
    public void PlaceBehind(VisualElement sibling)
    Parameters
    Type Name Description
    VisualElement sibling

    The sibling element.

    Remarks

    The elements must be siblings.

    PlaceInFront(VisualElement)

    Places this element right after the sibling element in their parent children list. If the element and the sibling position overlap, the element will be visually in front of its sibling.

    Declaration
    public void PlaceInFront(VisualElement sibling)
    Parameters
    Type Name Description
    VisualElement sibling

    The sibling element.

    Remarks

    The elements must be siblings.

    Remove(VisualElement)

    Removes this child from the hierarchy

    Declaration
    public void Remove(VisualElement element)
    Parameters
    Type Name Description
    VisualElement element

    RemoveAt(Int32)

    Remove the child element located at this position from this element's contentContainer

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    Int32 index

    RemoveFromClassList(String)

    Removes a class from the class list of the element.

    Declaration
    public void RemoveFromClassList(string className)
    Parameters
    Type Name Description
    String className

    The name of the class to remove to the list.

    RemoveFromHierarchy()

    Removes this element from its parent hierarchy.

    Declaration
    public void RemoveFromHierarchy()

    SendEvent(EventBase)

    Sends an event to the event handler.

    Declaration
    public override sealed void SendEvent(EventBase e)
    Parameters
    Type Name Description
    EventBase e

    The event to send.

    Overrides
    CallbackEventHandler.SendEvent(EventBase)
    Remarks

    This forwards the event to the event dispatcher.

    SendToBack()

    Sends this element to the beginning of its parent children list. The element will be visually behind any overlapping sibling elements.

    Declaration
    public void SendToBack()

    SetEnabled(Boolean)

    Changes the VisualElement enabled state. A disabled VisualElement does not receive most events.

    Declaration
    public void SetEnabled(bool value)
    Parameters
    Type Name Description
    Boolean value

    New enabled state

    Remarks

    The method disables the local flag of the VisualElement and implicitly disables its children. It does not affect the local enabled flag of each child.

    SetEnabledFromHierarchy(Boolean)

    Declaration
    protected bool SetEnabledFromHierarchy(bool state)
    Parameters
    Type Name Description
    Boolean state
    Returns
    Type Description
    Boolean

    Sort(Comparison<VisualElement>)

    Reorders child elements from this VisualElement contentContainer.

    Declaration
    public void Sort(Comparison<VisualElement> comp)
    Parameters
    Type Name Description
    Comparison<VisualElement> comp

    The sorting criteria.

    ToggleInClassList(String)

    Toggles between adding and removing the given class name from the class list.

    Declaration
    public void ToggleInClassList(string className)
    Parameters
    Type Name Description
    String className

    The class name to add or remove from the class list.

    Remarks

    Checks for the given class name in the element class list. If the class name is found, it is removed from the class list. If the class name is not found, the class name is added to the class list.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    Explicit Interface Implementations

    ITransitionAnimations.Layout(Rect, Int32)

    Declaration
    ValueAnimation<Rect> ITransitionAnimations.Layout(Rect to, int durationMs)
    Parameters
    Type Name Description
    Rect to
    Int32 durationMs
    Returns
    Type Description
    ValueAnimation<Rect>
    Implements
    ITransitionAnimations.Layout(Rect, Int32)

    ITransitionAnimations.Position(Vector3, Int32)

    Declaration
    ValueAnimation<Vector3> ITransitionAnimations.Position(Vector3 to, int durationMs)
    Parameters
    Type Name Description
    Vector3 to
    Int32 durationMs
    Returns
    Type Description
    ValueAnimation<Vector3>
    Implements
    ITransitionAnimations.Position(Vector3, Int32)

    ITransitionAnimations.Rotation(Quaternion, Int32)

    Declaration
    ValueAnimation<Quaternion> ITransitionAnimations.Rotation(Quaternion to, int durationMs)
    Parameters
    Type Name Description
    Quaternion to
    Int32 durationMs
    Returns
    Type Description
    ValueAnimation<Quaternion>
    Implements
    ITransitionAnimations.Rotation(Quaternion, Int32)

    ITransitionAnimations.Scale(Single, Int32)

    Declaration
    ValueAnimation<float> ITransitionAnimations.Scale(float to, int durationMs)
    Parameters
    Type Name Description
    Single to
    Int32 durationMs
    Returns
    Type Description
    ValueAnimation<Single>
    Implements
    ITransitionAnimations.Scale(Single, Int32)

    ITransitionAnimations.Size(Vector2, Int32)

    Declaration
    ValueAnimation<Vector2> ITransitionAnimations.Size(Vector2 to, int durationMs)
    Parameters
    Type Name Description
    Vector2 to
    Int32 durationMs
    Returns
    Type Description
    ValueAnimation<Vector2>
    Implements
    ITransitionAnimations.Size(Vector2, Int32)

    ITransitionAnimations.Start(Color, Color, Int32, Action<VisualElement, Color>)

    Declaration
    ValueAnimation<Color> ITransitionAnimations.Start(Color from, Color to, int durationMs, Action<VisualElement, Color> onValueChanged)
    Parameters
    Type Name Description
    Color from
    Color to
    Int32 durationMs
    Action<VisualElement, Color> onValueChanged
    Returns
    Type Description
    ValueAnimation<Color>
    Implements
    ITransitionAnimations.Start(Color, Color, Int32, Action<VisualElement, Color>)

    ITransitionAnimations.Start(Func<VisualElement, Color>, Color, Int32, Action<VisualElement, Color>)

    Declaration
    ValueAnimation<Color> ITransitionAnimations.Start(Func<VisualElement, Color> fromValueGetter, Color to, int durationMs, Action<VisualElement, Color> onValueChanged)
    Parameters
    Type Name Description
    Func<VisualElement, Color> fromValueGetter
    Color to
    Int32 durationMs
    Action<VisualElement, Color> onValueChanged
    Returns
    Type Description
    ValueAnimation<Color>
    Implements
    ITransitionAnimations.Start(Func<VisualElement, Color>, Color, Int32, Action<VisualElement, Color>)

    ITransitionAnimations.Start(Func<VisualElement, Quaternion>, Quaternion, Int32, Action<VisualElement, Quaternion>)

    Declaration
    ValueAnimation<Quaternion> ITransitionAnimations.Start(Func<VisualElement, Quaternion> fromValueGetter, Quaternion to, int durationMs, Action<VisualElement, Quaternion> onValueChanged)
    Parameters
    Type Name Description
    Func<VisualElement, Quaternion> fromValueGetter
    Quaternion to
    Int32 durationMs
    Action<VisualElement, Quaternion> onValueChanged
    Returns
    Type Description
    ValueAnimation<Quaternion>
    Implements
    ITransitionAnimations.Start(Func<VisualElement, Quaternion>, Quaternion, Int32, Action<VisualElement, Quaternion>)

    ITransitionAnimations.Start(Func<VisualElement, Rect>, Rect, Int32, Action<VisualElement, Rect>)

    Declaration
    ValueAnimation<Rect> ITransitionAnimations.Start(Func<VisualElement, Rect> fromValueGetter, Rect to, int durationMs, Action<VisualElement, Rect> onValueChanged)
    Parameters
    Type Name Description
    Func<VisualElement, Rect> fromValueGetter
    Rect to
    Int32 durationMs
    Action<VisualElement, Rect> onValueChanged
    Returns
    Type Description
    ValueAnimation<Rect>
    Implements
    ITransitionAnimations.Start(Func<VisualElement, Rect>, Rect, Int32, Action<VisualElement, Rect>)

    ITransitionAnimations.Start(Func<VisualElement, Single>, Single, Int32, Action<VisualElement, Single>)

    Declaration
    ValueAnimation<float> ITransitionAnimations.Start(Func<VisualElement, float> fromValueGetter, float to, int durationMs, Action<VisualElement, float> onValueChanged)
    Parameters
    Type Name Description
    Func<VisualElement, Single> fromValueGetter
    Single to
    Int32 durationMs
    Action<VisualElement, Single> onValueChanged
    Returns
    Type Description
    ValueAnimation<Single>
    Implements
    ITransitionAnimations.Start(Func<VisualElement, Single>, Single, Int32, Action<VisualElement, Single>)

    ITransitionAnimations.Start(Func<VisualElement, Vector2>, Vector2, Int32, Action<VisualElement, Vector2>)

    Declaration
    ValueAnimation<Vector2> ITransitionAnimations.Start(Func<VisualElement, Vector2> fromValueGetter, Vector2 to, int durationMs, Action<VisualElement, Vector2> onValueChanged)
    Parameters
    Type Name Description
    Func<VisualElement, Vector2> fromValueGetter
    Vector2 to
    Int32 durationMs
    Action<VisualElement, Vector2> onValueChanged
    Returns
    Type Description
    ValueAnimation<Vector2>
    Implements
    ITransitionAnimations.Start(Func<VisualElement, Vector2>, Vector2, Int32, Action<VisualElement, Vector2>)

    ITransitionAnimations.Start(Func<VisualElement, Vector3>, Vector3, Int32, Action<VisualElement, Vector3>)

    Declaration
    ValueAnimation<Vector3> ITransitionAnimations.Start(Func<VisualElement, Vector3> fromValueGetter, Vector3 to, int durationMs, Action<VisualElement, Vector3> onValueChanged)
    Parameters
    Type Name Description
    Func<VisualElement, Vector3> fromValueGetter
    Vector3 to
    Int32 durationMs
    Action<VisualElement, Vector3> onValueChanged
    Returns
    Type Description
    ValueAnimation<Vector3>
    Implements
    ITransitionAnimations.Start(Func<VisualElement, Vector3>, Vector3, Int32, Action<VisualElement, Vector3>)

    ITransitionAnimations.Start(Quaternion, Quaternion, Int32, Action<VisualElement, Quaternion>)

    Declaration
    ValueAnimation<Quaternion> ITransitionAnimations.Start(Quaternion from, Quaternion to, int durationMs, Action<VisualElement, Quaternion> onValueChanged)
    Parameters
    Type Name Description
    Quaternion from
    Quaternion to
    Int32 durationMs
    Action<VisualElement, Quaternion> onValueChanged
    Returns
    Type Description
    ValueAnimation<Quaternion>
    Implements
    ITransitionAnimations.Start(Quaternion, Quaternion, Int32, Action<VisualElement, Quaternion>)

    ITransitionAnimations.Start(Rect, Rect, Int32, Action<VisualElement, Rect>)

    Declaration
    ValueAnimation<Rect> ITransitionAnimations.Start(Rect from, Rect to, int durationMs, Action<VisualElement, Rect> onValueChanged)
    Parameters
    Type Name Description
    Rect from
    Rect to
    Int32 durationMs
    Action<VisualElement, Rect> onValueChanged
    Returns
    Type Description
    ValueAnimation<Rect>
    Implements
    ITransitionAnimations.Start(Rect, Rect, Int32, Action<VisualElement, Rect>)

    ITransitionAnimations.Start(Single, Single, Int32, Action<VisualElement, Single>)

    Declaration
    ValueAnimation<float> ITransitionAnimations.Start(float from, float to, int durationMs, Action<VisualElement, float> onValueChanged)
    Parameters
    Type Name Description
    Single from
    Single to
    Int32 durationMs
    Action<VisualElement, Single> onValueChanged
    Returns
    Type Description
    ValueAnimation<Single>
    Implements
    ITransitionAnimations.Start(Single, Single, Int32, Action<VisualElement, Single>)

    ITransitionAnimations.Start(StyleValues, Int32)

    Declaration
    ValueAnimation<StyleValues> ITransitionAnimations.Start(StyleValues to, int durationMs)
    Parameters
    Type Name Description
    StyleValues to
    Int32 durationMs
    Returns
    Type Description
    ValueAnimation<StyleValues>
    Implements
    ITransitionAnimations.Start(StyleValues, Int32)

    ITransitionAnimations.Start(StyleValues, StyleValues, Int32)

    Declaration
    ValueAnimation<StyleValues> ITransitionAnimations.Start(StyleValues from, StyleValues to, int durationMs)
    Parameters
    Type Name Description
    StyleValues from
    StyleValues to
    Int32 durationMs
    Returns
    Type Description
    ValueAnimation<StyleValues>
    Implements
    ITransitionAnimations.Start(StyleValues, StyleValues, Int32)

    ITransitionAnimations.Start(Vector2, Vector2, Int32, Action<VisualElement, Vector2>)

    Declaration
    ValueAnimation<Vector2> ITransitionAnimations.Start(Vector2 from, Vector2 to, int durationMs, Action<VisualElement, Vector2> onValueChanged)
    Parameters
    Type Name Description
    Vector2 from
    Vector2 to
    Int32 durationMs
    Action<VisualElement, Vector2> onValueChanged
    Returns
    Type Description
    ValueAnimation<Vector2>
    Implements
    ITransitionAnimations.Start(Vector2, Vector2, Int32, Action<VisualElement, Vector2>)

    ITransitionAnimations.Start(Vector3, Vector3, Int32, Action<VisualElement, Vector3>)

    Declaration
    ValueAnimation<Vector3> ITransitionAnimations.Start(Vector3 from, Vector3 to, int durationMs, Action<VisualElement, Vector3> onValueChanged)
    Parameters
    Type Name Description
    Vector3 from
    Vector3 to
    Int32 durationMs
    Action<VisualElement, Vector3> onValueChanged
    Returns
    Type Description
    ValueAnimation<Vector3>
    Implements
    ITransitionAnimations.Start(Vector3, Vector3, Int32, Action<VisualElement, Vector3>)

    ITransitionAnimations.TopLeft(Vector2, Int32)

    Declaration
    ValueAnimation<Vector2> ITransitionAnimations.TopLeft(Vector2 to, int durationMs)
    Parameters
    Type Name Description
    Vector2 to
    Int32 durationMs
    Returns
    Type Description
    ValueAnimation<Vector2>
    Implements
    ITransitionAnimations.TopLeft(Vector2, Int32)

    IExperimentalFeatures.animation

    Declaration
    ITransitionAnimations IExperimentalFeatures.animation { get; }
    Returns
    Type Description
    ITransitionAnimations
    Implements
    IExperimentalFeatures.animation

    IResolvedStyle.alignContent

    Declaration
    Align IResolvedStyle.alignContent { get; }
    Returns
    Type Description
    Align
    Implements
    IResolvedStyle.alignContent

    IResolvedStyle.alignItems

    Declaration
    Align IResolvedStyle.alignItems { get; }
    Returns
    Type Description
    Align
    Implements
    IResolvedStyle.alignItems

    IResolvedStyle.alignSelf

    Declaration
    Align IResolvedStyle.alignSelf { get; }
    Returns
    Type Description
    Align
    Implements
    IResolvedStyle.alignSelf

    IResolvedStyle.backgroundColor

    Declaration
    Color IResolvedStyle.backgroundColor { get; }
    Returns
    Type Description
    Color
    Implements
    IResolvedStyle.backgroundColor

    IResolvedStyle.backgroundImage

    Declaration
    Background IResolvedStyle.backgroundImage { get; }
    Returns
    Type Description
    Background
    Implements
    IResolvedStyle.backgroundImage

    IResolvedStyle.borderBottomColor

    Declaration
    Color IResolvedStyle.borderBottomColor { get; }
    Returns
    Type Description
    Color
    Implements
    IResolvedStyle.borderBottomColor

    IResolvedStyle.borderBottomLeftRadius

    Declaration
    float IResolvedStyle.borderBottomLeftRadius { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.borderBottomLeftRadius

    IResolvedStyle.borderBottomRightRadius

    Declaration
    float IResolvedStyle.borderBottomRightRadius { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.borderBottomRightRadius

    IResolvedStyle.borderBottomWidth

    Declaration
    float IResolvedStyle.borderBottomWidth { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.borderBottomWidth

    IResolvedStyle.borderLeftColor

    Declaration
    Color IResolvedStyle.borderLeftColor { get; }
    Returns
    Type Description
    Color
    Implements
    IResolvedStyle.borderLeftColor

    IResolvedStyle.borderLeftWidth

    Declaration
    float IResolvedStyle.borderLeftWidth { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.borderLeftWidth

    IResolvedStyle.borderRightColor

    Declaration
    Color IResolvedStyle.borderRightColor { get; }
    Returns
    Type Description
    Color
    Implements
    IResolvedStyle.borderRightColor

    IResolvedStyle.borderRightWidth

    Declaration
    float IResolvedStyle.borderRightWidth { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.borderRightWidth

    IResolvedStyle.borderTopColor

    Declaration
    Color IResolvedStyle.borderTopColor { get; }
    Returns
    Type Description
    Color
    Implements
    IResolvedStyle.borderTopColor

    IResolvedStyle.borderTopLeftRadius

    Declaration
    float IResolvedStyle.borderTopLeftRadius { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.borderTopLeftRadius

    IResolvedStyle.borderTopRightRadius

    Declaration
    float IResolvedStyle.borderTopRightRadius { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.borderTopRightRadius

    IResolvedStyle.borderTopWidth

    Declaration
    float IResolvedStyle.borderTopWidth { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.borderTopWidth

    IResolvedStyle.bottom

    Declaration
    float IResolvedStyle.bottom { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.bottom

    IResolvedStyle.color

    Declaration
    Color IResolvedStyle.color { get; }
    Returns
    Type Description
    Color
    Implements
    IResolvedStyle.color

    IResolvedStyle.display

    Declaration
    DisplayStyle IResolvedStyle.display { get; }
    Returns
    Type Description
    DisplayStyle
    Implements
    IResolvedStyle.display

    IResolvedStyle.flexBasis

    Declaration
    StyleFloat IResolvedStyle.flexBasis { get; }
    Returns
    Type Description
    StyleFloat
    Implements
    IResolvedStyle.flexBasis

    IResolvedStyle.flexDirection

    Declaration
    FlexDirection IResolvedStyle.flexDirection { get; }
    Returns
    Type Description
    FlexDirection
    Implements
    IResolvedStyle.flexDirection

    IResolvedStyle.flexGrow

    Declaration
    float IResolvedStyle.flexGrow { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.flexGrow

    IResolvedStyle.flexShrink

    Declaration
    float IResolvedStyle.flexShrink { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.flexShrink

    IResolvedStyle.flexWrap

    Declaration
    Wrap IResolvedStyle.flexWrap { get; }
    Returns
    Type Description
    Wrap
    Implements
    IResolvedStyle.flexWrap

    IResolvedStyle.fontSize

    Declaration
    float IResolvedStyle.fontSize { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.fontSize

    IResolvedStyle.height

    Declaration
    float IResolvedStyle.height { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.height

    IResolvedStyle.justifyContent

    Declaration
    Justify IResolvedStyle.justifyContent { get; }
    Returns
    Type Description
    Justify
    Implements
    IResolvedStyle.justifyContent

    IResolvedStyle.left

    Declaration
    float IResolvedStyle.left { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.left

    IResolvedStyle.letterSpacing

    Declaration
    float IResolvedStyle.letterSpacing { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.letterSpacing

    IResolvedStyle.marginBottom

    Declaration
    float IResolvedStyle.marginBottom { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.marginBottom

    IResolvedStyle.marginLeft

    Declaration
    float IResolvedStyle.marginLeft { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.marginLeft

    IResolvedStyle.marginRight

    Declaration
    float IResolvedStyle.marginRight { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.marginRight

    IResolvedStyle.marginTop

    Declaration
    float IResolvedStyle.marginTop { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.marginTop

    IResolvedStyle.maxHeight

    Declaration
    StyleFloat IResolvedStyle.maxHeight { get; }
    Returns
    Type Description
    StyleFloat
    Implements
    IResolvedStyle.maxHeight

    IResolvedStyle.maxWidth

    Declaration
    StyleFloat IResolvedStyle.maxWidth { get; }
    Returns
    Type Description
    StyleFloat
    Implements
    IResolvedStyle.maxWidth

    IResolvedStyle.minHeight

    Declaration
    StyleFloat IResolvedStyle.minHeight { get; }
    Returns
    Type Description
    StyleFloat
    Implements
    IResolvedStyle.minHeight

    IResolvedStyle.minWidth

    Declaration
    StyleFloat IResolvedStyle.minWidth { get; }
    Returns
    Type Description
    StyleFloat
    Implements
    IResolvedStyle.minWidth

    IResolvedStyle.opacity

    Declaration
    float IResolvedStyle.opacity { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.opacity

    IResolvedStyle.paddingBottom

    Declaration
    float IResolvedStyle.paddingBottom { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.paddingBottom

    IResolvedStyle.paddingLeft

    Declaration
    float IResolvedStyle.paddingLeft { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.paddingLeft

    IResolvedStyle.paddingRight

    Declaration
    float IResolvedStyle.paddingRight { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.paddingRight

    IResolvedStyle.paddingTop

    Declaration
    float IResolvedStyle.paddingTop { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.paddingTop

    IResolvedStyle.position

    Declaration
    Position IResolvedStyle.position { get; }
    Returns
    Type Description
    Position
    Implements
    IResolvedStyle.position

    IResolvedStyle.right

    Declaration
    float IResolvedStyle.right { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.right

    IResolvedStyle.textOverflow

    Declaration
    TextOverflow IResolvedStyle.textOverflow { get; }
    Returns
    Type Description
    TextOverflow
    Implements
    IResolvedStyle.textOverflow

    IResolvedStyle.top

    Declaration
    float IResolvedStyle.top { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.top

    IResolvedStyle.unityBackgroundImageTintColor

    Declaration
    Color IResolvedStyle.unityBackgroundImageTintColor { get; }
    Returns
    Type Description
    Color
    Implements
    IResolvedStyle.unityBackgroundImageTintColor

    IResolvedStyle.unityBackgroundScaleMode

    Declaration
    ScaleMode IResolvedStyle.unityBackgroundScaleMode { get; }
    Returns
    Type Description
    ScaleMode
    Implements
    IResolvedStyle.unityBackgroundScaleMode

    IResolvedStyle.unityFont

    Declaration
    Font IResolvedStyle.unityFont { get; }
    Returns
    Type Description
    Font
    Implements
    IResolvedStyle.unityFont

    IResolvedStyle.unityFontDefinition

    Declaration
    FontDefinition IResolvedStyle.unityFontDefinition { get; }
    Returns
    Type Description
    FontDefinition
    Implements
    IResolvedStyle.unityFontDefinition

    IResolvedStyle.unityFontStyleAndWeight

    Declaration
    FontStyle IResolvedStyle.unityFontStyleAndWeight { get; }
    Returns
    Type Description
    FontStyle
    Implements
    IResolvedStyle.unityFontStyleAndWeight

    IResolvedStyle.unityParagraphSpacing

    Declaration
    float IResolvedStyle.unityParagraphSpacing { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.unityParagraphSpacing

    IResolvedStyle.unitySliceBottom

    Declaration
    int IResolvedStyle.unitySliceBottom { get; }
    Returns
    Type Description
    Int32
    Implements
    IResolvedStyle.unitySliceBottom

    IResolvedStyle.unitySliceLeft

    Declaration
    int IResolvedStyle.unitySliceLeft { get; }
    Returns
    Type Description
    Int32
    Implements
    IResolvedStyle.unitySliceLeft

    IResolvedStyle.unitySliceRight

    Declaration
    int IResolvedStyle.unitySliceRight { get; }
    Returns
    Type Description
    Int32
    Implements
    IResolvedStyle.unitySliceRight

    IResolvedStyle.unitySliceTop

    Declaration
    int IResolvedStyle.unitySliceTop { get; }
    Returns
    Type Description
    Int32
    Implements
    IResolvedStyle.unitySliceTop

    IResolvedStyle.unityTextAlign

    Declaration
    TextAnchor IResolvedStyle.unityTextAlign { get; }
    Returns
    Type Description
    TextAnchor
    Implements
    IResolvedStyle.unityTextAlign

    IResolvedStyle.unityTextOutlineColor

    Declaration
    Color IResolvedStyle.unityTextOutlineColor { get; }
    Returns
    Type Description
    Color
    Implements
    IResolvedStyle.unityTextOutlineColor

    IResolvedStyle.unityTextOutlineWidth

    Declaration
    float IResolvedStyle.unityTextOutlineWidth { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.unityTextOutlineWidth

    IResolvedStyle.unityTextOverflowPosition

    Declaration
    TextOverflowPosition IResolvedStyle.unityTextOverflowPosition { get; }
    Returns
    Type Description
    TextOverflowPosition
    Implements
    IResolvedStyle.unityTextOverflowPosition

    IResolvedStyle.visibility

    Declaration
    Visibility IResolvedStyle.visibility { get; }
    Returns
    Type Description
    Visibility
    Implements
    IResolvedStyle.visibility

    IResolvedStyle.whiteSpace

    Declaration
    WhiteSpace IResolvedStyle.whiteSpace { get; }
    Returns
    Type Description
    WhiteSpace
    Implements
    IResolvedStyle.whiteSpace

    IResolvedStyle.width

    Declaration
    float IResolvedStyle.width { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.width

    IResolvedStyle.wordSpacing

    Declaration
    float IResolvedStyle.wordSpacing { get; }
    Returns
    Type Description
    Single
    Implements
    IResolvedStyle.wordSpacing

    ITransform.matrix

    Declaration
    Matrix4x4 ITransform.matrix { get; }
    Returns
    Type Description
    Matrix4x4
    Implements
    ITransform.matrix

    ITransform.position

    Declaration
    Vector3 ITransform.position { get; set; }
    Returns
    Type Description
    Vector3
    Implements
    ITransform.position

    ITransform.rotation

    Declaration
    Quaternion ITransform.rotation { get; set; }
    Returns
    Type Description
    Quaternion
    Implements
    ITransform.rotation

    ITransform.scale

    Declaration
    Vector3 ITransform.scale { get; set; }
    Returns
    Type Description
    Vector3
    Implements
    ITransform.scale

    IVisualElementScheduler.Execute(Action)

    Declaration
    IVisualElementScheduledItem IVisualElementScheduler.Execute(Action updateEvent)
    Parameters
    Type Name Description
    Action updateEvent
    Returns
    Type Description
    IVisualElementScheduledItem
    Implements
    IVisualElementScheduler.Execute(Action)

    IVisualElementScheduler.Execute(Action<TimerState>)

    Declaration
    IVisualElementScheduledItem IVisualElementScheduler.Execute(Action<TimerState> timerUpdateEvent)
    Parameters
    Type Name Description
    Action<TimerState> timerUpdateEvent
    Returns
    Type Description
    IVisualElementScheduledItem
    Implements
    IVisualElementScheduler.Execute(Action<TimerState>)

    Extension Methods

    UQueryExtensions.Q<T>(VisualElement, String, String[])
    UQueryExtensions.Q(VisualElement, String, String[])
    UQueryExtensions.Q<T>(VisualElement, String, String)
    UQueryExtensions.Q(VisualElement, String, String)
    UQueryExtensions.Query(VisualElement, String, String[])
    UQueryExtensions.Query(VisualElement, String, String)
    UQueryExtensions.Query<T>(VisualElement, String, String[])
    UQueryExtensions.Query<T>(VisualElement, String, String)
    UQueryExtensions.Query(VisualElement)
    VisualElementExtensions.StretchToParentSize(VisualElement)
    VisualElementExtensions.StretchToParentWidth(VisualElement)
    VisualElementExtensions.AddManipulator(VisualElement, IManipulator)
    VisualElementExtensions.RemoveManipulator(VisualElement, IManipulator)
    VisualElementExtensions.WorldToLocal(VisualElement, Vector2)
    VisualElementExtensions.LocalToWorld(VisualElement, Vector2)
    VisualElementExtensions.WorldToLocal(VisualElement, Rect)
    VisualElementExtensions.LocalToWorld(VisualElement, Rect)
    VisualElementExtensions.ChangeCoordinatesTo(VisualElement, VisualElement, Vector2)
    VisualElementExtensions.ChangeCoordinatesTo(VisualElement, VisualElement, Rect)
    BindingExtensions.Bind(VisualElement, SerializedObject)
    BindingExtensions.Unbind(VisualElement)
    BindingExtensions.TrackPropertyValue(VisualElement, SerializedProperty, Action<SerializedProperty>)
    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