1 | import { Color } from "@pixi/color";
|
2 | import { ExtensionType, extensions } from "@pixi/extensions";
|
3 | class BackgroundSystem {
|
4 | constructor() {
|
5 | this.clearBeforeRender = !0, this._backgroundColor = new Color(0), this.alpha = 1;
|
6 | }
|
7 | |
8 |
|
9 |
|
10 |
|
11 | init(options) {
|
12 | this.clearBeforeRender = options.clearBeforeRender;
|
13 | const { backgroundColor, background, backgroundAlpha } = options, color = background ?? backgroundColor;
|
14 | color !== void 0 && (this.color = color), 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 | ExtensionType.RendererSystem,
|
66 | ExtensionType.CanvasRendererSystem
|
67 | ],
|
68 | name: "background"
|
69 | };
|
70 | extensions.add(BackgroundSystem);
|
71 | export {
|
72 | BackgroundSystem
|
73 | };
|
74 |
|