Class WindowLocation

Class representing window's location. All coordinates are defined in units (given screen's width is 1000 units).

Constructors

Methods

  • Returns number

    Unit size (in pixels) in the window's bounds.

  • Returns number

    Unit size (in pixels) in the fullscreen context (<screen width> / 1000).

  • Returns number

    Window's height in units.

  • Returns 1000

    Window's width in units (always 1000 by definition of the unit).

  • Transforms dimension in fullscreen units to the dimension within window's bounds.

    Parameters

    • val: number

      value to be transformed

    Returns number

  • Sets window's scroll size to the windows size to remove scroll.

    Returns void

  • Sets window location parameters.

    Parameters

    • x: number

      X coordinate of the window

    • y: number

      Y coordinate of the window

    • width: number

      width of the window

    • height: number

      height of the window

    Returns void

  • Sets window location parameters from another UI.WindowLocation. Note that paddings are not copied instance.

    Parameters

    Returns void

  • Sets scrollable window size. Should be greater then window width/height for the changes to take effect.

    Parameters

    • x: number

      scrollable window size along the X axis

    • y: number

      scrollable window size along the Y axis

    Returns void

  • Sets the size of the window.

    Parameters

    • x: number

      window's width

    • y: number

      window's height

    Returns void

  • Sets window's Z index. Z index determines how the window will be displayed when several windows are open.

    Parameters

    • z: number

      window Z index

    Returns void

  • Transforms dimension within window's bounds to the dimension in fullscreen units.

    Parameters

    • val: number

      value to be transformed

    Returns number

Properties

forceScrollX: boolean
forceScrollY: boolean
globalScale: boolean

Determines whether the interface needs to be resized based on its size or a global unit system should be used.

2.3.1b115

height: number

Window height.

scale: number

Window scale.

scrollX: number

Horizontal window scroll.

scrollY: number

Vertical window scroll.

width: number

Window width.

x: number

Window horizontal position.

y: number

Window vertical position.

zIndex: number

Window position on layers.

PADDING_BOTTOM: number

Constant used to represent bottom padding.

PADDING_LEFT: number

Constant used to represent left padding.

PADDING_RIGHT: number

Constant used to represent right padding.

PADDING_TOP: number

Constant used to represent top padding.

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.