Class VisualElement
Inheritance
VisualElement
Assembly: UnityEngine.dll
Syntax
public class VisualElement : Focusable, IEventHandler, ITransform, IUIElementDataWatch, IEnumerable<VisualElement>, IEnumerable, IVisualElementScheduler, IStyle
Constructors
|
Improve this Doc
View Source
VisualElement()
Declaration
Fields
|
Improve this Doc
View Source
defaultFocusIndex
Declaration
public static readonly int defaultFocusIndex
Field Value
Properties
|
Improve this Doc
View Source
canGrabFocus
Declaration
public override bool canGrabFocus { get; }
Property Value
Overrides
|
Improve this Doc
View Source
childCount
Declaration
public int childCount { get; }
Property Value
|
Improve this Doc
View Source
clippingOptions
Declaration
public VisualElement.ClippingOptions clippingOptions { get; set; }
Property Value
|
Improve this Doc
View Source
contentContainer
Declaration
public virtual VisualElement contentContainer { get; }
Property Value
|
Improve this Doc
View Source
contentRect
Declaration
public Rect contentRect { get; }
Property Value
|
Improve this Doc
View Source
dataWatch
Declaration
public IUIElementDataWatch dataWatch { get; }
Property Value
|
Improve this Doc
View Source
enabled
Declaration
[Obsolete("enabled is deprecated. Use SetEnabled as setter, and enabledSelf/enabledInHierarchy as getters.")]
public virtual bool enabled { get; set; }
Property Value
|
Improve this Doc
View Source
enabledInHierarchy
Declaration
public bool enabledInHierarchy { get; }
Property Value
|
Improve this Doc
View Source
enabledSelf
Declaration
public bool enabledSelf { get; }
Property Value
|
Improve this Doc
View Source
focusController
Declaration
public override FocusController focusController { get; }
Property Value
Overrides
|
Improve this Doc
View Source
Item[Int32]
Declaration
public VisualElement this[int key] { get; }
Parameters
Type |
Name |
Description |
Int32 |
key |
|
Property Value
|
Improve this Doc
View Source
layout
Declaration
public Rect layout { get; set; }
Property Value
|
Improve this Doc
View Source
localBound
AABB after applying the transform to the rect, but before applying the layout translation.
Declaration
public Rect localBound { get; }
Property Value
|
Improve this Doc
View Source
name
Declaration
public string name { get; set; }
Property Value
|
Improve this Doc
View Source
paddingRect
Declaration
protected Rect paddingRect { get; }
Property Value
|
Improve this Doc
View Source
panel
Declaration
public IPanel panel { get; }
Property Value
|
Improve this Doc
View Source
parent
Declaration
public VisualElement parent { get; }
Property Value
|
Improve this Doc
View Source
persistenceKey
Declaration
public string persistenceKey { get; set; }
Property Value
|
Improve this Doc
View Source
pickingMode
Declaration
public PickingMode pickingMode { get; set; }
Property Value
|
Improve this Doc
View Source
schedule
Declaration
public IVisualElementScheduler schedule { get; }
Property Value
|
Improve this Doc
View Source
shadow
Declaration
public VisualElement.Hierarchy shadow { get; }
Property Value
|
Improve this Doc
View Source
style
Declaration
public IStyle style { get; }
Property Value
|
Improve this Doc
View Source
Declaration
public string tooltip { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public ITransform transform { get; }
Property Value
|
Improve this Doc
View Source
userData
Declaration
public object userData { get; set; }
Property Value
|
Improve this Doc
View Source
visible
Declaration
public bool visible { get; set; }
Property Value
|
Improve this Doc
View Source
worldBound
AABB after applying the world transform to rect
.
Declaration
public Rect worldBound { get; }
Property Value
|
Improve this Doc
View Source
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
Methods
|
Improve this Doc
View Source
Add(VisualElement)
Declaration
public void Add(VisualElement child)
Parameters
|
Improve this Doc
View Source
AddStyleSheetPath(String)
Declaration
public void AddStyleSheetPath(string sheetPath)
Parameters
Type |
Name |
Description |
String |
sheetPath |
|
|
Improve this Doc
View Source
AddToClassList(String)
Declaration
public void AddToClassList(string className)
Parameters
Type |
Name |
Description |
String |
className |
|
|
Improve this Doc
View Source
AnyDirty(ChangeType)
Declaration
[Obsolete("AnyDirty is deprecated. Avoid using it, will always return false.")]
public bool AnyDirty(ChangeType type)
Parameters
Returns
|
Improve this Doc
View Source
BringToFront()
Declaration
public void BringToFront()
|
Improve this Doc
View Source
Children()
Declaration
public IEnumerable<VisualElement> Children()
Returns
|
Improve this Doc
View Source
ClassListContains(String)
Declaration
public bool ClassListContains(string cls)
Parameters
Type |
Name |
Description |
String |
cls |
|
Returns
|
Improve this Doc
View Source
Clear()
Declaration
|
Improve this Doc
View Source
ClearClassList()
Declaration
public void ClearClassList()
|
Improve this Doc
View Source
ClearDirty(ChangeType)
Declaration
[Obsolete("ClearDirty is deprecated. Avoid using it, it's now a no-op.")]
public void ClearDirty(ChangeType type)
Parameters
|
Improve this Doc
View Source
Contains(VisualElement)
Declaration
public bool Contains(VisualElement child)
Parameters
Returns
|
Improve this Doc
View Source
ContainsPoint(Vector2)
Declaration
public virtual bool ContainsPoint(Vector2 localPoint)
Parameters
Type |
Name |
Description |
Vector2 |
localPoint |
|
Returns
|
Improve this Doc
View Source
Dirty(ChangeType)
Declaration
[Obsolete("Dirty is deprecated. Use MarkDirtyRepaint to trigger a new repaint of the VisualElement.")]
public void Dirty(ChangeType type)
Parameters
|
Improve this Doc
View Source
DoMeasure(Single, VisualElement.MeasureMode, Single, VisualElement.MeasureMode)
Declaration
protected virtual Vector2 DoMeasure(float width, VisualElement.MeasureMode widthMode, float height, VisualElement.MeasureMode heightMode)
Parameters
Returns
|
Improve this Doc
View Source
DoRepaint(IStylePainter)
Declaration
protected virtual void DoRepaint(IStylePainter painter)
Parameters
|
Improve this Doc
View Source
ElementAt(Int32)
Declaration
public VisualElement ElementAt(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Returns
|
Improve this Doc
View Source
EnableInClassList(String, Boolean)
Declaration
public void EnableInClassList(string className, bool enable)
Parameters
|
Improve this Doc
View Source
ExecuteDefaultAction(EventBase)
Declaration
protected override void ExecuteDefaultAction(EventBase evt)
Parameters
Overrides
|
Improve this Doc
View Source
FindAncestorUserData()
Declaration
public object FindAncestorUserData()
Returns
|
Improve this Doc
View Source
FindCommonAncestor(VisualElement)
Declaration
public VisualElement FindCommonAncestor(VisualElement other)
Parameters
Returns
|
Improve this Doc
View Source
Focus()
Declaration
public override sealed void Focus()
Overrides
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IEnumerator<VisualElement> GetEnumerator()
Returns
|
Improve this Doc
View Source
GetFirstAncestorOfType<T>()
Declaration
public T GetFirstAncestorOfType<T>()
where T : class
Returns
Type Parameters
|
Improve this Doc
View Source
GetFirstOfType<T>()
Declaration
public T GetFirstOfType<T>()
where T : class
Returns
Type Parameters
|
Improve this Doc
View Source
GetFullHierarchicalPersistenceKey()
Declaration
public string GetFullHierarchicalPersistenceKey()
Returns
|
Improve this Doc
View Source
GetOrCreatePersistentData<T>(Object, String)
Declaration
public T GetOrCreatePersistentData<T>(object existing, string key)
where T : class, new()
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
GetOrCreatePersistentData<T>(ScriptableObject, String)
Declaration
public T GetOrCreatePersistentData<T>(ScriptableObject existing, string key)
where T : ScriptableObject
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
HasStyleSheetPath(String)
Declaration
public bool HasStyleSheetPath(string sheetPath)
Parameters
Type |
Name |
Description |
String |
sheetPath |
|
Returns
|
Improve this Doc
View Source
IndexOf(VisualElement)
Declaration
public int IndexOf(VisualElement element)
Parameters
Returns
|
Improve this Doc
View Source
Insert(Int32, VisualElement)
Declaration
public void Insert(int index, VisualElement element)
Parameters
|
Improve this Doc
View Source
IsDirty(ChangeType)
Declaration
[Obsolete("IsDirty is deprecated. Avoid using it, will always return false.")]
public bool IsDirty(ChangeType type)
Parameters
Returns
|
Improve this Doc
View Source
MarkDirtyRepaint()
Declaration
public void MarkDirtyRepaint()
|
Improve this Doc
View Source
OnPersistentDataReady()
Declaration
public virtual void OnPersistentDataReady()
|
Improve this Doc
View Source
OnStyleResolved(ICustomStyle)
Declaration
protected virtual void OnStyleResolved(ICustomStyle style)
Parameters
|
Improve this Doc
View Source
Overlaps(Rect)
Declaration
public virtual bool Overlaps(Rect rectangle)
Parameters
Type |
Name |
Description |
Rect |
rectangle |
|
Returns
|
Improve this Doc
View Source
OverwriteFromPersistedData(Object, String)
Declaration
public void OverwriteFromPersistedData(object obj, string key)
Parameters
|
Improve this Doc
View Source
PlaceBehind(VisualElement)
Declaration
public void PlaceBehind(VisualElement sibling)
Parameters
|
Improve this Doc
View Source
PlaceInFront(VisualElement)
Declaration
public void PlaceInFront(VisualElement sibling)
Parameters
|
Improve this Doc
View Source
Remove(VisualElement)
Declaration
public void Remove(VisualElement element)
Parameters
|
Improve this Doc
View Source
RemoveAt(Int32)
Declaration
public void RemoveAt(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
|
Improve this Doc
View Source
RemoveFromClassList(String)
Declaration
public void RemoveFromClassList(string className)
Parameters
Type |
Name |
Description |
String |
className |
|
|
Improve this Doc
View Source
RemoveFromHierarchy()
Will remove this element from its hierarchy
Declaration
public void RemoveFromHierarchy()
|
Improve this Doc
View Source
RemoveStyleSheetPath(String)
Declaration
public void RemoveStyleSheetPath(string sheetPath)
Parameters
Type |
Name |
Description |
String |
sheetPath |
|
|
Improve this Doc
View Source
ResetPositionProperties()
Declaration
public void ResetPositionProperties()
|
Improve this Doc
View Source
SavePersistentData()
Declaration
public void SavePersistentData()
|
Improve this Doc
View Source
SendEvent(EventBase)
Declaration
public override sealed void SendEvent(EventBase e)
Parameters
Overrides
|
Improve this Doc
View Source
SendToBack()
Declaration
|
Improve this Doc
View Source
SetEnabled(Boolean)
Declaration
public void SetEnabled(bool value)
Parameters
Type |
Name |
Description |
Boolean |
value |
|
|
Improve this Doc
View Source
SetEnabledFromHierarchy(Boolean)
Declaration
protected bool SetEnabledFromHierarchy(bool state)
Parameters
Type |
Name |
Description |
Boolean |
state |
|
Returns
|
Improve this Doc
View Source
SetSize(Vector2)
Declaration
public void SetSize(Vector2 size)
Parameters
|
Improve this Doc
View Source
Sort(Comparison<VisualElement>)
Declaration
public void Sort(Comparison<VisualElement> comp)
Parameters
|
Improve this Doc
View Source
ToggleInClassList(String)
Declaration
public void ToggleInClassList(string className)
Parameters
Type |
Name |
Description |
String |
className |
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
Explicit Interface Implementations
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
|
Improve this Doc
View Source
IStyle.alignContent
Declaration
StyleValue<Align> IStyle.alignContent { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.alignItems
Declaration
StyleValue<Align> IStyle.alignItems { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.alignSelf
Declaration
StyleValue<Align> IStyle.alignSelf { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.backgroundColor
Declaration
StyleValue<Color> IStyle.backgroundColor { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.backgroundImage
Declaration
StyleValue<Texture2D> IStyle.backgroundImage { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.backgroundScaleMode
Declaration
StyleValue<ScaleMode> IStyle.backgroundScaleMode { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.backgroundSize
Declaration
[Obsolete("Use backgroundScaleMode instead")]
StyleValue<ScaleMode> IStyle.backgroundSize { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderBottom
Declaration
[Obsolete("Use borderBottomWidth instead")]
StyleValue<float> IStyle.borderBottom { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderBottomLeftRadius
Declaration
StyleValue<float> IStyle.borderBottomLeftRadius { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderBottomRightRadius
Declaration
StyleValue<float> IStyle.borderBottomRightRadius { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderBottomWidth
Declaration
StyleValue<float> IStyle.borderBottomWidth { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderColor
Declaration
StyleValue<Color> IStyle.borderColor { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderLeft
Declaration
[Obsolete("Use borderLeftWidth instead")]
StyleValue<float> IStyle.borderLeft { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderLeftWidth
Declaration
StyleValue<float> IStyle.borderLeftWidth { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderRadius
Declaration
StyleValue<float> IStyle.borderRadius { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderRight
Declaration
[Obsolete("Use borderRightWidth instead")]
StyleValue<float> IStyle.borderRight { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderRightWidth
Declaration
StyleValue<float> IStyle.borderRightWidth { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderTop
Declaration
[Obsolete("Use borderTopWidth instead")]
StyleValue<float> IStyle.borderTop { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderTopLeftRadius
Declaration
StyleValue<float> IStyle.borderTopLeftRadius { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderTopRightRadius
Declaration
StyleValue<float> IStyle.borderTopRightRadius { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.borderTopWidth
Declaration
StyleValue<float> IStyle.borderTopWidth { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.color
Declaration
StyleValue<Color> IStyle.color { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.cursor
Declaration
StyleValue<CursorStyle> IStyle.cursor { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.flex
Declaration
StyleValue<Flex> IStyle.flex { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.flexBasis
Declaration
StyleValue<float> IStyle.flexBasis { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.flexDirection
Declaration
StyleValue<FlexDirection> IStyle.flexDirection { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.flexGrow
Declaration
StyleValue<float> IStyle.flexGrow { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.flexShrink
Declaration
StyleValue<float> IStyle.flexShrink { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.flexWrap
Declaration
StyleValue<Wrap> IStyle.flexWrap { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.font
Declaration
StyleValue<Font> IStyle.font { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.fontSize
Declaration
StyleValue<int> IStyle.fontSize { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.fontStyle
Declaration
[Obsolete("Use fontStyleAndWeight instead")]
StyleValue<FontStyle> IStyle.fontStyle { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.fontStyleAndWeight
Declaration
StyleValue<FontStyle> IStyle.fontStyleAndWeight { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.height
Declaration
StyleValue<float> IStyle.height { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.justifyContent
Declaration
StyleValue<Justify> IStyle.justifyContent { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.marginBottom
Declaration
StyleValue<float> IStyle.marginBottom { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.marginLeft
Declaration
StyleValue<float> IStyle.marginLeft { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.marginRight
Declaration
StyleValue<float> IStyle.marginRight { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.marginTop
Declaration
StyleValue<float> IStyle.marginTop { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.maxHeight
Declaration
StyleValue<float> IStyle.maxHeight { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.maxWidth
Declaration
StyleValue<float> IStyle.maxWidth { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.minHeight
Declaration
StyleValue<float> IStyle.minHeight { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.minWidth
Declaration
StyleValue<float> IStyle.minWidth { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.opacity
Declaration
StyleValue<float> IStyle.opacity { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.overflow
Declaration
StyleValue<Overflow> IStyle.overflow { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.paddingBottom
Declaration
StyleValue<float> IStyle.paddingBottom { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.paddingLeft
Declaration
StyleValue<float> IStyle.paddingLeft { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.paddingRight
Declaration
StyleValue<float> IStyle.paddingRight { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.paddingTop
Declaration
StyleValue<float> IStyle.paddingTop { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.positionBottom
Declaration
StyleValue<float> IStyle.positionBottom { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.positionLeft
Declaration
StyleValue<float> IStyle.positionLeft { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.positionRight
Declaration
StyleValue<float> IStyle.positionRight { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.positionTop
Declaration
StyleValue<float> IStyle.positionTop { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.positionType
Declaration
StyleValue<PositionType> IStyle.positionType { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.sliceBottom
Declaration
StyleValue<int> IStyle.sliceBottom { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.sliceLeft
Declaration
StyleValue<int> IStyle.sliceLeft { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.sliceRight
Declaration
StyleValue<int> IStyle.sliceRight { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.sliceTop
Declaration
StyleValue<int> IStyle.sliceTop { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.textAlignment
Declaration
[Obsolete("Use unityTextAlign instead")]
StyleValue<TextAnchor> IStyle.textAlignment { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.textClipping
Declaration
StyleValue<TextClipping> IStyle.textClipping { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.textColor
Declaration
[Obsolete("Use color instead")]
StyleValue<Color> IStyle.textColor { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.unityTextAlign
Declaration
StyleValue<TextAnchor> IStyle.unityTextAlign { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.visibility
Declaration
StyleValue<Visibility> IStyle.visibility { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.width
Declaration
StyleValue<float> IStyle.width { get; set; }
Returns
|
Improve this Doc
View Source
IStyle.wordWrap
Declaration
StyleValue<bool> IStyle.wordWrap { get; set; }
Returns
|
Improve this Doc
View Source
Declaration
Matrix4x4 ITransform.matrix { get; }
Returns
|
Improve this Doc
View Source
Declaration
Vector3 ITransform.position { get; set; }
Returns
|
Improve this Doc
View Source
Declaration
Quaternion ITransform.rotation { get; set; }
Returns
|
Improve this Doc
View Source
Declaration
Vector3 ITransform.scale { get; set; }
Returns
|
Improve this Doc
View Source
IUIElementDataWatch.RegisterWatch(Object, Action<Object>)
Declaration
IUIElementDataWatchRequest IUIElementDataWatch.RegisterWatch(Object toWatch, Action<Object> watchNotification)
Parameters
Returns
|
Improve this Doc
View Source
IUIElementDataWatch.UnregisterWatch(IUIElementDataWatchRequest)
Declaration
void IUIElementDataWatch.UnregisterWatch(IUIElementDataWatchRequest requested)
Parameters
|
Improve this Doc
View Source
IVisualElementScheduler.Execute(Action)
Declaration
IVisualElementScheduledItem IVisualElementScheduler.Execute(Action updateEvent)
Parameters
Type |
Name |
Description |
Action |
updateEvent |
|
Returns
|
Improve this Doc
View Source
IVisualElementScheduler.Execute(Action<TimerState>)
Declaration
IVisualElementScheduledItem IVisualElementScheduler.Execute(Action<TimerState> timerUpdateEvent)
Parameters
Returns
Implements
Extension Methods