This topic details the UXML elements available in the UnityEngine.Experimental.UIElements
and UnityEditor.Experimental.UIElements
namespaces.
VisualElement
Base class for all visual elements.
UnityEngine.Experimental.UIElements
VisualElement
class
: a list of space separated namesstyle
: USS directives for styling the elementname
: a unique string identifier for this elementfocus-index
: an integer used to determine the focus order when tabbing; default value is -1
meaning that the element is not focusablepicking-mode
: Position
or Ignore
; default value is Position
tooltip
: a string displayed when the mouse hovers the elementslot-name
: defines this elements as a slotslot
: when the element is inside an <Instance>
, move the element inside the slot referenced by this attributeBindableElement
An element that can be bound to a SerializedProperty
. The value of the property and the value displayed are synchronized.
UnityEngine.Experimental.UIElements
VisualElement
VisualElement
binding-path
: the path of the property this element is bound toBox
Similar to VisualElement
but draws a box around its content.
UnityEngine.Experimental.UIElements
VisualElement
VisualElement
TextElement
An element that displays text.
UnityEngine.Experimental.UIElements
VisualElement
text
: the text displayed by the elementLabel
A text label.
UnityEngine.Experimental.UIElements
TextElement
Image
Displays an image.
UnityEngine.Experimental.UIElements
VisualElement
IMGUIContainer
Elements that draws IMGUI content.
UnityEngine.Experimental.UIElements
VisualElement
focus-index
default value is 0
Foldout
Element that has a toggle button to show or hide its content.
UnityEngine.Experimental.UIElements
VisualElement
BindableElement
Template
A reference to another UXML template that can be instantiated using the Instance
element.
UnityEngine.Experimental.UIElements
name
: a unique string identifier for this elementpath
: the path of the UXML file to loadInstance
Instance of a Template
.
UnityEngine.Experimental.UIElements
template
: the name
of the Template
to instantiateButton
A standard push button.
UnityEngine.Experimental.UIElements
TextElement
RepeatButton
A button that executes an action repeatedly while pressed.
UnityEngine.Experimental.UIElements
TextElement
delay
: the initial delay in milliseconds before the action is executed;
default value is 0
interval
: the interval in milliseconds between each action repetition;
default value is 0
Toggle
A toggle button (checkbox).
UnityEngine.Experimental.UIElements
BindableElement
focus-index
default value is 0
label
: the text label for the togglevalue
: a boolean indicating whether the toggle in on or off.Scroller
A scroll bar.
UnityEngine.Experimental.UIElements
VisualElement
low-value
: minimum value of the scrollerhigh-value
: maximum value of the scrollerdirection
: Horizontal
or Vertical
; default is Vertical
value
: the position of the scroller cursorScrollerButton
A button at the end of a scroll bar.
UnityEngine.Experimental.UIElements
VisualElement
delay
: the initial delay in milliseconds before the action is executed;
default value is 0
interval
: the interval in milliseconds between each action repetition;
default value is 0
Slider
A slider.
UnityEngine.Experimental.UIElements
BindableElement
low-value
: minimum value of the sliderhigh-value
: maximum value of the sliderdirection
: Horizontal
or Vertical
; default is Vertical
page-size
: page size of the slidervalue
: the position of the slider cursorSliderInt
A slider for integer values.
UnityEngine.Experimental.UIElements
BindableElement
low-value
: minimum value of the sliderhigh-value
: maximum value of the sliderdirection
: Horizontal
or Vertical
; default is Vertical
page-size
: page size of the slidervalue
: the position of the slider cursorMinMaxSlider
A slider that let the user specify a minimum and a maximum value.
UnityEngine.Experimental.UIElements
BindableElement
low-limit
: minimum value of the scrollerhigh-limit
: maximum value of the scrollermin-value
: the minimum value of the slider cursormax-value
: the maximum value of the slider cursorEnumField
A field that can only take the string values of an underlying Enum
.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
type
: required, a string representing the C# type of the underlying Enum
value
: a string representing the value of the fieldMaskField
A popup menu that enables the user to select a group of values.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
choices
: a comma separated list of up to 32 choices to display in the popup menuvalue
: an integer representing the value of the field as a 32 bits mask.LayerField
A popup menu that enables the user to select a layerLayers in Unity can be used to selectively opt groups of GameObjects in or out of certain processes or calculations. This includes camera rendering, lighting, physics collisions, or custom calculations in your own code. More info
See in Glossary.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
value
: an integer representing the value of the field (the selected layer number).LayerMaskField
A popup menu that enables the user to select a group of layers.
UnityEditor.Experimental.UIElements
MaskField
TagField
A popup menu that enables the user to select a tagA reference word which you can assign to one or more GameObjects to help you identify GameObjects for scripting purposes. For example, you might define and “Edible” Tag for any item the player can eat in your game. More info
See in Glossary.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
value
: a string representing the value of the field (the selected tag name).TextField
An editable text field.
UnityEngine.Experimental.UIElements
BindableElement
focus-index
default value is 0
text
: the text value of the fieldmax-length
: the maximum number of characters that the field can contains. Default value of -1
sets no limits on the text length.password
: a boolean indicating whether the field content should be
shown (false
, the default) or displayed using the maskCharacter
character.mask-character
: character used to display the field content when password
is true
. Default is the character *
.multiline
: a boolean indicating whether the text field displays its text on multiple lines (true
) or on a single line, ignoring any line break in the text (false
, the default).IntegerField
A text field accepting an integer (32 bits) value.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
value
: the value of the fieldtext
: the text value of the fieldmax-length
: the maximum number of characters that the field can contains.
Default value of -1
sets no limits on the text length.password
: a boolean indicating whether the field content should be
shown (false
, the default) or displayed using the maskCharacter
character.mask-character
: character used to display the field content when password
is true
. Default is the character *
.LongField
A text field accepting a long integer (64 bits) value.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
value
: the value of the fieldtext
: the text value of the fieldmax-length
: the maximum number of characters that the field can contains.
Default value of -1
sets no limits on the text length.password
: a boolean indicating whether the field content should be
shown (false
, the default) or displayed using the maskCharacter
character.mask-character
: character used to display the field content when password
is
true
. Default is the character *
.FloatField
A text field accepting a single precision floating point value.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
value
: the value of the fieldtext
: the text value of the fieldmax-length
: the maximum number of characters that the field can contains.
Default value of -1
sets no limits on the text length.password
: a boolean indicating whether the field content should be
shown (false
, the default) or displayed using the maskCharacter
character.mask-character
: character used to display the field content when password
is
true
. Default is the character *
.DoubleField
A text field accepting a double precision floating point value.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
value
: the value of the fieldtext
: the text value of the fieldmax-length
: the maximum number of characters that the field can contains.
Default value of -1
sets no limits on the text length.password
: a boolean indicating whether the field content should be
shown (false
, the default) or displayed using the maskCharacter
character.mask-character
: character used to display the field content when password
is
true
. Default is the character *
.Vector2Field
A set of two text fields accepting floating point values to
edit the value of a Vector2
.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
x
: the value of the X coordinatey
: the value of the Y coordinateVector2IntField
A set of two text fields accepting integer values to
edit the value of a Vector2Int
.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
x
: the value of the X coordinatey
: the value of the Y coordinateVector3Field
A set of three text fields accepting floating point values to
edit the value of a Vector3
.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
x
: the value of the X coordinatey
: the value of the Y coordinatez
: the value of the Z coordinateVector3IntField
A set of three text fields accepting integer values to
edit the value of a Vector3Int
.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
x
: the value of the X coordinatey
: the value of the Y coordinatez
: the value of the Z coordinateVector4Field
A set of four text fields accepting floating point values to
edit the value of a Vector4
.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
x
: the value of the X coordinatey
: the value of the Y coordinatez
: the value of the Z coordinatew
: the value of the W coordinateRectField
A set of four text fields accepting floating point values to edit the value of a rectangle.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
x
: the value of the top left corner X coordinatey
: the value of the top left corner Y coordinatew
: the width of the rectangleh
: the height of the rectangleRectIntField
A set of four text fields accepting integer values to edit the value of a rectangle.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
x
: the value of the top left corner X coordinatey
: the value of the top left corner Y coordinatew
: the width of the rectangleh
: the height of the rectangleBoundsField
A set of six text fields accepting floating point values to edit the value of a bounding rectangle.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
cx
: the value of the center X coordinatecy
: the value of the center Y coordinatecz
: the value of the center Z coordinateex
: the value of the extent X coordinateey
: the value of the extent Y coordinateez
: the value of the extent Z coordinateBoundsIntField
A set of six text fields accepting integer values to edit the value of a bounding rectangle.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
px
: the value of the center X coordinatepy
: the value of the center Y coordinatepz
: the value of the center Z coordinatesx
: the value of the extent X coordinatesy
: the value of the extent Y coordinatesz
: the value of the extent Z coordinatePropertyField
A label and a field to edit a value.
UnityEditor.Experimental.UIElements
VisualElement
focus-index
default value is 0
binding-path
: the path of the property this element is bound tolabel
: the label for the fieldColorField
A color picker field.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
value
: the color value, as a Color
show-eye-dropper
: a boolean indicating whether to show (true
, the default) the eye dropper or not (false
).show-alpha
: a boolean indicating whether to show the alpha control (true
, the default) or not (false
)hdr
: a boolean indicating whether to use the high dynamic range color picker (true
) or the normal one (false
, the default)CurveField
A curve editor field.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
GradientField
A gradient editor field.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
ObjectField
An object selector field.
UnityEditor.Experimental.UIElements
BindableElement
focus-index
default value is 0
allow-scene-objects
: a boolean indicating whether objects from the sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More infotrue
, the default) or not (false
)InspectorElement
An element that displays a property in an inspectorA Unity window that displays information about the currently selected GameObject, Asset or Project Settings, allowing you to inspect and edit the values. More info
See in Glossary window.
UnityEditor.Experimental.UIElements
VisualElement
BindableElement
Toolbar
A container to hold toolbarA row of buttons and basic controls at the top of the Unity Editor that allows you to interact with the Editor in various ways (e.g. scaling, translation). More info
See in Glossary items.
UnityEditor.Experimental.UIElements
VisualElement
VisualElement
ToolbarButton
A button for the toolbar.
UnityEditor.Experimental.UIElements
Button
ToolbarToggle
A toggle for the toolbar.
UnityEditor.Experimental.UIElements
Toggle
ToolbarMenu
A drop down menu for the toolbar. The menu has a single arrow pointing down.
UnityEditor.Experimental.UIElements
TextElement
ToolbarPopup
A popup menu for the toolbar. The menu has a two arrows pointing up and down.
UnityEditor.Experimental.UIElements
TextElement
ToolbarSearchField
A search field for the toolbar.
UnityEditor.Experimental.UIElements
VisualElement
ToolbarPopupSearchField
A search field with a popup menu of search options.
UnityEditor.Experimental.UIElements
ToolbarSearchField
ToolbarSpacer
An element that insert a fixed amount of whitespace between toolbar buttons.
UnityEditor.Experimental.UIElements
VisualElement
ToolbarFlexSpacer
Elements that insert a flexible whitespace between toolbar buttons.
UnityEditor.Experimental.UIElements
VisualElement
ListView
Displays a list of elements.
UnityEngine.Experimental.UIElements
ScrollView
A scrollable view, with horizontal and vertical scrollers.
UnityEngine.Experimental.UIElements
VisualElement
VisualElement
show-horizontal-scroller
: a boolean indicating whether to show the
horizontal scroller; default false
show-vertical-scroller
: a boolean indicating whether to show the vertical scroller; default `falsehorizontal-page-size
: page size value of the horizontal scrollervertical-page-size
: page size of the vertical scrollerstretch-content-width
: a boolean indicating whether the content should stretch to the width of the viewPopupWindow
A UIElements window, displayed on top of other content.
UnityEngine.Experimental.UIElements
VisualElement
TextElement
VisualSplitter
A container that allow user to resize its children by dragging a split bar.
UnityEditor.Experimental.UIElements
VisualElement
VisualElement