Class UIElementStyle

UI element style that determines the look of a UI element, as well as the element's default layout options. Different looks can be provided for different element states.

Hierarchy

  • FrameworkObject
    • UIElementStyle

Constructors

  • Parameters

    • OptionalisInternalConstructor: boolean

    Returns UIElementStyle

Accessors

  • get font(): Font
  • Font to use for all text within the UI element.

    Returns Font

  • set font(value): void
  • Parameters

    Returns void

  • get fontSize(): number
  • Font size to use for all text within the UI element.

    Returns number

  • set fontSize(value): void
  • Parameters

    • value: number

    Returns void

  • get height(): number
  • Wanted height of the UI element in pixels. Only used if IsHeightFixed is enabled.

    Returns number

  • set height(value): void
  • Parameters

    • value: number

    Returns void

  • get isDefault(): boolean
  • Determines if the style is the default style.

    Returns boolean

  • get isDrawEnabled(): boolean
  • Determines whether the UI drawing for the element is enabled or not. If false, the UIElement will not draw any of it's contents.

    Returns boolean

  • set isDrawEnabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isHeightFixed(): boolean
  • Determines should the layout resize the element depending on available size. If true no resizing will be done.

    Returns boolean

  • set isHeightFixed(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isUsingWordWrap(): boolean
  • Should the text word wrap if it doesn't fit.

    Returns boolean

  • set isUsingWordWrap(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isWidthFixed(): boolean
  • Determines should the layout resize the element depending on available size. If true no resizing will be done.

    Returns boolean

  • set isWidthFixed(value): void
  • Parameters

    • value: boolean

    Returns void

  • get maximumHeight(): number
  • Maximum height allowed for the UI element. Used by the layout only when exact height is not specified.

    Returns number

  • set maximumHeight(value): void
  • Parameters

    • value: number

    Returns void

  • get maximumWidth(): number
  • Maximum width allowed for the UI element. Used by the layout only when exact width is not specified.

    Returns number

  • set maximumWidth(value): void
  • Parameters

    • value: number

    Returns void

  • get minimumHeight(): number
  • Minimum height allowed for the UI element. Used by the layout only when exact height is not specified.

    Returns number

  • set minimumHeight(value): void
  • Parameters

    • value: number

    Returns void

  • get minimumWidth(): number
  • Minimum width allowed for the UI element. Used by the layout only when exact width is not specified.

    Returns number

  • set minimumWidth(value): void
  • Parameters

    • value: number

    Returns void

  • get width(): number
  • Wanted width of the UI element in pixels. Only used if IsWidthFixed is enabled.

    Returns number

  • set width(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Registers a new sub-style that is used by complex UI elements that contain one or multiple sub-elements.

    Parameters

    • uiType: string

      Name of the sub-element this style is to be used for. This depends on UI element the style is applied to.

    • styleName: string

      Name of the style in UI skin to use for the sub-element.

    Returns void

  • Gets the optimal size for a style.

    Returns Vector2

  • Returns a named color from the style defined in the style. This can be used by complex UI elements that wish to customize the colors they are rendered in.

    Parameters

    • options:
          | {
              name: string;
          }
          | {
              defaultColor: Immutable<Color>;
              name: string;
          }
          | {
              name: string;
              state: Immutable<UIElementStateStyle>;
          }
          | {
              defaultColor: Immutable<Color>;
              name: string;
              state: Immutable<UIElementStateStyle>;
          }

      Options object for the function call.

    Returns Immutable<Color>

  • Returns a named float parameter from the style defined in the style. This can be used by complex UI elements that wish to customize rendering parameters such as a rounder border radius.

    Parameters

    • options: {
          defaultValue?: number;
          name: string;
      } | {
          defaultValue?: number;
          name: string;
          state: Immutable<UIElementStateStyle>;
      }

      Options object for the function call.

    Returns number