1 | "use strict";
|
2 | var color = require("@pixi/color"), extensions = require("@pixi/extensions");
|
3 | class BackgroundSystem {
|
4 | constructor() {
|
5 | this.clearBeforeRender = !0, this._backgroundColor = new color.Color(0), this.alpha = 1;
|
6 | }
|
7 | |
8 |
|
9 |
|
10 |
|
11 | init(options) {
|
12 | this.clearBeforeRender = options.clearBeforeRender;
|
13 | const { backgroundColor, background, backgroundAlpha } = options, color2 = background ?? backgroundColor;
|
14 | color2 !== void 0 && (this.color = color2), this.alpha = backgroundAlpha;
|
15 | }
|
16 | |
17 |
|
18 |
|
19 |
|
20 | get color() {
|
21 | return this._backgroundColor.value;
|
22 | }
|
23 | set color(value) {
|
24 | this._backgroundColor.setValue(value);
|
25 | }
|
26 | |
27 |
|
28 |
|
29 |
|
30 | get alpha() {
|
31 | return this._backgroundColor.alpha;
|
32 | }
|
33 | set alpha(value) {
|
34 | this._backgroundColor.setAlpha(value);
|
35 | }
|
36 |
|
37 | get backgroundColor() {
|
38 | return this._backgroundColor;
|
39 | }
|
40 | destroy() {
|
41 | }
|
42 | }
|
43 | BackgroundSystem.defaultOptions = {
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 | backgroundAlpha: 1,
|
50 | |
51 |
|
52 |
|
53 |
|
54 |
|
55 | backgroundColor: 0,
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 | clearBeforeRender: !0
|
62 | },
|
63 | BackgroundSystem.extension = {
|
64 | type: [
|
65 | extensions.ExtensionType.RendererSystem,
|
66 | extensions.ExtensionType.CanvasRendererSystem
|
67 | ],
|
68 | name: "background"
|
69 | };
|
70 | extensions.extensions.add(BackgroundSystem);
|
71 | exports.BackgroundSystem = BackgroundSystem;
|
72 |
|