How to use the @pixi/app.Application.prototype function in @pixi/app

To help you get started, we’ve selected a few @pixi/app examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pixijs / pixi.js / packages / mixin-app-loader / src / index.js View on Github external
{
            if (!this._loader && this._options)
            {
                const { sharedLoader } = this._options;

                this._loader = sharedLoader ? Loader.shared : new Loader();
            }

            return this._loader;
        },
    },
});

// Override the destroy function
// making sure to destroy the current Loader
Application.prototype._parentDestroy = Application.prototype.destroy;
Application.prototype.destroy = function destroy(removeView, stageOptions)
{
    if (this._loader)
    {
        this._loader.destroy();
        this._loader = null;
    }
    this._parentDestroy(removeView, stageOptions);
};
github pixijs / pixi.js / packages / mixin-app-loader / src / index.js View on Github external
import { Application } from '@pixi/app';
import { Loader } from '@pixi/loaders';

Application.prototype._loader = null;

/**
 * Loader instance to help with asset loading.
 * @name PIXI.Application#loader
 * @type {PIXI.Loader}
 */
Object.defineProperties(Application.prototype, {
    loader: {
        get()
        {
            if (!this._loader && this._options)
            {
                const { sharedLoader } = this._options;

                this._loader = sharedLoader ? Loader.shared : new Loader();
            }

            return this._loader;
        },
    },
});

// Override the destroy function
github pixijs / pixi.js / packages / mixin-app-loader / src / index.js View on Github external
if (!this._loader && this._options)
            {
                const { sharedLoader } = this._options;

                this._loader = sharedLoader ? Loader.shared : new Loader();
            }

            return this._loader;
        },
    },
});

// Override the destroy function
// making sure to destroy the current Loader
Application.prototype._parentDestroy = Application.prototype.destroy;
Application.prototype.destroy = function destroy(removeView, stageOptions)
{
    if (this._loader)
    {
        this._loader.destroy();
        this._loader = null;
    }
    this._parentDestroy(removeView, stageOptions);
};
github pixijs / pixi.js / packages / mixin-app-loader / src / index.js View on Github external
import { Application } from '@pixi/app';
import { Loader } from '@pixi/loaders';

Application.prototype._loader = null;

/**
 * Loader instance to help with asset loading.
 * @name PIXI.Application#loader
 * @type {PIXI.Loader}
 */
Object.defineProperties(Application.prototype, {
    loader: {
        get()
        {
            if (!this._loader && this._options)
            {
                const { sharedLoader } = this._options;

                this._loader = sharedLoader ? Loader.shared : new Loader();
            }

@pixi/app

Convenience class to create a new PixiJS application

MIT
Latest version published 9 months ago

Package Health Score

88 / 100
Full package analysis