Skip to main content

Class IStyleExtensions

Namespace: Aspid.FastTools.UIElements
Assembly: Aspid.FastTools.dll

Provides extension methods for IStyle.

public static class IStyleExtensions

Inheritance​

object ← IStyleExtensions

Methods​

AddBoldUnityFontStyleAndWeight<T>(T)​

Adds bold to unityFontStyleAndWeight, preserving any inline italic style.

public static T AddBoldUnityFontStyleAndWeight<T>(this T style) where T : IStyle

Parameters​

style T

The style to modify.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Transitions: Normal → Bold, Italic → BoldAndItalic. Other values are left unchanged. Only the inline unityFontStyleAndWeight value is read; a bold or italic style resolved from USS (with no inline value set) reports as Normal and is therefore not preserved.

AddItalicUnityFontStyleAndWeight<T>(T)​

Adds italic to unityFontStyleAndWeight, preserving any inline bold style.

public static T AddItalicUnityFontStyleAndWeight<T>(this T style) where T : IStyle

Parameters​

style T

The style to modify.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Transitions: Normal → Italic, Bold → BoldAndItalic. Other values are left unchanged. Only the inline unityFontStyleAndWeight value is read; a bold or italic style resolved from USS (with no inline value set) reports as Normal and is therefore not preserved.

RemoveBoldUnityFontStyleAndWeight<T>(T)​

Removes bold from unityFontStyleAndWeight, preserving any inline italic style.

public static T RemoveBoldUnityFontStyleAndWeight<T>(this T style) where T : IStyle

Parameters​

style T

The style to modify.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Transitions: Bold → Normal, BoldAndItalic → Italic. Other values are left unchanged. Only the inline unityFontStyleAndWeight value is read; a bold or italic style resolved from USS (with no inline value set) reports as Normal and is therefore not preserved.

RemoveItalicUnityFontStyleAndWeight<T>(T)​

Removes italic from unityFontStyleAndWeight, preserving any inline bold style.

public static T RemoveItalicUnityFontStyleAndWeight<T>(this T style) where T : IStyle

Parameters​

style T

The style to modify.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Transitions: Italic → Normal, BoldAndItalic → Bold. Other values are left unchanged. Only the inline unityFontStyleAndWeight value is read; a bold or italic style resolved from USS (with no inline value set) reports as Normal and is therefore not preserved.

SetAlignContent<T>(T, StyleEnum<Align>)​

Sets alignContent.

public static T SetAlignContent<T>(this T style, StyleEnum<Align> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<Align>

The content alignment to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetAlignContent<T>(T, Align)​

Sets alignContent.

public static T SetAlignContent<T>(this T style, Align value) where T : IStyle

Parameters​

style T

The style to modify.

value Align

The content alignment to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetAlignItems<T>(T, StyleEnum<Align>)​

Sets alignItems.

public static T SetAlignItems<T>(this T style, StyleEnum<Align> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<Align>

The children alignment to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetAlignItems<T>(T, Align)​

Sets alignItems.

public static T SetAlignItems<T>(this T style, Align value) where T : IStyle

Parameters​

style T

The style to modify.

value Align

The children alignment to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetAlignSelf<T>(T, StyleEnum<Align>)​

Sets alignSelf.

public static T SetAlignSelf<T>(this T style, StyleEnum<Align> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<Align>

The alignment to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetAlignSelf<T>(T, Align)​

Sets alignSelf.

public static T SetAlignSelf<T>(this T style, Align value) where T : IStyle

Parameters​

style T

The style to modify.

value Align

The alignment to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetAspectRatio<T>(T, StyleRatio)​

Sets aspectRatio.

public static T SetAspectRatio<T>(this T style, StyleRatio value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleRatio

The aspect ratio to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBackgroundColor<T>(T, StyleColor)​

Sets backgroundColor.

public static T SetBackgroundColor<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The background color to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBackgroundColor<T>(T, string)​

Sets backgroundColor from an HTML color string.

public static T SetBackgroundColor<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetBackgroundImage<T>(T, StyleBackground)​

Sets backgroundImage.

public static T SetBackgroundImage<T>(this T style, StyleBackground value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleBackground

The background image to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBackgroundImageFromResources<T>(T, string)​

Loads a Texture2D from Resources and sets the backgroundImage property.

public static T SetBackgroundImageFromResources<T>(this T style, string path) where T : IStyle

Parameters​

style T

The style to modify.

path string

The Resources path of the texture to load.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when no asset is found at path.

SetBackgroundPosition<T>(T, StyleBackgroundPosition)​

Sets backgroundPositionX and backgroundPositionY.

public static T SetBackgroundPosition<T>(this T style, StyleBackgroundPosition value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleBackgroundPosition

The background position to apply to both axes.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBackgroundPosition<T>(T, StyleBackgroundPosition?, StyleBackgroundPosition?)​

Sets backgroundPositionX and backgroundPositionY.

public static T SetBackgroundPosition<T>(this T style, StyleBackgroundPosition? x = null, StyleBackgroundPosition? y = null) where T : IStyle

Parameters​

style T

The style to modify.

x StyleBackgroundPosition?

The horizontal background position, or null to leave unchanged.

y StyleBackgroundPosition?

The vertical background position, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBackgroundPositionX<T>(T, StyleBackgroundPosition)​

Sets backgroundPositionX.

public static T SetBackgroundPositionX<T>(this T style, StyleBackgroundPosition value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleBackgroundPosition

The horizontal background position to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBackgroundPositionY<T>(T, StyleBackgroundPosition)​

Sets backgroundPositionY.

public static T SetBackgroundPositionY<T>(this T style, StyleBackgroundPosition value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleBackgroundPosition

The vertical background position to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBackgroundRepeat<T>(T, StyleBackgroundRepeat)​

Sets backgroundRepeat.

public static T SetBackgroundRepeat<T>(this T style, StyleBackgroundRepeat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleBackgroundRepeat

The background repeat mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBackgroundSize<T>(T, StyleBackgroundSize)​

Sets backgroundSize.

public static T SetBackgroundSize<T>(this T style, StyleBackgroundSize value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleBackgroundSize

The background size to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColor<T>(T, StyleColor)​

Sets borderTopColor, borderRightColor, borderBottomColor and borderLeftColor.

public static T SetBorderColor<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The border color to apply to all sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColor<T>(T, string)​

Sets the border color on all sides from an HTML color string.

public static T SetBorderColor<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetBorderColor<T>(T, StyleColor?, StyleColor?, StyleColor?, StyleColor?)​

Sets borderTopColor, borderRightColor, borderBottomColor and borderLeftColor.

public static T SetBorderColor<T>(this T style, StyleColor? top = null, StyleColor? right = null, StyleColor? bottom = null, StyleColor? left = null) where T : IStyle

Parameters​

style T

The style to modify.

top StyleColor?

The top border color, or null to leave unchanged.

right StyleColor?

The right border color, or null to leave unchanged.

bottom StyleColor?

The bottom border color, or null to leave unchanged.

left StyleColor?

The left border color, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColorBottom<T>(T, StyleColor)​

Sets borderBottomColor.

public static T SetBorderColorBottom<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The bottom border color to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColorBottom<T>(T, string)​

Sets the bottom border color from an HTML color string.

public static T SetBorderColorBottom<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetBorderColorLeft<T>(T, StyleColor)​

Sets borderLeftColor.

public static T SetBorderColorLeft<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The left border color to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColorLeft<T>(T, string)​

Sets the left border color from an HTML color string.

public static T SetBorderColorLeft<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetBorderColorRight<T>(T, StyleColor)​

Sets borderRightColor.

public static T SetBorderColorRight<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The right border color to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColorRight<T>(T, string)​

Sets the right border color from an HTML color string.

public static T SetBorderColorRight<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetBorderColorTop<T>(T, StyleColor)​

Sets borderTopColor.

public static T SetBorderColorTop<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The top border color to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColorTop<T>(T, string)​

Sets the top border color from an HTML color string.

public static T SetBorderColorTop<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetBorderColorX<T>(T, StyleColor)​

Sets borderRightColor and borderLeftColor.

public static T SetBorderColorX<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The border color to apply to the left and right sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColorX<T>(T, string)​

Sets the left and right border colors from an HTML color string.

public static T SetBorderColorX<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetBorderColorY<T>(T, StyleColor)​

Sets borderTopColor and borderBottomColor.

public static T SetBorderColorY<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The border color to apply to the top and bottom sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderColorY<T>(T, string)​

Sets the top and bottom border colors from an HTML color string.

public static T SetBorderColorY<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetBorderRadius<T>(T, StyleLength)​

Sets borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius and borderBottomLeftRadius.

public static T SetBorderRadius<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The border radius to apply to all corners.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadius<T>(T, StyleLength?, StyleLength?, StyleLength?, StyleLength?)​

Sets borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius and borderBottomLeftRadius.

public static T SetBorderRadius<T>(this T style, StyleLength? topLeft = null, StyleLength? topRight = null, StyleLength? bottomRight = null, StyleLength? bottomLeft = null) where T : IStyle

Parameters​

style T

The style to modify.

topLeft StyleLength?

The top-left radius, or null to leave unchanged.

topRight StyleLength?

The top-right radius, or null to leave unchanged.

bottomRight StyleLength?

The bottom-right radius, or null to leave unchanged.

bottomLeft StyleLength?

The bottom-left radius, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadiusBottom<T>(T, StyleLength)​

Sets borderBottomRightRadius and borderBottomLeftRadius.

public static T SetBorderRadiusBottom<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The radius to apply to both bottom corners.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadiusBottomLeft<T>(T, StyleLength)​

Sets borderBottomLeftRadius.

public static T SetBorderRadiusBottomLeft<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The bottom-left corner radius to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadiusBottomRight<T>(T, StyleLength)​

Sets borderBottomRightRadius.

public static T SetBorderRadiusBottomRight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The bottom-right corner radius to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadiusLeft<T>(T, StyleLength)​

Sets borderTopLeftRadius and borderBottomLeftRadius.

public static T SetBorderRadiusLeft<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The radius to apply to both left corners.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadiusRight<T>(T, StyleLength)​

Sets borderTopRightRadius and borderBottomRightRadius.

public static T SetBorderRadiusRight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The radius to apply to both right corners.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadiusTop<T>(T, StyleLength)​

Sets borderTopLeftRadius and borderTopRightRadius.

public static T SetBorderRadiusTop<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The radius to apply to both top corners.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadiusTopLeft<T>(T, StyleLength)​

Sets borderTopLeftRadius.

public static T SetBorderRadiusTopLeft<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The top-left corner radius to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderRadiusTopRight<T>(T, StyleLength)​

Sets borderTopRightRadius.

public static T SetBorderRadiusTopRight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The top-right corner radius to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderWidth<T>(T, StyleFloat)​

Sets borderTopWidth, borderRightWidth, borderBottomWidth and borderLeftWidth.

public static T SetBorderWidth<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The border width to apply to all sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderWidth<T>(T, StyleFloat?, StyleFloat?, StyleFloat?, StyleFloat?)​

Sets borderTopWidth, borderRightWidth, borderBottomWidth and borderLeftWidth.

public static T SetBorderWidth<T>(this T style, StyleFloat? top = null, StyleFloat? right = null, StyleFloat? bottom = null, StyleFloat? left = null) where T : IStyle

Parameters​

style T

The style to modify.

top StyleFloat?

The top border width, or null to leave unchanged.

right StyleFloat?

The right border width, or null to leave unchanged.

bottom StyleFloat?

The bottom border width, or null to leave unchanged.

left StyleFloat?

The left border width, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderWidthBottom<T>(T, StyleFloat)​

Sets borderBottomWidth.

public static T SetBorderWidthBottom<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The bottom border width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderWidthLeft<T>(T, StyleFloat)​

Sets borderLeftWidth.

public static T SetBorderWidthLeft<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The left border width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderWidthRight<T>(T, StyleFloat)​

Sets borderRightWidth.

public static T SetBorderWidthRight<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The right border width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderWidthTop<T>(T, StyleFloat)​

Sets borderTopWidth.

public static T SetBorderWidthTop<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The top border width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderWidthX<T>(T, StyleFloat)​

Sets borderLeftWidth and borderRightWidth.

public static T SetBorderWidthX<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The border width to apply to the left and right sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBorderWidthY<T>(T, StyleFloat)​

Sets borderTopWidth and borderBottomWidth.

public static T SetBorderWidthY<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The border width to apply to the top and bottom sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetBottom<T>(T, StyleLength)​

Sets bottom.

public static T SetBottom<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The bottom offset to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetColor<T>(T, StyleColor)​

Sets color.

public static T SetColor<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The text color to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetColor<T>(T, string)​

Sets color from an HTML color string.

public static T SetColor<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetCursor<T>(T, StyleCursor)​

Sets cursor.

public static T SetCursor<T>(this T style, StyleCursor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleCursor

The cursor style to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetDisplay<T>(T, StyleEnum<DisplayStyle>)​

Sets display.

public static T SetDisplay<T>(this T style, StyleEnum<DisplayStyle> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<DisplayStyle>

The display mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetDisplay<T>(T, DisplayStyle)​

Sets display.

public static T SetDisplay<T>(this T style, DisplayStyle value) where T : IStyle

Parameters​

style T

The style to modify.

value DisplayStyle

The display mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetDistance<T>(T, StyleLength)​

Sets top, right, bottom and left.

public static T SetDistance<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The distance to apply to all sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetDistance<T>(T, StyleLength?, StyleLength?, StyleLength?, StyleLength?)​

Sets top, right, bottom and left.

public static T SetDistance<T>(this T style, StyleLength? top = null, StyleLength? right = null, StyleLength? bottom = null, StyleLength? left = null) where T : IStyle

Parameters​

style T

The style to modify.

top StyleLength?

The top offset, or null to leave unchanged.

right StyleLength?

The right offset, or null to leave unchanged.

bottom StyleLength?

The bottom offset, or null to leave unchanged.

left StyleLength?

The left offset, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetDistanceX<T>(T, StyleLength)​

Sets right and left.

public static T SetDistanceX<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The horizontal offset to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetDistanceY<T>(T, StyleLength)​

Sets top and bottom.

public static T SetDistanceY<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The vertical offset to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFilter<T>(T, StyleList<FilterFunction>)​

Sets filter.

public static T SetFilter<T>(this T style, StyleList<FilterFunction> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleList<FilterFunction>

The filter effects to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFlexBasis<T>(T, StyleLength)​

Sets flexBasis.

public static T SetFlexBasis<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The flex basis to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFlexDirection<T>(T, StyleEnum<FlexDirection>)​

Sets flexDirection.

public static T SetFlexDirection<T>(this T style, StyleEnum<FlexDirection> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<FlexDirection>

The flex direction to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFlexDirection<T>(T, FlexDirection)​

Sets flexDirection.

public static T SetFlexDirection<T>(this T style, FlexDirection value) where T : IStyle

Parameters​

style T

The style to modify.

value FlexDirection

The flex direction to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFlexGrow<T>(T, StyleFloat)​

Sets flexGrow.

public static T SetFlexGrow<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The flex grow factor to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFlexShrink<T>(T, StyleFloat)​

Sets flexShrink.

public static T SetFlexShrink<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The flex shrink factor to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFlexWrap<T>(T, StyleEnum<Wrap>)​

Sets flexWrap.

public static T SetFlexWrap<T>(this T style, StyleEnum<Wrap> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<Wrap>

The flex wrap mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFlexWrap<T>(T, Wrap)​

Sets flexWrap.

public static T SetFlexWrap<T>(this T style, Wrap value) where T : IStyle

Parameters​

style T

The style to modify.

value Wrap

The flex wrap mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetFontSize<T>(T, StyleLength)​

Sets fontSize.

public static T SetFontSize<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The font size to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetHeight<T>(T, StyleLength)​

Sets height.

public static T SetHeight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The height to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetJustifyContent<T>(T, StyleEnum<Justify>)​

Sets justifyContent.

public static T SetJustifyContent<T>(this T style, StyleEnum<Justify> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<Justify>

The justify content mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetJustifyContent<T>(T, Justify)​

Sets justifyContent.

public static T SetJustifyContent<T>(this T style, Justify value) where T : IStyle

Parameters​

style T

The style to modify.

value Justify

The justify content mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetLeft<T>(T, StyleLength)​

Sets left.

public static T SetLeft<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The left offset to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetLetterSpacing<T>(T, StyleLength)​

Sets letterSpacing.

public static T SetLetterSpacing<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The letter spacing to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMargin<T>(T, StyleLength)​

Sets marginTop, marginRight, marginBottom and marginLeft.

public static T SetMargin<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The margin to apply to all sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMargin<T>(T, StyleLength?, StyleLength?, StyleLength?, StyleLength?)​

Sets marginTop, marginRight, marginBottom and marginLeft.

public static T SetMargin<T>(this T style, StyleLength? top = null, StyleLength? right = null, StyleLength? bottom = null, StyleLength? left = null) where T : IStyle

Parameters​

style T

The style to modify.

top StyleLength?

The top margin, or null to leave unchanged.

right StyleLength?

The right margin, or null to leave unchanged.

bottom StyleLength?

The bottom margin, or null to leave unchanged.

left StyleLength?

The left margin, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMarginBottom<T>(T, StyleLength)​

Sets marginBottom.

public static T SetMarginBottom<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The bottom margin to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMarginLeft<T>(T, StyleLength)​

Sets marginLeft.

public static T SetMarginLeft<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The left margin to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMarginRight<T>(T, StyleLength)​

Sets marginRight.

public static T SetMarginRight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The right margin to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMarginTop<T>(T, StyleLength)​

Sets marginTop.

public static T SetMarginTop<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The top margin to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMarginX<T>(T, StyleLength)​

Sets marginRight and marginLeft.

public static T SetMarginX<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The horizontal margin to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMarginY<T>(T, StyleLength)​

Sets marginTop and marginBottom.

public static T SetMarginY<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The vertical margin to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMaxHeight<T>(T, StyleLength)​

Sets maxHeight.

public static T SetMaxHeight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The maximum height to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMaxSize<T>(T, StyleLength)​

Sets maxWidth and maxHeight.

public static T SetMaxSize<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The maximum size to apply to both width and height.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMaxSize<T>(T, StyleLength?, StyleLength?)​

Sets maxWidth and maxHeight.

public static T SetMaxSize<T>(this T style, StyleLength? maxWidth = null, StyleLength? maxHeight = null) where T : IStyle

Parameters​

style T

The style to modify.

maxWidth StyleLength?

The maximum width to set, or null to leave unchanged.

maxHeight StyleLength?

The maximum height to set, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMaxWidth<T>(T, StyleLength)​

Sets maxWidth.

public static T SetMaxWidth<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The maximum width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMinHeight<T>(T, StyleLength)​

Sets minHeight.

public static T SetMinHeight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The minimum height to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMinSize<T>(T, StyleLength)​

Sets minWidth and minHeight.

public static T SetMinSize<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The minimum size to apply to both width and height.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMinSize<T>(T, StyleLength?, StyleLength?)​

Sets minWidth and minHeight.

public static T SetMinSize<T>(this T style, StyleLength? minWidth = null, StyleLength? minHeight = null) where T : IStyle

Parameters​

style T

The style to modify.

minWidth StyleLength?

The minimum width to set, or null to leave unchanged.

minHeight StyleLength?

The minimum height to set, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetMinWidth<T>(T, StyleLength)​

Sets minWidth.

public static T SetMinWidth<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The minimum width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetNormalUnityFontStyleAndWeight<T>(T)​

Sets unityFontStyleAndWeight to Normal, removing bold and italic.

public static T SetNormalUnityFontStyleAndWeight<T>(this T style) where T : IStyle

Parameters​

style T

The style to modify.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Sets the value unconditionally, regardless of any current bold or italic style.

SetOpacity<T>(T, StyleFloat)​

Sets opacity.

public static T SetOpacity<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The opacity to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetOverflow<T>(T, StyleEnum<Overflow>)​

Sets overflow.

public static T SetOverflow<T>(this T style, StyleEnum<Overflow> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<Overflow>

The overflow behavior to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetOverflow<T>(T, Overflow)​

Sets overflow.

public static T SetOverflow<T>(this T style, Overflow value) where T : IStyle

Parameters​

style T

The style to modify.

value Overflow

The overflow behavior to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPadding<T>(T, StyleLength)​

Sets paddingTop, paddingRight, paddingBottom and paddingLeft.

public static T SetPadding<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The padding to apply to all sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPadding<T>(T, StyleLength?, StyleLength?, StyleLength?, StyleLength?)​

Sets paddingTop, paddingRight, paddingBottom and paddingLeft.

public static T SetPadding<T>(this T style, StyleLength? top = null, StyleLength? right = null, StyleLength? bottom = null, StyleLength? left = null) where T : IStyle

Parameters​

style T

The style to modify.

top StyleLength?

The top padding, or null to leave unchanged.

right StyleLength?

The right padding, or null to leave unchanged.

bottom StyleLength?

The bottom padding, or null to leave unchanged.

left StyleLength?

The left padding, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPaddingBottom<T>(T, StyleLength)​

Sets paddingBottom.

public static T SetPaddingBottom<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The bottom padding to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPaddingLeft<T>(T, StyleLength)​

Sets paddingLeft.

public static T SetPaddingLeft<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The left padding to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPaddingRight<T>(T, StyleLength)​

Sets paddingRight.

public static T SetPaddingRight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The right padding to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPaddingTop<T>(T, StyleLength)​

Sets paddingTop.

public static T SetPaddingTop<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The top padding to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPaddingX<T>(T, StyleLength)​

Sets paddingRight and paddingLeft.

public static T SetPaddingX<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The horizontal padding to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPaddingY<T>(T, StyleLength)​

Sets paddingTop and paddingBottom.

public static T SetPaddingY<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The vertical padding to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPosition<T>(T, StyleEnum<Position>)​

Sets position.

public static T SetPosition<T>(this T style, StyleEnum<Position> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<Position>

The position type to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetPosition<T>(T, Position)​

Sets position.

public static T SetPosition<T>(this T style, Position value) where T : IStyle

Parameters​

style T

The style to modify.

value Position

The position type to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetRight<T>(T, StyleLength)​

Sets right.

public static T SetRight<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The right offset to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetRotate<T>(T, StyleRotate)​

Sets rotate.

public static T SetRotate<T>(this T style, StyleRotate value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleRotate

The rotation to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetScale<T>(T, StyleScale)​

Sets scale.

public static T SetScale<T>(this T style, StyleScale value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleScale

The scale transformation to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetSize<T>(T, StyleLength)​

Sets width and height.

public static T SetSize<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The size to apply to both width and height.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetSize<T>(T, StyleLength?, StyleLength?)​

Sets width and height.

public static T SetSize<T>(this T style, StyleLength? width = null, StyleLength? height = null) where T : IStyle

Parameters​

style T

The style to modify.

width StyleLength?

The width to set, or null to leave unchanged.

height StyleLength?

The height to set, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTextOverflow<T>(T, StyleEnum<TextOverflow>)​

Sets textOverflow.

public static T SetTextOverflow<T>(this T style, StyleEnum<TextOverflow> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<TextOverflow>

The text overflow mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTextOverflow<T>(T, TextOverflow)​

Sets textOverflow.

public static T SetTextOverflow<T>(this T style, TextOverflow value) where T : IStyle

Parameters​

style T

The style to modify.

value TextOverflow

The text overflow mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTextShadow<T>(T, StyleTextShadow)​

Sets textShadow.

public static T SetTextShadow<T>(this T style, StyleTextShadow value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleTextShadow

The text shadow to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTop<T>(T, StyleLength)​

Sets top.

public static T SetTop<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The top offset to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTransformOrigin<T>(T, StyleTransformOrigin)​

Sets transformOrigin.

public static T SetTransformOrigin<T>(this T style, StyleTransformOrigin value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleTransformOrigin

The transform origin to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTransitionDelay<T>(T, StyleList<TimeValue>)​

Sets transitionDelay.

public static T SetTransitionDelay<T>(this T style, StyleList<TimeValue> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleList<TimeValue>

The transition delays to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTransitionDuration<T>(T, StyleList<TimeValue>)​

Sets transitionDuration.

public static T SetTransitionDuration<T>(this T style, StyleList<TimeValue> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleList<TimeValue>

The transition durations to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTransitionProperty<T>(T, StyleList<StylePropertyName>)​

Sets transitionProperty.

public static T SetTransitionProperty<T>(this T style, StyleList<StylePropertyName> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleList<StylePropertyName>

The transition properties to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTransitionTimingFunction<T>(T, StyleList<EasingFunction>)​

Sets transitionTimingFunction.

public static T SetTransitionTimingFunction<T>(this T style, StyleList<EasingFunction> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleList<EasingFunction>

The transition timing functions to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetTranslate<T>(T, StyleTranslate)​

Sets translate.

public static T SetTranslate<T>(this T style, StyleTranslate value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleTranslate

The translation to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityBackgroundImageTintColor<T>(T, StyleColor)​

Sets unityBackgroundImageTintColor.

public static T SetUnityBackgroundImageTintColor<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The background image tint color to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityBackgroundImageTintColor<T>(T, string)​

Sets the background image tint color from an HTML color string.

public static T SetUnityBackgroundImageTintColor<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetUnityEditorTextRenderingMode<T>(T, StyleEnum<EditorTextRenderingMode>)​

Sets unityEditorTextRenderingMode.

public static T SetUnityEditorTextRenderingMode<T>(this T style, StyleEnum<EditorTextRenderingMode> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<EditorTextRenderingMode>

The editor text rendering mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityEditorTextRenderingMode<T>(T, EditorTextRenderingMode)​

Sets unityEditorTextRenderingMode.

public static T SetUnityEditorTextRenderingMode<T>(this T style, EditorTextRenderingMode value) where T : IStyle

Parameters​

style T

The style to modify.

value EditorTextRenderingMode

The editor text rendering mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityFont<T>(T, StyleFont)​

Sets unityFont.

public static T SetUnityFont<T>(this T style, StyleFont value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFont

The font to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityFontDefinition<T>(T, StyleFontDefinition)​

Sets unityFontDefinition.

public static T SetUnityFontDefinition<T>(this T style, StyleFontDefinition value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFontDefinition

The font definition to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityFontStyleAndWeight<T>(T, StyleEnum<FontStyle>)​

Sets unityFontStyleAndWeight.

public static T SetUnityFontStyleAndWeight<T>(this T style, StyleEnum<FontStyle> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<FontStyle>

The font style and weight to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityFontStyleAndWeight<T>(T, FontStyle)​

Sets unityFontStyleAndWeight.

public static T SetUnityFontStyleAndWeight<T>(this T style, FontStyle value) where T : IStyle

Parameters​

style T

The style to modify.

value FontStyle

The font style and weight to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityMaterial<T>(T, StyleMaterialDefinition)​

Sets unityMaterial.

public static T SetUnityMaterial<T>(this T style, StyleMaterialDefinition value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleMaterialDefinition

The material to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityOverflowClipBox<T>(T, StyleEnum<OverflowClipBox>)​

Sets unityOverflowClipBox.

public static T SetUnityOverflowClipBox<T>(this T style, StyleEnum<OverflowClipBox> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<OverflowClipBox>

The overflow clip box to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityOverflowClipBox<T>(T, OverflowClipBox)​

Sets unityOverflowClipBox.

public static T SetUnityOverflowClipBox<T>(this T style, OverflowClipBox value) where T : IStyle

Parameters​

style T

The style to modify.

value OverflowClipBox

The overflow clip box to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityParagraphSpacing<T>(T, StyleLength)​

Sets unityParagraphSpacing.

public static T SetUnityParagraphSpacing<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The paragraph spacing to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySlice<T>(T, StyleInt)​

Sets unitySliceTop, unitySliceRight, unitySliceBottom and unitySliceLeft.

public static T SetUnitySlice<T>(this T style, StyleInt value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleInt

The slice width to apply to all sides.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySlice<T>(T, StyleInt?, StyleInt?, StyleInt?, StyleInt?)​

Sets unitySliceTop, unitySliceRight, unitySliceBottom and unitySliceLeft.

public static T SetUnitySlice<T>(this T style, StyleInt? top = null, StyleInt? right = null, StyleInt? bottom = null, StyleInt? left = null) where T : IStyle

Parameters​

style T

The style to modify.

top StyleInt?

The top slice width, or null to leave unchanged.

right StyleInt?

The right slice width, or null to leave unchanged.

bottom StyleInt?

The bottom slice width, or null to leave unchanged.

left StyleInt?

The left slice width, or null to leave unchanged.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceBottom<T>(T, StyleInt)​

Sets unitySliceBottom.

public static T SetUnitySliceBottom<T>(this T style, StyleInt value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleInt

The bottom slice width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceLeft<T>(T, StyleInt)​

Sets unitySliceLeft.

public static T SetUnitySliceLeft<T>(this T style, StyleInt value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleInt

The left slice width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceRight<T>(T, StyleInt)​

Sets unitySliceRight.

public static T SetUnitySliceRight<T>(this T style, StyleInt value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleInt

The right slice width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceScale<T>(T, StyleFloat)​

Sets unitySliceScale.

public static T SetUnitySliceScale<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The slice scale to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceTop<T>(T, StyleInt)​

Sets unitySliceTop.

public static T SetUnitySliceTop<T>(this T style, StyleInt value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleInt

The top slice width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceType<T>(T, StyleEnum<SliceType>)​

Sets unitySliceType.

public static T SetUnitySliceType<T>(this T style, StyleEnum<SliceType> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<SliceType>

The slice type to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceType<T>(T, SliceType)​

Sets unitySliceType.

public static T SetUnitySliceType<T>(this T style, SliceType value) where T : IStyle

Parameters​

style T

The style to modify.

value SliceType

The slice type to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceX<T>(T, StyleInt)​

Sets unitySliceRight and unitySliceLeft.

public static T SetUnitySliceX<T>(this T style, StyleInt value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleInt

The horizontal slice width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnitySliceY<T>(T, StyleInt)​

Sets unitySliceTop and unitySliceBottom.

public static T SetUnitySliceY<T>(this T style, StyleInt value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleInt

The vertical slice width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextAlign<T>(T, StyleEnum<TextAnchor>)​

Sets unityTextAlign.

public static T SetUnityTextAlign<T>(this T style, StyleEnum<TextAnchor> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<TextAnchor>

The text alignment to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextAlign<T>(T, TextAnchor)​

Sets unityTextAlign.

public static T SetUnityTextAlign<T>(this T style, TextAnchor value) where T : IStyle

Parameters​

style T

The style to modify.

value TextAnchor

The text alignment to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextAutoSize<T>(T, StyleTextAutoSize)​

Sets unityTextAutoSize.

public static T SetUnityTextAutoSize<T>(this T style, StyleTextAutoSize value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleTextAutoSize

The text auto size settings to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextGenerator<T>(T, StyleEnum<TextGeneratorType>)​

Sets unityTextGenerator.

public static T SetUnityTextGenerator<T>(this T style, StyleEnum<TextGeneratorType> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<TextGeneratorType>

The text generator type to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextGenerator<T>(T, TextGeneratorType)​

Sets unityTextGenerator.

public static T SetUnityTextGenerator<T>(this T style, TextGeneratorType value) where T : IStyle

Parameters​

style T

The style to modify.

value TextGeneratorType

The text generator type to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextOutlineColor<T>(T, StyleColor)​

Sets unityTextOutlineColor.

public static T SetUnityTextOutlineColor<T>(this T style, StyleColor value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleColor

The text outline color to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextOutlineColor<T>(T, string)​

Sets the text outline color from an HTML color string.

public static T SetUnityTextOutlineColor<T>(this T style, string value) where T : IStyle

Parameters​

style T

The style to modify.

value string

The HTML color string, such as #FF0000 or red.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

Remarks​

Logs a warning and leaves the style unchanged when value cannot be parsed.

SetUnityTextOutlineWidth<T>(T, StyleFloat)​

Sets unityTextOutlineWidth.

public static T SetUnityTextOutlineWidth<T>(this T style, StyleFloat value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleFloat

The text outline width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextOverflowPosition<T>(T, StyleEnum<TextOverflowPosition>)​

Sets unityTextOverflowPosition.

public static T SetUnityTextOverflowPosition<T>(this T style, StyleEnum<TextOverflowPosition> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<TextOverflowPosition>

The text overflow position to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetUnityTextOverflowPosition<T>(T, TextOverflowPosition)​

Sets unityTextOverflowPosition.

public static T SetUnityTextOverflowPosition<T>(this T style, TextOverflowPosition value) where T : IStyle

Parameters​

style T

The style to modify.

value TextOverflowPosition

The text overflow position to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetVisibility<T>(T, StyleEnum<Visibility>)​

Sets visibility.

public static T SetVisibility<T>(this T style, StyleEnum<Visibility> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<Visibility>

The visibility to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetVisibility<T>(T, Visibility)​

Sets visibility.

public static T SetVisibility<T>(this T style, Visibility value) where T : IStyle

Parameters​

style T

The style to modify.

value Visibility

The visibility to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetWhiteSpace<T>(T, StyleEnum<WhiteSpace>)​

Sets whiteSpace.

public static T SetWhiteSpace<T>(this T style, StyleEnum<WhiteSpace> value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleEnum<WhiteSpace>

The white-space mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetWhiteSpace<T>(T, WhiteSpace)​

Sets whiteSpace.

public static T SetWhiteSpace<T>(this T style, WhiteSpace value) where T : IStyle

Parameters​

style T

The style to modify.

value WhiteSpace

The white-space mode to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetWidth<T>(T, StyleLength)​

Sets width.

public static T SetWidth<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The width to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

SetWordSpacing<T>(T, StyleLength)​

Sets wordSpacing.

public static T SetWordSpacing<T>(this T style, StyleLength value) where T : IStyle

Parameters​

style T

The style to modify.

value StyleLength

The word spacing to set.

Returns​

T

The style, for chaining.

Type Parameters​

T

The style type.

On this page