Database

Class used to enable access to IndexedDB

see

http://doc.babylonjs.com/how_to/caching_resources_in_indexeddb

Hierarchy

  • Database

Implements

Index

Constructors

constructor

Find examples in Playground
  • new Database(urlToScene: string, callbackManifestChecked: function, disableManifestCheck?: boolean): Database
  • Creates a new Database

    Parameters

    • urlToScene: string

      defines the url to load the scene

    • callbackManifestChecked: function

      defines the callback to use when manifest is checked

        • (checked: boolean): any
        • Parameters

          • checked: boolean

          Returns any

    • Optional disableManifestCheck: boolean

      defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)

    Returns Database

Properties

enableSceneOffline

Find examples in Playground
enableSceneOffline: boolean

Gets a boolean indicating if scene must be saved in the database

enableTexturesOffline

Find examples in Playground
enableTexturesOffline: boolean

Gets a boolean indicating if textures must be saved in the database

Static IDBStorageEnabled

Find examples in Playground
IDBStorageEnabled: boolean

Gets a boolean indicating if Database storate is enabled (off by default)

Methods

loadFile

Find examples in Playground
  • loadFile(url: string, sceneLoaded: function, progressCallBack?: function, errorCallback?: function, useArrayBuffer?: boolean): void
  • Loads a file from database

    Parameters

    • url: string

      defines the URL to load from

    • sceneLoaded: function

      defines a callback to call on success

        • (data: any): void
        • Parameters

          • data: any

          Returns void

    • Optional progressCallBack: function

      defines a callback to call when progress changed

        • (data: any): void
        • Parameters

          • data: any

          Returns void

    • Optional errorCallback: function

      defines a callback to call on error

        • (): void
        • Returns void

    • Optional useArrayBuffer: boolean

      defines a boolean to use array buffer instead of text string

    Returns void

loadImage

Find examples in Playground
  • loadImage(url: string, image: HTMLImageElement): void
  • Loads an image from the database

    Parameters

    • url: string

      defines the url to load from

    • image: HTMLImageElement

      defines the target DOM image

    Returns void

open

Find examples in Playground
  • open(successCallback: function, errorCallback: function): void
  • Open the database and make it available

    Parameters

    • successCallback: function

      defines the callback to call on success

        • (): void
        • Returns void

    • errorCallback: function

      defines the callback to call on error

        • (): void
        • Returns void

    Returns void

Generated using TypeDoc