1 | import type { ExtensionMetadata } from '@pixi/extensions';
|
2 | import type { ISystem } from '../system/ISystem';
|
3 | export interface BackgroundOptions {
|
4 | /** the main canvas background alpha. From 0 (fully transparent) to 1 (fully opaque). */
|
5 | alpha: number;
|
6 | /** the main canvas background color. */
|
7 | color: number | string;
|
8 | /** sets if the renderer will clear the canvas or not before the new render pass. */
|
9 | clearBeforeRender: boolean;
|
10 | }
|
11 | /**
|
12 | * The background system manages the background color and alpha of the main view.
|
13 | * @memberof PIXI
|
14 | */
|
15 | export declare class BackgroundSystem implements ISystem<BackgroundOptions> {
|
16 | /** @ignore */
|
17 | static extension: ExtensionMetadata;
|
18 | /**
|
19 | * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
|
20 | * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every
|
21 | * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect
|
22 | * to clear the canvas every frame. Disable this by setting this to false. For example, if
|
23 | * your game has a canvas filling background image you often don't need this set.
|
24 | * @member {boolean}
|
25 | * @default
|
26 | */
|
27 | clearBeforeRender: boolean;
|
28 | private _backgroundColorString;
|
29 | private _backgroundColorRgba;
|
30 | private _backgroundColor;
|
31 | constructor();
|
32 | /**
|
33 | * initiates the background system
|
34 | * @param {BackgroundOptions} options - the options for the background colors
|
35 | */
|
36 | init(options: BackgroundOptions): void;
|
37 | /**
|
38 | * The background color to fill if not transparent
|
39 | * @member {number}
|
40 | */
|
41 | get color(): number;
|
42 | set color(value: number);
|
43 | /**
|
44 | * The background color alpha. Setting this to 0 will make the canvas transparent.
|
45 | * @member {number}
|
46 | */
|
47 | get alpha(): number;
|
48 | set alpha(value: number);
|
49 | /**
|
50 | * The background color as an [R, G, B, A] array.
|
51 | * @member {number[]}
|
52 | * @protected
|
53 | */
|
54 | get colorRgba(): number[];
|
55 | /**
|
56 | * The background color as a string.
|
57 | * @member {string}
|
58 | * @protected
|
59 | */
|
60 | get colorString(): string;
|
61 | destroy(): void;
|
62 | }
|