Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebView

Hierarchy

Index

Constructors

constructor

  • new WebView(url: string, isOverlay?: boolean): WebView
  • new WebView(url: string, propHash: number, targetTexture: string): WebView
  • Creates a fullscreen WebView.

    Parameters

    • url: string

      URL.

    • Optional isOverlay: boolean

      true to render as overlay, false to render on game's GUI stage

    Returns WebView

  • Creates a WebView rendered on game object.

    Parameters

    • url: string

      URL.

    • propHash: number

      Hash of object to render on.

    • targetTexture: string

      Name of object's texture to replace.

    Returns WebView

Properties

isVisible

isVisible: boolean

View visibility state

Readonly type

Type of the object.

url

url: string

View URL

Readonly valid

valid: boolean

Object usability.

returns

False if object is no longer usable.

Methods

deleteMeta

  • deleteMeta(key: string): void

destroy

  • destroy(): void

emit

  • emit(eventName: string, ...args: any[]): void
  • Emits specified event across particular WebView.

    Parameters

    • eventName: string

      Name of the event.

    • Rest ...args: any[]

      Rest parameters for emit to send.

    Returns void

focus

  • focus(): void

getMeta

  • getMeta(key: string): any
  • Gets a value using the specified key.

    Parameters

    • key: string

      The key of the value to get.

    Returns any

    Dynamic value associated with the specified key.

hasMeta

  • hasMeta(key: string): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True when element associated with the specified key is stored.

off

  • off(eventName: string, listener: (...args: any[]) => void): void
  • Unsubscribes from WebView event handler with specified listener.

    remarks

    Listener should be of the same reference as when event was subscribed.

    Parameters

    • eventName: string

      Name of the event.

    • listener: (...args: any[]) => void

      Listener that should be removed.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

on

  • on(eventName: string, listener: (...args: any[]) => void): void
  • on(eventName: "load", listener: () => void): void
  • Subscribes to WebView event handler with specified listener.

    Parameters

    • eventName: string

      Name of the event.

    • listener: (...args: any[]) => void

      Listener that should be added.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Subscribes to WebView event handler with specified listener.

    Parameters

    • eventName: "load"

      Name of the event.

    • listener: () => void

      Listener that should be added.

        • (): void
        • Returns void

    Returns void

setMeta

  • setMeta(key: string, value: any): void
  • Stores the given value with the specified key.

    remarks

    The given value will be shared locally.

    Parameters

    • key: string

      The key of the value to store.

    • value: any

    Returns void

unfocus

  • unfocus(): void