Interface IStyle
This interface provides access to a VisualElement inline style data.
Namespace: UnityEngine.UIElements
Syntax
public interface IStyle
Remarks
Reading properties from this object will read from the inline style data for this element.
To read the style data computed for the element use
Properties
alignContent
Alignment of the whole area of children on the cross axis if they span over multiple lines in this container.
Declaration
StyleEnum<Align> alignContent { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<Align> |
alignItems
Alignment of children on the cross axis of this container.
Declaration
StyleEnum<Align> alignItems { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<Align> |
alignSelf
Similar to align-items, but only for this specific element.
Declaration
StyleEnum<Align> alignSelf { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<Align> |
backgroundColor
Background color to paint in the element's box.
Declaration
StyleColor backgroundColor { get; set; }
Property Value
Type | Description |
---|---|
StyleColor |
backgroundImage
Background image to paint in the element's box.
Declaration
StyleBackground backgroundImage { get; set; }
Property Value
Type | Description |
---|---|
StyleBackground |
borderBottomColor
Color of the element's bottom border.
Declaration
StyleColor borderBottomColor { get; set; }
Property Value
Type | Description |
---|---|
StyleColor |
borderBottomLeftRadius
The radius of the bottom-left corner when a rounded rectangle is drawn in the element's box.
Declaration
StyleLength borderBottomLeftRadius { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
borderBottomRightRadius
The radius of the bottom-right corner when a rounded rectangle is drawn in the element's box.
Declaration
StyleLength borderBottomRightRadius { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
borderBottomWidth
Space reserved for the bottom edge of the border during the layout phase.
Declaration
StyleFloat borderBottomWidth { get; set; }
Property Value
Type | Description |
---|---|
StyleFloat |
borderLeftColor
Color of the element's left border.
Declaration
StyleColor borderLeftColor { get; set; }
Property Value
Type | Description |
---|---|
StyleColor |
borderLeftWidth
Space reserved for the left edge of the border during the layout phase.
Declaration
StyleFloat borderLeftWidth { get; set; }
Property Value
Type | Description |
---|---|
StyleFloat |
borderRightColor
Color of the element's right border.
Declaration
StyleColor borderRightColor { get; set; }
Property Value
Type | Description |
---|---|
StyleColor |
borderRightWidth
Space reserved for the right edge of the border during the layout phase.
Declaration
StyleFloat borderRightWidth { get; set; }
Property Value
Type | Description |
---|---|
StyleFloat |
borderTopColor
Color of the element's top border.
Declaration
StyleColor borderTopColor { get; set; }
Property Value
Type | Description |
---|---|
StyleColor |
borderTopLeftRadius
The radius of the top-left corner when a rounded rectangle is drawn in the element's box.
Declaration
StyleLength borderTopLeftRadius { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
borderTopRightRadius
The radius of the top-right corner when a rounded rectangle is drawn in the element's box.
Declaration
StyleLength borderTopRightRadius { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
borderTopWidth
Space reserved for the top edge of the border during the layout phase.
Declaration
StyleFloat borderTopWidth { get; set; }
Property Value
Type | Description |
---|---|
StyleFloat |
bottom
Bottom distance from the element's box during layout.
Declaration
StyleLength bottom { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
color
Color to use when drawing the text of an element.
Declaration
StyleColor color { get; set; }
Property Value
Type | Description |
---|---|
StyleColor |
Remarks
This property is inherited by default.
cursor
Mouse cursor to display when the mouse pointer is over an element.
Declaration
StyleCursor cursor { get; set; }
Property Value
Type | Description |
---|---|
StyleCursor |
display
Defines how an element is displayed in the layout.
Declaration
StyleEnum<DisplayStyle> display { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<DisplayStyle> |
Remarks
Unlike the visibility property, this property affects the layout of the element. This is a convenient way to hide an element without removing it from the hierarchy (when using the None).
flexBasis
Initial main size of a flex item, on the main flex axis. The final layout might be smaller or larger, according to the flex shrinking and growing determined by the other flex properties.
Declaration
StyleLength flexBasis { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
flexDirection
Direction of the main axis to layout children in a container.
Declaration
StyleEnum<FlexDirection> flexDirection { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<FlexDirection> |
flexGrow
Specifies how the item will shrink relative to the rest of the flexible items inside the same container.
Declaration
StyleFloat flexGrow { get; set; }
Property Value
Type | Description |
---|---|
StyleFloat |
flexShrink
Specifies how the item will shrink relative to the rest of the flexible items inside the same container.
Declaration
StyleFloat flexShrink { get; set; }
Property Value
Type | Description |
---|---|
StyleFloat |
flexWrap
Placement of children over multiple lines if not enough space is available in this container.
Declaration
StyleEnum<Wrap> flexWrap { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<Wrap> |
fontSize
Font size to draw the element's text.
Declaration
StyleLength fontSize { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
Remarks
This property is inherited by default.
height
Fixed height of an element for the layout.
Declaration
StyleLength height { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
justifyContent
Justification of children on the main axis of this container.
Declaration
StyleEnum<Justify> justifyContent { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<Justify> |
left
Left distance from the element's box during layout.
Declaration
StyleLength left { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
letterSpacing
Increases or decreases the space between characters.
Declaration
StyleLength letterSpacing { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
marginBottom
Space reserved for the bottom edge of the margin during the layout phase.
Declaration
StyleLength marginBottom { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
marginLeft
Space reserved for the left edge of the margin during the layout phase.
Declaration
StyleLength marginLeft { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
marginRight
Space reserved for the right edge of the margin during the layout phase.
Declaration
StyleLength marginRight { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
marginTop
Space reserved for the top edge of the margin during the layout phase.
Declaration
StyleLength marginTop { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
maxHeight
Maximum height for an element, when it is flexible or measures its own size.
Declaration
StyleLength maxHeight { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
maxWidth
Maximum width for an element, when it is flexible or measures its own size.
Declaration
StyleLength maxWidth { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
minHeight
Minimum height for an element, when it is flexible or measures its own size.
Declaration
StyleLength minHeight { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
minWidth
Minimum width for an element, when it is flexible or measures its own size.
Declaration
StyleLength minWidth { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
opacity
Specifies the transparency of an element.
Declaration
StyleFloat opacity { get; set; }
Property Value
Type | Description |
---|---|
StyleFloat |
Remarks
The opacity can be between 0.0 and 1.0. The lower value, the more transparent.
overflow
How a container behaves if its content overflows its own box.
Declaration
StyleEnum<Overflow> overflow { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<Overflow> |
paddingBottom
Space reserved for the bottom edge of the padding during the layout phase.
Declaration
StyleLength paddingBottom { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
paddingLeft
Space reserved for the left edge of the padding during the layout phase.
Declaration
StyleLength paddingLeft { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
paddingRight
Space reserved for the right edge of the padding during the layout phase.
Declaration
StyleLength paddingRight { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
paddingTop
Space reserved for the top edge of the padding during the layout phase.
Declaration
StyleLength paddingTop { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
position
Element's positioning in its parent container.
Declaration
StyleEnum<Position> position { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<Position> |
Remarks
This property is used in conjunction with left, top, right and bottom properties.
right
Right distance from the element's box during layout.
Declaration
StyleLength right { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
textOverflow
The element's text overflow mode.
Declaration
StyleEnum<TextOverflow> textOverflow { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<TextOverflow> |
textShadow
Drop shadow of the text.
Declaration
StyleTextShadow textShadow { get; set; }
Property Value
Type | Description |
---|---|
StyleTextShadow |
top
Top distance from the element's box during layout.
Declaration
StyleLength top { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
unityBackgroundImageTintColor
Tinting color for the element's backgroundImage.
Declaration
StyleColor unityBackgroundImageTintColor { get; set; }
Property Value
Type | Description |
---|---|
StyleColor |
unityBackgroundScaleMode
Background image scaling in the element's box.
Declaration
StyleEnum<ScaleMode> unityBackgroundScaleMode { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<ScaleMode> |
unityFont
Font to draw the element's text.
Declaration
StyleFont unityFont { get; set; }
Property Value
Type | Description |
---|---|
StyleFont |
Remarks
This property is inherited by default.
unityFontDefinition
Font to draw the element's text.
Declaration
StyleFontDefinition unityFontDefinition { get; set; }
Property Value
Type | Description |
---|---|
StyleFontDefinition |
Remarks
This property is inherited by default.
unityFontStyleAndWeight
Font style and weight (normal, bold, italic) to draw the element's text.
Declaration
StyleEnum<FontStyle> unityFontStyleAndWeight { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<FontStyle> |
Remarks
This property is inherited by default.
unityOverflowClipBox
Specifies which box the element content is clipped against.
Declaration
StyleEnum<OverflowClipBox> unityOverflowClipBox { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<OverflowClipBox> |
unityParagraphSpacing
Increases or decreases the space between paragraphs.
Declaration
StyleLength unityParagraphSpacing { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
unitySliceBottom
Size of the 9-slice's bottom edge when painting an element's background image.
Declaration
StyleInt unitySliceBottom { get; set; }
Property Value
Type | Description |
---|---|
StyleInt |
unitySliceLeft
Size of the 9-slice's left edge when painting an element's background image.
Declaration
StyleInt unitySliceLeft { get; set; }
Property Value
Type | Description |
---|---|
StyleInt |
unitySliceRight
Size of the 9-slice's right edge when painting an element's background image.
Declaration
StyleInt unitySliceRight { get; set; }
Property Value
Type | Description |
---|---|
StyleInt |
unitySliceTop
Size of the 9-slice's top edge when painting an element's background image.
Declaration
StyleInt unitySliceTop { get; set; }
Property Value
Type | Description |
---|---|
StyleInt |
unityTextAlign
Horizontal and vertical text alignment in the element's box.
Declaration
StyleEnum<TextAnchor> unityTextAlign { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<TextAnchor> |
Remarks
This property is inherited by default.
unityTextOutlineColor
Outline color of the text.
Declaration
StyleColor unityTextOutlineColor { get; set; }
Property Value
Type | Description |
---|---|
StyleColor |
unityTextOutlineWidth
Outline width of the text.
Declaration
StyleFloat unityTextOutlineWidth { get; set; }
Property Value
Type | Description |
---|---|
StyleFloat |
unityTextOverflowPosition
The element's text overflow position.
Declaration
StyleEnum<TextOverflowPosition> unityTextOverflowPosition { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<TextOverflowPosition> |
visibility
Specifies whether or not an element is visible.
Declaration
StyleEnum<Visibility> visibility { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<Visibility> |
Remarks
This property is inherited by default.
whiteSpace
Word wrapping over multiple lines if not enough space is available to draw the text of an element.
Declaration
StyleEnum<WhiteSpace> whiteSpace { get; set; }
Property Value
Type | Description |
---|---|
StyleEnum<WhiteSpace> |
Remarks
This property is inherited by default.
width
Fixed width of an element for the layout.
Declaration
StyleLength width { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |
wordSpacing
Increases or decreases the space between words.
Declaration
StyleLength wordSpacing { get; set; }
Property Value
Type | Description |
---|---|
StyleLength |