Skip to content

GUIStyleExtensions

Namespace: SideXP.Core

public static class GUIStyleExtensions

Extension functions for GUIStyle instances.

Fields

MinFontSize

public const int MinFontSize = 1

MaxFontSize

public const int MaxFontSize = 255

Methods

Margin(GUIStyle, int, int, int, int)

public static GUIStyle Margin(GUIStyle style, int left, int right, int top, int bottom)

Copies the input style, and sets the margins.

Parameters

  • style: The style you want to update.
  • left: The left margin.
  • right: The right margin.
  • top: The top margin.
  • bottom: The bottom margin.

Margin(GUIStyle, int, int)

public static GUIStyle Margin(GUIStyle style, int horizontal, int vertical)

Copies the input style, and sets the margins.

Parameters

  • horizontal: The left and right margin.
  • vertical: The top and bottom margin.
  • style: The style you want to update.

Margin(GUIStyle, RectOffset)

public static GUIStyle Margin(GUIStyle style, RectOffset margin)

Copies the input style, and sets the margins.

Parameters

  • margin: The margin to set.
  • style: The style you want to update.

Padding(GUIStyle, int, int, int, int)

public static GUIStyle Padding(GUIStyle style, int left, int right, int top, int bottom)

Copies the input style, and sets the padding.

Parameters

  • left: The left padding.
  • right: The right padding.
  • top: The top padding.
  • bottom: The bottom padding.
  • style: The style you want to update.

Padding(GUIStyle, int, int)

public static GUIStyle Padding(GUIStyle style, int horizontal, int vertical)

Copies the input style, and sets the padding.

Parameters

  • horizontal: The left and right padding.
  • vertical: The top and bottom padding.

Padding(GUIStyle, RectOffset)

public static GUIStyle Padding(GUIStyle style, RectOffset padding)

Copies the input style, and sets the padding.

Parameters

  • padding: The padding to set.

WordWrap(GUIStyle, bool)

public static GUIStyle WordWrap(GUIStyle style, bool enable)

Copies the input style, and enables/disables word wrapping.

Parameters

  • enable: Is word wrapping enabled?
  • style: The style you want to update.

RichText(GUIStyle, bool)

public static GUIStyle RichText(GUIStyle style, bool enable)

Copies the input style, and enables/disables rich text mode.

Parameters

  • enable: Is rich text enabled?
  • style: The style you want to update.

StretchWidth(GUIStyle, bool)

public static GUIStyle StretchWidth(GUIStyle style, bool enable)

Copies the input style, and enables/disables width stretching.

Parameters

  • enable: Is stretching enabled?
  • style: The style you want to update.

StretchHeight(GUIStyle, bool)

public static GUIStyle StretchHeight(GUIStyle style, bool enable)

Copies the input style, and enables/disables height stretching.

Parameters

  • enable: Is stretching enabled?
  • style: The style you want to update.

Stretch(GUIStyle, bool, bool)

public static GUIStyle Stretch(GUIStyle style, bool stretchWidth, bool stretchHeight)

Copies the input style, and enables/disables width and height stretching.

Parameters

  • stretchWidth: Is width stretching enabled?
  • stretchHeight: Is height stretching enabled?
  • style: The style you want to update.

FontSize(GUIStyle, int)

public static GUIStyle FontSize(GUIStyle style, int fontSize)

Copies the input style, and sets the given font size.

Parameters

  • fontSize: The font size to set.
  • style: The style you want to update.

FontSizeDiff(GUIStyle, int)

public static GUIStyle FontSizeDiff(GUIStyle style, int diff)

Copies the input style, and set the font size by adding the given difference to the original size.

Parameters

  • diff: The difference to add to the original font size.

FontColor(GUIStyle, Color)

public static GUIStyle FontColor(GUIStyle style, Color color)

Copies the input style, and sets the given font color on normal state.

Parameters

  • color: The font color to set.
  • style: The style you want to update.

FontStyle(GUIStyle, FontStyle)

public static GUIStyle FontStyle(GUIStyle style, FontStyle fontStyle)

Copies the input style, and sets the font style.

Parameters

  • fontStyle: The font style to set.
  • style: The style you want to update.

TextAlignment(GUIStyle, TextAnchor)

public static GUIStyle TextAlignment(GUIStyle style, TextAnchor alignment)

Copies the input style, and sets the text alignment.

Parameters

  • alignment: The text alignment to set.
  • style: The style you want to update.

AlignLeft(GUIStyle)

public static GUIStyle AlignLeft(GUIStyle style)

Copies the input style, and sets the text alignment to MiddleLeft.

AlignCenter(GUIStyle)

public static GUIStyle AlignCenter(GUIStyle style)

Copies the input style, and sets the text alignment to MiddleCenter.

AlignRight(GUIStyle)

public static GUIStyle AlignRight(GUIStyle style)

Copies the input style, and sets the text alignment to MiddleRight.

BoldItalic(GUIStyle)

public static GUIStyle BoldItalic(GUIStyle style)

Copies the input style, and sets the font style to BoldAndItalic.

Parameters

  • style: The style you want to update.

Bold(GUIStyle)

public static GUIStyle Bold(GUIStyle style)

Copies the input style, and sets the font style to Bold.

Italic(GUIStyle)

public static GUIStyle Italic(GUIStyle style)

Copies the input style, and sets the font style to Italic.