Перейти к основному содержанию

UI.Style

Object representing window style. Window styles allows to customize the way your windows look like.

Index

Constructors

constructor

Properties

staticreadonlyCLASSIC

CLASSIC: Style

Classic (0.16.*-like) windows style, which also used before legacy version.

staticreadonlyDEFAULT

DEFAULT: Style

Default windows style.

staticreadonlyLEGACY

LEGACY: Style

Methods

addAllBindings

addBinding

  • addBinding(key: string, name: string): void
  • Adds gui texture name to use for the specified window part.


    Parameters

    • key: string

      binding name

    • name: string

      gui texture name

    Returns void

addStyle

  • addStyle(style: Style): void
  • Adds an additional style object to the current style.


    Parameters

    • style: Style

      additional style object to be added

    Returns void

copy

  • Returns Style

    A copy of the current style. Only style bindings of the current style are copied, no parent/additional styles are copied.

getAllBindingNames

  • Returns Collection<string>

    Collection containing all binding names from the current style object.

getBinding

  • getBinding(key: string, fallback: string): string
  • Gets texture binding bt it's name. Searches first in the additional styles, then in the current style, then in all it's parents.


    Parameters

    • key: string

      binding name

    • fallback: string

      value to return on binding failure

    Returns string

    Ui texture name if current object, additional styles or one of the parents contains such a binding name, fallback otherwise.

getBitmapName

  • getBitmapName(name: string): string
  • If name is a style value (starts with "style:"), returns corresponding gui texture name, else returns input string.


    Parameters

    • name: string

      style value or bitmap name

    Returns string

getBooleanProperty

  • getBooleanProperty(name: string, fallback: boolean): boolean
  • Parameters

    • name: string
    • fallback: boolean

    Returns boolean

getColorProperty

  • since: 3.1.0b126

    Parameters

    Returns number

getDoubleProperty

  • getDoubleProperty(name: string, fallback: number): number
  • Parameters

    • name: string
    • fallback: number

    Returns number

getFloatProperty

  • getFloatProperty(name: string, fallback: number): number
  • Parameters

    • name: string
    • fallback: number

    Returns number

getIntProperty

  • getIntProperty(name: string, fallback: number): number
  • Parameters

    • name: string
    • fallback: number

    Returns number

getStringProperty

  • getStringProperty(name: string, fallback: string): string
  • Parameters

    • name: string
    • fallback: string

    Returns string

inherit

  • inherit(style: Style): void
  • Specifies parent style object for the current style.


    Parameters

    • style: Style

      style to be set as parent

    Returns void

setProperty

  • setProperty(name: string, value: any): void
  • Parameters

    • name: string
    • value: any

    Returns void

staticgetBitmapByDescription