45 lines
2.2 KiB
JavaScript
45 lines
2.2 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$background$BackgroundSystem = function(global, require, module, exports) {
|
|
var Color = require("module$node_modules$pixi_DOT_js$lib$color$Color");
|
|
global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
|
|
var warn = require("module$node_modules$pixi_DOT_js$lib$utils$logging$warn");
|
|
"use strict";
|
|
const node_modules$pixi_DOT_js$lib$rendering$renderers$shared$background$BackgroundSystem$classdecl$var16 = class {
|
|
constructor() {
|
|
this.clearBeforeRender = !0;
|
|
this.color = this._backgroundColor = new Color.Color(0);
|
|
this.alpha = 1;
|
|
}
|
|
init(options) {
|
|
options = {...node_modules$pixi_DOT_js$lib$rendering$renderers$shared$background$BackgroundSystem$classdecl$var16.defaultOptions, ...options};
|
|
this.clearBeforeRender = options.clearBeforeRender;
|
|
this.color = options.background || options.backgroundColor || this._backgroundColor;
|
|
this.alpha = options.backgroundAlpha;
|
|
this._backgroundColor.setAlpha(options.backgroundAlpha);
|
|
}
|
|
get color() {
|
|
return this._backgroundColor;
|
|
}
|
|
set color(value) {
|
|
1 > Color.Color.shared.setValue(value).alpha && 1 === this._backgroundColor.alpha && warn.warn("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha \x3c 1 when initializing your Application.");
|
|
this._backgroundColor.setValue(value);
|
|
}
|
|
get alpha() {
|
|
return this._backgroundColor.alpha;
|
|
}
|
|
set alpha(value) {
|
|
this._backgroundColor.setAlpha(value);
|
|
}
|
|
get colorRgba() {
|
|
return this._backgroundColor.toArray();
|
|
}
|
|
destroy() {
|
|
}
|
|
};
|
|
require = node_modules$pixi_DOT_js$lib$rendering$renderers$shared$background$BackgroundSystem$classdecl$var16;
|
|
require.extension = {type:[global.ExtensionType.WebGLSystem, global.ExtensionType.WebGPUSystem, global.ExtensionType.CanvasSystem], name:"background", priority:0};
|
|
require.defaultOptions = {backgroundAlpha:1, backgroundColor:0, clearBeforeRender:!0};
|
|
exports.BackgroundSystem = require;
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$background$BackgroundSystem.js.map
|