This is mostly an internal class. TypeSprite normaly takes care of all calles you find here.

ResourceManager takes care of all resources. It's tightly coupled with World and WorldManager class and ensures that assets are loaded and available if needed.

It's possible to have multiple resource of the same file.

// Usage:

const res = new ResourceManager();
res.addLoader(new MyLoader1());
res.addLoader(new MyLoader2());

res.request('myOwner', ['loader1:path/to/file', 'loader2:path/to/file']).then(numFailed => {...});

See

  • ResourceLoader
  • SubResourceLoader

Hierarchy

  • ResourceManager

Constructors

Properties

loaders: Map<string, ResourceLoader> = ...
maxParallel: number = 8
pendingHeartbeat: any = null
pendingRequests: RequestSet[] = []
requireChain: RequireChain = ...
rootPath: string = ""

Methods

  • Requires all resources. If they are not yet loaded they'll be put into the loading queue.

    The callback return is called in sync if all resources are were loaded (or failed).

    The ownerId is the world, resource, etc. that holds the resource.

    Parameters

    • ownerId: string
    • resUrls: string[]
    • cb: ((number: any) => void)
        • (number: any): void
        • Parameters

          • number: any

          Returns void

    Returns void

Generated using TypeDoc