57 lines
2.5 KiB
JavaScript
57 lines
2.5 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$app$Application = function(global, require, module, exports) {
|
|
global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
|
|
var autoDetectRenderer = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$autoDetectRenderer"), Container = require("module$node_modules$pixi_DOT_js$lib$scene$container$Container");
|
|
module = require("module$node_modules$pixi_DOT_js$lib$utils$global$globalHooks");
|
|
var deprecation = require("module$node_modules$pixi_DOT_js$lib$utils$logging$deprecation");
|
|
require("module$node_modules$pixi_DOT_js$lib$app$init");
|
|
"use strict";
|
|
const node_modules$pixi_DOT_js$lib$app$Application$classdecl$var33 = class {
|
|
constructor(...args) {
|
|
this.stage = new Container.Container();
|
|
void 0 !== args[0] && deprecation.deprecation(deprecation.v8_0_0, "Application constructor options are deprecated, please use Application.init() instead.");
|
|
}
|
|
async init(options) {
|
|
options = {...options};
|
|
this.stage || (this.stage = new Container.Container());
|
|
this.renderer = await autoDetectRenderer.autoDetectRenderer(options);
|
|
node_modules$pixi_DOT_js$lib$app$Application$classdecl$var33._plugins.forEach(plugin => {
|
|
plugin.init.call(this, options);
|
|
});
|
|
}
|
|
render() {
|
|
this.renderer.render({container:this.stage});
|
|
}
|
|
get canvas() {
|
|
return this.renderer.canvas;
|
|
}
|
|
get view() {
|
|
deprecation.deprecation(deprecation.v8_0_0, "Application.view is deprecated, please use Application.canvas instead.");
|
|
return this.renderer.canvas;
|
|
}
|
|
get screen() {
|
|
return this.renderer.screen;
|
|
}
|
|
get domContainerRoot() {
|
|
return this.renderer.renderPipes.dom?._domElement;
|
|
}
|
|
destroy(rendererDestroyOptions = !1, options = !1) {
|
|
const plugins = node_modules$pixi_DOT_js$lib$app$Application$classdecl$var33._plugins.slice(0);
|
|
plugins.reverse();
|
|
plugins.forEach(plugin => {
|
|
plugin.destroy.call(this);
|
|
});
|
|
this.stage.destroy(options);
|
|
this.stage = null;
|
|
this.renderer.destroy(rendererDestroyOptions);
|
|
this.renderer = null;
|
|
}
|
|
};
|
|
require = node_modules$pixi_DOT_js$lib$app$Application$classdecl$var33;
|
|
require._plugins = [];
|
|
global.extensions.handleByList(global.ExtensionType.Application, require._plugins);
|
|
global.extensions.add(module.ApplicationInitHook);
|
|
exports.Application = require;
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$app$Application.js.map
|