Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Window

Represents window of required size that can be opened in container to provide any required UI facilities

Hierarchy

  • Window

Implements

Index

Constructors

constructor

Methods

addAdjacentWindow

  • addAdjacentWindow(window: Window): void
  • Adds another window as adjacent window, so that several windows open at the same time. This allows to divide window into separate parts and treat them separately.

    Parameters

    • window: Window

      another window to be added as adjacent

    Returns void

close

  • close(): void

debug

  • debug(): void

frame

  • frame(time: number): void
  • Called up to 66 times a second to update window's content

    Parameters

    • time: number

      current time in milliseconds

    Returns void

getContainer

getContent

getElements

  • getElements(): HashMap<string, Element>

getLocation

getParentWindow

getProperty

  • getProperty(name: string): Nullable<any>
  • Gets custom property by its name. Custom properties can be used to store some values containing window's current state. Note that these properties are not saved between Inner Core launches

    Parameters

    • name: string

      custom property name

    Returns Nullable<any>

    value set by Window.putProperty or null if no value was specified for this name

getScale

  • getScale(): number

getStyle

invalidateDrawing

  • invalidateDrawing(onCurrentThread: boolean): void
  • Forces ui drawables of the window to refresh

    Parameters

    • onCurrentThread: boolean

      if true, the drawables will be refreshed immediately, otherwise refresh event will be posted. Default value if false. Ensure you are in the UI thread if you pass true as the parameter

    Returns void

invalidateElements

  • invalidateElements(onCurrentThread: boolean): void
  • Forces ui elements of the window to refresh

    Parameters

    • onCurrentThread: boolean

      if true, the elements will be refreshed immediately, otherwise refresh event will be posted. Default value if false. Ensure you are in the UI thread if you pass true as the parameter

    Returns void

isBlockingBackground

  • isBlockingBackground(): boolean

isDynamic

  • isDynamic(): boolean

isInventoryNeeded

  • isInventoryNeeded(): boolean

isNotFocusable

  • isNotFocusable(): boolean

isOpened

  • isOpened(): boolean

isTouchable

  • isTouchable(): boolean

onBackPressed

  • onBackPressed(): boolean

open

  • open(): void

putProperty

  • putProperty(name: string, value: any): void
  • Sets custom property value

    Parameters

    • name: string

      custom property name

    • value: any

      custom property value

    Returns void

removeAdjacentWindow

  • removeAdjacentWindow(window: Window): void
  • Removes adjacent window from the adjacent windows list

    Parameters

    • window: Window

      another window that was added as adjacent

    Returns void

setAsGameOverlay

  • setAsGameOverlay(inGameOverlay: boolean): void
  • Allows window to be displayed as game overlay without blocking Minecraft sounds. Note that this drops window's FPS. Default value is false

    Parameters

    • inGameOverlay: boolean

      if true, the window is opened in PopupWindow to avoid blocking Minecraft sounds

    Returns void

setBackgroundColor

  • setBackgroundColor(color: number): any
  • Set background color of window

    Parameters

    • color: number

      integer color value (you can specify it using hex value)

    Returns any

setBlockingBackground

  • setBlockingBackground(blockingBackground: boolean): void
  • Specifies whether the window should darken and block background. Default value is false

    Parameters

    • blockingBackground: boolean

      pass true if you want the window to block background

    Returns void

setCloseOnBackPressed

  • setCloseOnBackPressed(val: boolean): void
  • Gives the property to be closed on pressing back navigation button to the given window

    Parameters

    • val: boolean

    Returns void

setContainer

setContent

setDebugEnabled

  • setDebugEnabled(enabled: boolean): void
  • Turns debug mode for the window on and off

    Parameters

    • enabled: boolean

      if true, additional debug information will be drawn on the window canvas

    Returns void

setDynamic

  • setDynamic(dynamic: boolean): void
  • Parameters

    • dynamic: boolean

      specify true, if the window contains dynamic (animated) elements, false otherwise. By default all windows are dynamic. Make them static for better performance

    Returns void

setEventListener

setInventoryNeeded

  • setInventoryNeeded(inventoryNeeded: boolean): void
  • Parameters

    • inventoryNeeded: boolean

      specify true if the window requires player's inventory. Default value is false

    Returns void

setParentWindow

  • setParentWindow(window: IWindow): void
  • Sets any window as current window's parent. If current window closes, parent window closes too

    Parameters

    • window: IWindow

      window to be used as parent window for the current window

    Returns void

setStyle

  • Overrides style properties of the current style by the values specified in the style parameter

    Parameters

    • style: BindingsSet

      js object where keys represent binding names and values represent texture gui names

    Returns void

  • Sets new style object as current window's style. If the new style is a different object then an old one, forces window invalidation

    Parameters

    • style: Style

      Style object to be used as style for the window

    Returns void

setTouchable

  • setTouchable(touchable: boolean): void
  • Specifies whether touch events should be handled by this window or passed to underlying windows (to the game). By default all windows are touchable

    Parameters

    • touchable: boolean

      pass true if the window should handle touch events, false otherwise

    Returns void

Generated using TypeDoc