pixi.js
    Preparing search index...

    Class BackgroundLoaderAdvanced

    The BackgroundLoader handles loading assets passively in the background to prepare them for future use. It loads one asset at a time to minimize impact on application performance.

    Key features:

    • Sequential loading of assets
    • Automatic pause when high-priority loads occur
    • Configurable concurrency
    import { Assets } from 'pixi.js';

    // Background load level assets while in menu
    Assets.backgroundLoad([
    'level1/background.png',
    'level1/sprites.json',
    'level1/music.mp3'
    ]);

    // Assets will be instantly available when needed
    const assets = await Assets.load([
    'level1/background.png',
    'level1/sprites.json'
    ]);

    // Background load bundles
    Assets.backgroundLoadBundle('level2');

    // Later, instant access
    const level2 = await Assets.loadBundle('level2');
    Note

    You typically do not need to use this class directly. Use the main Assets.backgroundLoad API instead.

    • Background loading is automatically paused when Assets.load() is called
    • Assets are loaded sequentially to minimize performance impact
    • Assets are cached as they complete loading
    • No progress tracking is available for background loading
    Index

    Constructors

    Properties

    Accessors

    Constructors

    Properties

    verbose: boolean

    Should the loader log to the console.

    Accessors

    • get active(): boolean

      Controls the active state of the background loader. When active, the loader will continue processing its queue. When inactive, loading is paused.

      Returns boolean

      Whether the background loader is currently active

      // Pause background loading
      backgroundLoader.active = false;

      // Resume background loading
      backgroundLoader.active = true;

      // Check current state
      console.log(backgroundLoader.active); // true/false

      // Common use case: Pause during intensive operations
      backgroundLoader.active = false; // Pause background loading
      ... // Perform high-priority tasks
      backgroundLoader.active = true; // Resume background loading
      • Setting to true resumes loading immediately
      • Setting to false pauses after current asset completes
      • Background loading is automatically paused during Assets.load()
      • Assets already being loaded will complete even when set to false
    • set active(value: boolean): void

      Parameters

      • value: boolean

      Returns void