Class UiStyle
The style settings for a UiSystem. Each Element uses these style settings by default, however you can also change these settings per element using the elements' individual style settings. Additional styles for built-in or custom element types can easily be added using AddCustomStyle<T>(Action<T>, bool).
public class UiStyle : GenericDataHolder, IGenericDataHolder
- Inheritance
-
UiStyle
- Implements
- Derived
- Inherited Members
Constructors
UiStyle()
Creates a new set of style settings with the default values.
public UiStyle()
UiStyle(UiStyle)
Creates a new set of style settings with values inherited from the given original style settings.
public UiStyle(UiStyle original)
Parameters
originalUiStyleThe original style settings, to copy into the new instance.
Fields
ActionSound
The SoundEffectInfo that should be played when an element's OnPressed and OnSecondaryPressed events are called. Note that this sound is only played if the callbacks have any subscribers.
public SoundEffectInfo ActionSound
Field Value
AdditionalFonts
A set of additional fonts that can be used for the <f FontName> formatting code
public Dictionary<string, GenericFont> AdditionalFonts
Field Value
ButtonColor
The color that the Button element renders
public Color ButtonColor
Field Value
- Color
ButtonDisabledColor
The color that the Button element uses when it IsDisabled
public Color ButtonDisabledColor
Field Value
- Color
ButtonDisabledTexture
The texture that the Button element uses when it IsDisabled
public NinePatch ButtonDisabledTexture
Field Value
ButtonHoveredColor
The color that the Button element renders with when it is moused over (IsMouseOver)
public Color ButtonHoveredColor
Field Value
- Color
ButtonHoveredTexture
The texture that the Button element uses when it is moused over (IsMouseOver) Note that, if you just want to change the button's color when hovered, use ButtonHoveredColor.
public NinePatch ButtonHoveredTexture
Field Value
ButtonTexture
The texture that the Button element uses
public NinePatch ButtonTexture
Field Value
CheckboxCheckColor
public Color CheckboxCheckColor
Field Value
- Color
CheckboxCheckmark
public TextureRegion CheckboxCheckmark
Field Value
CheckboxColor
The color that the Checkbox element uses
public Color CheckboxColor
Field Value
- Color
CheckboxDisabledColor
The color that the Checkbox element uses when it IsDisabled.
public Color CheckboxDisabledColor
Field Value
- Color
CheckboxDisabledTexture
The texture that the Checkbox element uses when it IsDisabled.
public NinePatch CheckboxDisabledTexture
Field Value
CheckboxHoveredColor
The color that the Checkbox element renders with when it is moused over (IsMouseOver)
public Color CheckboxHoveredColor
Field Value
- Color
CheckboxHoveredTexture
The texture that the Checkbox element uses when it is moused over (IsMouseOver)
public NinePatch CheckboxHoveredTexture
Field Value
CheckboxTextOffsetX
public float CheckboxTextOffsetX
Field Value
CheckboxTexture
The texture that the Checkbox element uses
public NinePatch CheckboxTexture
Field Value
CheckboxUncheckedColor
The color of the check mark that the Checkbox element uses when it is not Checked. Set alpha to 0 to disable this behavior
public Color CheckboxUncheckedColor
Field Value
- Color
DropdownArrowPadding
The default padding that a Dropdown's Arrow should have. This value is passed to ArrowPadding.
public Padding DropdownArrowPadding
Field Value
DropdownClosedArrowTexture
The texture that a Dropdown's Arrow should display when the dropdown is closed. This value is passed to ClosedArrowTexture.
public TextureRegion DropdownClosedArrowTexture
Field Value
DropdownHoveredTextColor
The color that a Dropdown's paragraphs should have when hovered. This value is passed to HoveredTextColor.
public Color DropdownHoveredTextColor
Field Value
- Color
DropdownOpenedArrowTexture
The texture that a Dropdown's Arrow should display when the dropdown is open. This value is passed to OpenedArrowTexture.
public TextureRegion DropdownOpenedArrowTexture
Field Value
DropdownTextColor
public Color DropdownTextColor
Field Value
- Color
Font
The font that Paragraph and other elements should use for rendering. Note that, to specify a bold and italic font for TextFormatter, you should use Bold and Italic.
public GenericFont Font
Field Value
LinkColor
The color that a Paragraph's Paragraph.Link codes should have. This value is passed to LinkCode.
public Color? LinkColor
Field Value
- Color?
MouseEnterAnimation
A UiAnimation that is played when the mouse enters an element.
public UiAnimation MouseEnterAnimation
Field Value
MouseExitAnimation
A UiAnimation that is played when the mouse exists an element.
public UiAnimation MouseExitAnimation
Field Value
PanelChildPadding
The ChildPadding to apply to a Panel by default
public Padding PanelChildPadding
Field Value
PanelColor
The color that the Panel element draws with.
public Color PanelColor
Field Value
- Color
PanelScrollBarOffset
The amount of pixels of room there should be between a Panel's scroll bar and the rest of its content
public float PanelScrollBarOffset
Field Value
PanelScrollerSize
The size of the scroller of a Panel's scroll bar
public Vector2 PanelScrollerSize
Field Value
- Vector2
PanelStepPerScroll
The amount that a Panel's scrollable area is moved per single movement of the scroll wheel
public float PanelStepPerScroll
Field Value
PanelTexture
The texture that the Panel element uses
public NinePatch PanelTexture
Field Value
ProgressBarColor
The color that the ProgressBar element renders with
public Color ProgressBarColor
Field Value
- Color
ProgressBarProgressColor
The color that the ProgressBar renders its progress texture with
public Color ProgressBarProgressColor
Field Value
- Color
ProgressBarProgressPadding
The padding that the ProgressBar uses for its progress texture (ProgressBarProgressTexture)
public Vector2 ProgressBarProgressPadding
Field Value
- Vector2
ProgressBarProgressTexture
The texture that the ProgressBar uses for displaying its progress
public NinePatch ProgressBarProgressTexture
Field Value
ProgressBarTexture
The texture that the ProgressBar element uses for its background
public NinePatch ProgressBarTexture
Field Value
RadioCheckColor
The color of the check mark that the RadioButton uses when it is Checked
public Color RadioCheckColor
Field Value
- Color
RadioCheckmark
The texture that the RadioButton renders on top of its regular texture when it is Checked
public TextureRegion RadioCheckmark
Field Value
RadioColor
The color that the RadioButton element uses
public Color RadioColor
Field Value
- Color
RadioHoveredColor
The color that the RadioButton element renders with when it is moused over (IsMouseOver)
public Color RadioHoveredColor
Field Value
- Color
RadioHoveredTexture
The texture that the RadioButton element uses when it is moused over (IsMouseOver)
public NinePatch RadioHoveredTexture
Field Value
RadioTexture
The texture that the RadioButton element uses
public NinePatch RadioTexture
Field Value
RadioUncheckedColor
The color of the check mark that the RadioButton uses when it is not Checked Set the alpha to 0 to disable this behavior
public Color RadioUncheckedColor
Field Value
- Color
ScrollBarBackColor
The background color that the ScrollBar element uses
public Color ScrollBarBackColor
Field Value
- Color
ScrollBarBackground
The background texture that the ScrollBar element uses
public NinePatch ScrollBarBackground
Field Value
ScrollBarScrollerColor
The color that the scroll indicator of the ScrollBar element uses
public Color ScrollBarScrollerColor
Field Value
- Color
ScrollBarScrollerTexture
The texture that the scroll indicator of the ScrollBar element uses
public NinePatch ScrollBarScrollerTexture
Field Value
ScrollBarSmoothScrollFactor
The factor with which a ScrollBar's smooth scrolling happens
public float ScrollBarSmoothScrollFactor
Field Value
ScrollBarSmoothScrolling
Whether or not a ScrollBar should use smooth scrolling
public bool ScrollBarSmoothScrolling
Field Value
SelectionColor
The color of the selector that is rendered on top of the SelectedElement
public Color SelectionColor
Field Value
- Color
SelectionIndicator
The texture that is rendered on top of the SelectedElement
public NinePatch SelectionIndicator
Field Value
TextAlignment
The TextAlignment that a Paragraph should use by default.
public TextAlignment TextAlignment
Field Value
TextColor
The color that the text of a Paragraph should have
public Color TextColor
Field Value
- Color
TextFieldCaretWidth
The width that a TextField's caret should render with
public float TextFieldCaretWidth
Field Value
TextFieldColor
The color that the TextField renders with when it is idle
public Color TextFieldColor
Field Value
- Color
TextFieldHoveredColor
The color that the TextField renders with when it is moused over (IsMouseOver)
public Color TextFieldHoveredColor
Field Value
- Color
TextFieldHoveredTexture
The texture that the TextField element uses when it is moused over (IsMouseOver)
public NinePatch TextFieldHoveredTexture
Field Value
TextFieldTextColor
The text color of text the TextField element uses
public Color TextFieldTextColor
Field Value
- Color
TextFieldTextOffsetX
The x position that a TextField's text should start rendering at, based on the x position of the text field
public float TextFieldTextOffsetX
Field Value
TextFieldTexture
The texture that the TextField element uses
public NinePatch TextFieldTexture
Field Value
TextScale
The scale that text should be rendered with in Paragraph and other elements
public float TextScale
Field Value
TooltipAutoNavAnchor
The auto-nav anchor that is used or tooltips by default.
public Anchor TooltipAutoNavAnchor
Field Value
TooltipAutoNavOffset
The offset of the Tooltip element's top center coordinate from the bottom center of the element snapped to when DisplayInAutoNavMode is true.
public Vector2 TooltipAutoNavOffset
Field Value
- Vector2
TooltipBackColor
The color that the Tooltip uses for its background
public Color TooltipBackColor
Field Value
- Color
TooltipBackground
The texture that the Tooltip uses for its background
public NinePatch TooltipBackground
Field Value
TooltipChildPadding
The ChildPadding to apply to a Tooltip by default
public Padding TooltipChildPadding
Field Value
TooltipDelay
The amount of time that the mouse has to be over an element with a Tooltip for the tooltip to appear
public TimeSpan TooltipDelay
Field Value
TooltipMouseAnchor
The mouse anchor that is used for tooltips by default.
public Anchor TooltipMouseAnchor
Field Value
TooltipOffset
The offset of the Tooltip element's top left corner from the mouse position
public Vector2 TooltipOffset
Field Value
- Vector2
TooltipTextColor
The color that the text of a Tooltip should have
public Color TooltipTextColor
Field Value
- Color
TooltipTextWidth
public float TooltipTextWidth
Field Value
TooltipUseAutoNavBehaviorForMouse
Whether tooltips should use auto-nav rendering behavior for tooltips even when using a mouse by default.
public bool TooltipUseAutoNavBehaviorForMouse
Field Value
Methods
AddCustomStyle<T>(Action<T>, bool)
Adds an action to the given Element type T that allows applying any kind of custom styling or behavior to it.
Custom styles added in this manner can be applied to an element using ApplyCustomStyle(Element).
public void AddCustomStyle<T>(Action<T> style, bool add = false) where T : Element
Parameters
styleAction<T>The style action to add.
addboolWhether the
stylefunction should be added to the existing style settings rather than replacing them.
Type Parameters
TThe Element type that the
styleshould apply to.
ApplyCustomStyle(Element)
Applies a set of custom styling actions to the given element which were added through AddCustomStyle<T>(Action<T>, bool).
This method is automatically invoked in InitStyle(UiStyle).
public bool ApplyCustomStyle(Element element)
Parameters
elementElementThe element to apply custom styling to.
Returns
- bool
Whether any custom styling exists for the given
element.