UNPKG

2 kBTypeScriptView Raw
1import { AbstractMaskSystem } from './AbstractMaskSystem';
2import type { ExtensionMetadata } from '@pixi/extensions';
3import type { Renderer } from '../Renderer';
4import type { MaskData } from './MaskData';
5/**
6 * System plugin to the renderer to manage scissor masking.
7 *
8 * Scissor masking discards pixels outside of a rectangle called the scissor box. The scissor box is in the framebuffer
9 * viewport's space; however, the mask's rectangle is projected from world-space to viewport space automatically
10 * by this system.
11 * @memberof PIXI
12 */
13export declare class ScissorSystem extends AbstractMaskSystem {
14 /** @ignore */
15 static extension: ExtensionMetadata;
16 /**
17 * @param {PIXI.Renderer} renderer - The renderer this System works for.
18 */
19 constructor(renderer: Renderer);
20 getStackLength(): number;
21 /**
22 * evaluates _boundsTransformed, _scissorRect for MaskData
23 * @param maskData
24 */
25 calcScissorRect(maskData: MaskData): void;
26 private static isMatrixRotated;
27 /**
28 * Test, whether the object can be scissor mask with current renderer projection.
29 * Calls "calcScissorRect()" if its true.
30 * @param maskData - mask data
31 * @returns whether Whether the object can be scissor mask
32 */
33 testScissor(maskData: MaskData): boolean;
34 private roundFrameToPixels;
35 /**
36 * Applies the Mask and adds it to the current stencil stack.
37 * @author alvin
38 * @param maskData - The mask data.
39 */
40 push(maskData: MaskData): void;
41 /**
42 * This should be called after a mask is popped off the mask stack. It will rebind the scissor box to be latest with the
43 * last mask in the stack.
44 *
45 * This can also be called when you directly modify the scissor box and want to restore PixiJS state.
46 * @param maskData - The mask data.
47 */
48 pop(maskData?: MaskData): void;
49 /**
50 * Setup renderer to use the current scissor data.
51 * @private
52 */
53 _useCurrent(): void;
54}