Options
Menu

Class LoaderContext

Hierarchy

  • LoaderContext

Index

Constructors

constructor

  • new LoaderContext(includeDependencies?: boolean, dependencyBaseUrl?: string): LoaderContext
  • LoaderContext provides configuration for the Loader load() and parse() operations. Use it to configure how (and if) dependencies are loaded, or to map dependency URLs to embedded data.

    see

    away.loading.Loader

    Parameters

    • Default value includeDependencies: boolean = true
    • Default value dependencyBaseUrl: string = null

    Returns LoaderContext

Properties

Static MULTIPASS_MATERIALS

MULTIPASS_MATERIALS: number

Static ON_DEMAND

ON_DEMAND: string

Static PRELOADED

PRELOADED: string

Static SINGLEPASS_MATERIALS

SINGLEPASS_MATERIALS: number

Static UNDEFINED

UNDEFINED: number

Accessors

dependencyBaseUrl

  • get (): string
  • set (val: string): void
  • A base URL that will be prepended to all relative dependency URLs found in a loaded resource. Absolute paths will not be affected by the value of this property.

    Returns string

  • A base URL that will be prepended to all relative dependency URLs found in a loaded resource. Absolute paths will not be affected by the value of this property.

    Parameters

    • val: string

    Returns void

externalAssetMode

  • get (): string
  • set (value: string): void
  • Returns string

  • Parameters

    • value: string

    Returns void

includeDependencies

  • get (): boolean
  • set (val: boolean): void
  • Defines whether dependencies (all files except the one at the URL given to the load() or parseData() operations) should be automatically loaded. Defaults to true.

    Returns boolean

  • Defines whether dependencies (all files except the one at the URL given to the load() or parseData() operations) should be automatically loaded. Defaults to true.

    Parameters

    • val: boolean

    Returns void

materialMode

  • get (): number
  • set (value: number): void
  • MaterialMode defines, if the Parser should create SinglePass or MultiPass Materials Options: 0 (Default / undefined) - All Parsers will create SinglePassMaterials, but the AWD2.1parser will create Materials as they are defined in the file 1 (Force SinglePass) - All Parsers create SinglePassMaterials 2 (Force MultiPass) - All Parsers will create MultiPassMaterials

    Returns number

  • MaterialMode defines, if the Parser should create SinglePass or MultiPass Materials Options: 0 (Default / undefined) - All Parsers will create SinglePassMaterials, but the AWD2.1parser will create Materials as they are defined in the file 1 (Force SinglePass) - All Parsers create SinglePassMaterials 2 (Force MultiPass) - All Parsers will create MultiPassMaterials

    Parameters

    • value: number

    Returns void

overrideAbsolutePaths

  • get (): boolean
  • set (val: boolean): void
  • Defines whether absolute paths (defined as paths that begin with a "/") should be overridden with the dependencyBaseUrl defined in this context. If this is true, and the base path is "base", /path/to/asset.jpg will be resolved as base/path/to/asset.jpg.

    Returns boolean

  • Defines whether absolute paths (defined as paths that begin with a "/") should be overridden with the dependencyBaseUrl defined in this context. If this is true, and the base path is "base", /path/to/asset.jpg will be resolved as base/path/to/asset.jpg.

    Parameters

    • val: boolean

    Returns void

overrideFullURLs

  • get (): boolean
  • set (val: boolean): void
  • Defines whether "full" URLs (defined as a URL that includes a scheme, e.g. http://) should be overridden with the dependencyBaseUrl defined in this context. If this is true, and the base path is "base", http://example.com/path/to/asset.jpg will be resolved as base/path/to/asset.jpg.

    Returns boolean

  • Defines whether "full" URLs (defined as a URL that includes a scheme, e.g. http://) should be overridden with the dependencyBaseUrl defined in this context. If this is true, and the base path is "base", http://example.com/path/to/asset.jpg will be resolved as base/path/to/asset.jpg.

    Parameters

    • val: boolean

    Returns void

Methods

Private _iGetDataForUrl

  • _iGetDataForUrl(url: string): any
  • Parameters

    • url: string

    Returns any

Private _iGetRemappedUrl

  • _iGetRemappedUrl(originalUrl: string): string
  • Parameters

    • originalUrl: string

    Returns string

Private _iHasDataForUrl

  • _iHasDataForUrl(url: string): boolean
  • Parameters

    • url: string

    Returns boolean

Private _iHasMappingForUrl

  • _iHasMappingForUrl(url: string): boolean
  • Parameters

    • url: string

    Returns boolean

mapUrl

  • mapUrl(originalUrl: string, newUrl: string): void
  • Map a URL to another URL, so that files that are referred to by the original URL will instead be loaded from the new URL. Use this when your file structure does not match the one that is expected by the loaded file.

    see

    mapUrlToData()

    Parameters

    • originalUrl: string

      The original URL which is referenced in the loaded resource.

    • newUrl: string

      The URL from which away.should load the resource instead.

    Returns void

mapUrlToData

  • mapUrlToData(originalUrl: string, data: any): void
  • Map a URL to embedded data, so that instead of trying to load a dependency from the URL at which it's referenced, the dependency data will be retrieved straight from the memory instead.

    Parameters

    • originalUrl: string

      The original URL which is referenced in the loaded resource.

    • data: any

      The embedded data. Can be ByteArray or a export class which can be used to create a bytearray.

    Returns void

Generated using TypeDoc