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
original
UiStyleThe 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
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
CheckboxCheckmark
public TextureRegion CheckboxCheckmark
Field Value
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
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
RadioCheckmark
The texture that the RadioButton renders on top of its regular texture when it is Checked
public TextureRegion RadioCheckmark
Field Value
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
ScrollBarBackground
The background texture that the ScrollBar element uses
public NinePatch ScrollBarBackground
Field Value
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
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
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
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
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
style
Action<T>The style action to add.
add
boolWhether the
style
function should be added to the existing style settings rather than replacing them.
Type Parameters
T
The Element type that the
style
should 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
element
ElementThe element to apply custom styling to.
Returns
- bool
Whether any custom styling exists for the given
element
.