UNPKG

1.03 MBTypeScriptView Raw
1/**
2 * @namespace PIXI
3 */
4declare namespace PIXI {
5 /**
6 * String of the current PIXI version.
7 *
8 * @static
9 * @constant
10 * @memberof PIXI
11 * @name VERSION
12 * @type {string}
13 */
14 var VERSION: string;
15 /**
16 * This namespace contains WebGL-only display filters that can be applied
17 * to DisplayObjects using the {@link PIXI.DisplayObject#filters filters} property.
18 *
19 * Since PixiJS only had a handful of built-in filters, additional filters
20 * can be downloaded {@link https://github.com/pixijs/pixi-filters here} from the
21 * PixiJS Filters repository.
22 *
23 * All filters must extend {@link PIXI.Filter}.
24 *
25 * @example
26 * // Create a new application
27 * const app = new PIXI.Application();
28 *
29 * // Draw a green rectangle
30 * const rect = new PIXI.Graphics()
31 * .beginFill(0x00ff00)
32 * .drawRect(40, 40, 200, 200);
33 *
34 * // Add a blur filter
35 * rect.filters = [new PIXI.filters.BlurFilter()];
36 *
37 * // Display rectangle
38 * app.stage.addChild(rect);
39 * document.body.appendChild(app.view);
40 * @namespace PIXI.filters
41 */
42 namespace filters {
43 /**
44 * Simplest filter - applies alpha.
45 *
46 * Use this instead of Container's alpha property to avoid visual layering of individual elements.
47 * AlphaFilter applies alpha evenly across the entire display object and any opaque elements it contains.
48 * If elements are not opaque, they will blend with each other anyway.
49 *
50 * Very handy if you want to use common features of all filters:
51 *
52 * 1. Assign a blendMode to this filter, blend all elements inside display object with background.
53 *
54 * 2. To use clipping in display coordinates, assign a filterArea to the same container that has this filter.
55 *
56 * @class
57 * @extends PIXI.Filter
58 * @memberof PIXI.filters
59 */
60 class AlphaFilter extends PIXI.Filter {
61 constructor(alpha?: number);
62 /**
63 * Coefficient for alpha multiplication
64 *
65 * @member {number}
66 * @default 1
67 */
68 alpha: number;
69 /**
70 * The padding of the filter. Some filters require extra space to breath such as a blur.
71 * Increasing this will add extra width and height to the bounds of the object that the
72 * filter is applied to.
73 *
74 * @member {number} PIXI.Filter#padding
75 */
76 padding: number;
77 /**
78 * The resolution of the filter. Setting this to be lower will lower the quality but
79 * increase the performance of the filter.
80 *
81 * @member {number} PIXI.Filter#resolution
82 */
83 resolution: number;
84 /**
85 * If enabled is true the filter is applied, if false it will not.
86 *
87 * @member {boolean} PIXI.Filter#enabled
88 */
89 enabled: boolean;
90 /**
91 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
92 * Switch it off if it does not work for specific shader.
93 *
94 * @member {boolean} PIXI.Filter#autoFit
95 */
96 autoFit: boolean;
97 /**
98 * Legacy filters use position and uvs from attributes
99 * @member {boolean} PIXI.Filter#legacy
100 * @readonly
101 */
102 readonly legacy: boolean;
103 /**
104 * The WebGL state the filter requires to render
105 * @member {PIXI.State} PIXI.Filter#state
106 */
107 state: PIXI.State;
108 /**
109 * Applies the filter
110 *
111 * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
112 * @param {PIXI.RenderTexture} input - The input render target.
113 * @param {PIXI.RenderTexture} output - The target to output to.
114 * @param {PIXI.CLEAR_MODES} clearMode - Should the output be cleared before rendering to it.
115 * @param {object} [currentState] - It's current state of filter.
116 * There are some useful properties in the currentState :
117 * target, filters, sourceFrame, destinationFrame, renderTarget, resolution
118 */
119 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES, currentState?: any): void;
120 /**
121 * Sets the blendmode of the filter
122 *
123 * @member {number}
124 * @default PIXI.BLEND_MODES.NORMAL
125 */
126 blendMode: number;
127 /**
128 * Program that the shader uses
129 *
130 * @member {PIXI.Program} PIXI.Shader#program
131 */
132 program: PIXI.Program;
133 /**
134 * Shader uniform values, shortcut for `uniformGroup.uniforms`
135 * @readonly
136 * @member {object}
137 */
138 readonly uniforms: any;
139 }
140 /**
141 * The BlurFilter applies a Gaussian blur to an object.
142 *
143 * The strength of the blur can be set for the x-axis and y-axis separately.
144 *
145 * @class
146 * @extends PIXI.Filter
147 * @memberof PIXI.filters
148 */
149 class BlurFilter extends PIXI.Filter {
150 constructor(strength?: number, quality?: number, resolution?: number, kernelSize?: number);
151 /**
152 * Applies the filter.
153 *
154 * @param {PIXI.systems.FilterSystem} filterManager - The manager.
155 * @param {PIXI.RenderTexture} input - The input target.
156 * @param {PIXI.RenderTexture} output - The output target.
157 * @param {PIXI.CLEAR_MODES} clearMode - How to clear
158 */
159 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES): void;
160 /**
161 * Sets the strength of both the blurX and blurY properties simultaneously
162 *
163 * @member {number}
164 * @default 2
165 */
166 blur: number;
167 /**
168 * Sets the number of passes for blur. More passes means higher quaility bluring.
169 *
170 * @member {number}
171 * @default 1
172 */
173 quality: number;
174 /**
175 * Sets the strength of the blurX property
176 *
177 * @member {number}
178 * @default 2
179 */
180 blurX: number;
181 /**
182 * Sets the strength of the blurY property
183 *
184 * @member {number}
185 * @default 2
186 */
187 blurY: number;
188 /**
189 * Sets the blendmode of the filter
190 *
191 * @member {number}
192 * @default PIXI.BLEND_MODES.NORMAL
193 */
194 blendMode: number;
195 /**
196 * If set to true the edge of the target will be clamped
197 *
198 * @member {boolean}
199 * @default false
200 */
201 repeatEdgePixels: boolean;
202 /**
203 * The padding of the filter. Some filters require extra space to breath such as a blur.
204 * Increasing this will add extra width and height to the bounds of the object that the
205 * filter is applied to.
206 *
207 * @member {number} PIXI.Filter#padding
208 */
209 padding: number;
210 /**
211 * The resolution of the filter. Setting this to be lower will lower the quality but
212 * increase the performance of the filter.
213 *
214 * @member {number} PIXI.Filter#resolution
215 */
216 resolution: number;
217 /**
218 * If enabled is true the filter is applied, if false it will not.
219 *
220 * @member {boolean} PIXI.Filter#enabled
221 */
222 enabled: boolean;
223 /**
224 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
225 * Switch it off if it does not work for specific shader.
226 *
227 * @member {boolean} PIXI.Filter#autoFit
228 */
229 autoFit: boolean;
230 /**
231 * Legacy filters use position and uvs from attributes
232 * @member {boolean} PIXI.Filter#legacy
233 * @readonly
234 */
235 readonly legacy: boolean;
236 /**
237 * The WebGL state the filter requires to render
238 * @member {PIXI.State} PIXI.Filter#state
239 */
240 state: PIXI.State;
241 /**
242 * Program that the shader uses
243 *
244 * @member {PIXI.Program} PIXI.Shader#program
245 */
246 program: PIXI.Program;
247 /**
248 * Shader uniform values, shortcut for `uniformGroup.uniforms`
249 * @readonly
250 * @member {object}
251 */
252 readonly uniforms: any;
253 }
254 /**
255 * The BlurFilterPass applies a horizontal or vertical Gaussian blur to an object.
256 *
257 * @class
258 * @extends PIXI.Filter
259 * @memberof PIXI.filters
260 */
261 class BlurFilterPass extends PIXI.Filter {
262 constructor(horizontal: boolean, strength?: number, quality?: number, resolution?: number, kernelSize?: number);
263 /**
264 * Applies the filter.
265 *
266 * @param {PIXI.systems.FilterSystem} filterManager - The manager.
267 * @param {PIXI.RenderTexture} input - The input target.
268 * @param {PIXI.RenderTexture} output - The output target.
269 * @param {PIXI.CLEAR_MODES} clearMode - How to clear
270 */
271 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES): void;
272 /**
273 * Sets the strength of both the blur.
274 *
275 * @member {number}
276 * @default 16
277 */
278 blur: number;
279 /**
280 * Sets the quality of the blur by modifying the number of passes. More passes means higher
281 * quaility bluring but the lower the performance.
282 *
283 * @member {number}
284 * @default 4
285 */
286 quality: number;
287 /**
288 * The padding of the filter. Some filters require extra space to breath such as a blur.
289 * Increasing this will add extra width and height to the bounds of the object that the
290 * filter is applied to.
291 *
292 * @member {number} PIXI.Filter#padding
293 */
294 padding: number;
295 /**
296 * The resolution of the filter. Setting this to be lower will lower the quality but
297 * increase the performance of the filter.
298 *
299 * @member {number} PIXI.Filter#resolution
300 */
301 resolution: number;
302 /**
303 * If enabled is true the filter is applied, if false it will not.
304 *
305 * @member {boolean} PIXI.Filter#enabled
306 */
307 enabled: boolean;
308 /**
309 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
310 * Switch it off if it does not work for specific shader.
311 *
312 * @member {boolean} PIXI.Filter#autoFit
313 */
314 autoFit: boolean;
315 /**
316 * Legacy filters use position and uvs from attributes
317 * @member {boolean} PIXI.Filter#legacy
318 * @readonly
319 */
320 readonly legacy: boolean;
321 /**
322 * The WebGL state the filter requires to render
323 * @member {PIXI.State} PIXI.Filter#state
324 */
325 state: PIXI.State;
326 /**
327 * Sets the blendmode of the filter
328 *
329 * @member {number}
330 * @default PIXI.BLEND_MODES.NORMAL
331 */
332 blendMode: number;
333 /**
334 * Program that the shader uses
335 *
336 * @member {PIXI.Program} PIXI.Shader#program
337 */
338 program: PIXI.Program;
339 /**
340 * Shader uniform values, shortcut for `uniformGroup.uniforms`
341 * @readonly
342 * @member {object}
343 */
344 readonly uniforms: any;
345 }
346 /**
347 * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA
348 * color and alpha values of every pixel on your displayObject to produce a result
349 * with a new set of RGBA color and alpha values. It's pretty powerful!
350 *
351 * ```js
352 * let colorMatrix = new PIXI.filters.ColorMatrixFilter();
353 * container.filters = [colorMatrix];
354 * colorMatrix.contrast(2);
355 * ```
356 * @author Clément Chenebault <clement@goodboydigital.com>
357 * @class
358 * @extends PIXI.Filter
359 * @memberof PIXI.filters
360 */
361 class ColorMatrixFilter extends PIXI.Filter {
362 constructor();
363 /**
364 * Transforms current matrix and set the new one
365 *
366 * @param {number[]} matrix - 5x4 matrix
367 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
368 * just set the current matrix with @param matrix
369 */
370 _loadMatrix(matrix: number[], multiply: boolean): void;
371 /**
372 * Adjusts brightness
373 *
374 * @param {number} b - value of the brigthness (0-1, where 0 is black)
375 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
376 * just set the current matrix with @param matrix
377 */
378 brightness(b: number, multiply: boolean): void;
379 /**
380 * Set the matrices in grey scales
381 *
382 * @param {number} scale - value of the grey (0-1, where 0 is black)
383 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
384 * just set the current matrix with @param matrix
385 */
386 greyscale(scale: number, multiply: boolean): void;
387 /**
388 * Set the black and white matrice.
389 *
390 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
391 * just set the current matrix with @param matrix
392 */
393 blackAndWhite(multiply: boolean): void;
394 /**
395 * Set the hue property of the color
396 *
397 * @param {number} rotation - in degrees
398 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
399 * just set the current matrix with @param matrix
400 */
401 hue(rotation: number, multiply: boolean): void;
402 /**
403 * Set the contrast matrix, increase the separation between dark and bright
404 * Increase contrast : shadows darker and highlights brighter
405 * Decrease contrast : bring the shadows up and the highlights down
406 *
407 * @param {number} amount - value of the contrast (0-1)
408 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
409 * just set the current matrix with @param matrix
410 */
411 contrast(amount: number, multiply: boolean): void;
412 /**
413 * Set the saturation matrix, increase the separation between colors
414 * Increase saturation : increase contrast, brightness, and sharpness
415 *
416 * @param {number} amount - The saturation amount (0-1)
417 * @param {boolean} [multiply] - if true, current matrix and matrix are multiplied. If false,
418 * just set the current matrix with @param matrix
419 */
420 saturate(amount: number, multiply?: boolean): void;
421 /**
422 * Desaturate image (remove color)
423 *
424 * Call the saturate function
425 *
426 */
427 desaturate(): void;
428 /**
429 * Negative image (inverse of classic rgb matrix)
430 *
431 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
432 * just set the current matrix with @param matrix
433 */
434 negative(multiply: boolean): void;
435 /**
436 * Sepia image
437 *
438 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
439 * just set the current matrix with @param matrix
440 */
441 sepia(multiply: boolean): void;
442 /**
443 * Color motion picture process invented in 1916 (thanks Dominic Szablewski)
444 *
445 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
446 * just set the current matrix with @param matrix
447 */
448 technicolor(multiply: boolean): void;
449 /**
450 * Polaroid filter
451 *
452 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
453 * just set the current matrix with @param matrix
454 */
455 polaroid(multiply: boolean): void;
456 /**
457 * Filter who transforms : Red -> Blue and Blue -> Red
458 *
459 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
460 * just set the current matrix with @param matrix
461 */
462 toBGR(multiply: boolean): void;
463 /**
464 * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)
465 *
466 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
467 * just set the current matrix with @param matrix
468 */
469 kodachrome(multiply: boolean): void;
470 /**
471 * Brown delicious browni filter (thanks Dominic Szablewski)
472 *
473 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
474 * just set the current matrix with @param matrix
475 */
476 browni(multiply: boolean): void;
477 /**
478 * Vintage filter (thanks Dominic Szablewski)
479 *
480 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
481 * just set the current matrix with @param matrix
482 */
483 vintage(multiply: boolean): void;
484 /**
485 * We don't know exactly what it does, kind of gradient map, but funny to play with!
486 *
487 * @param {number} desaturation - Tone values.
488 * @param {number} toned - Tone values.
489 * @param {number} lightColor - Tone values, example: `0xFFE580`
490 * @param {number} darkColor - Tone values, example: `0xFFE580`
491 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
492 * just set the current matrix with @param matrix
493 */
494 colorTone(desaturation: number, toned: number, lightColor: number, darkColor: number, multiply: boolean): void;
495 /**
496 * Night effect
497 *
498 * @param {number} intensity - The intensity of the night effect.
499 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
500 * just set the current matrix with @param matrix
501 */
502 night(intensity: number, multiply: boolean): void;
503 /**
504 * Predator effect
505 *
506 * Erase the current matrix by setting a new indepent one
507 *
508 * @param {number} amount - how much the predator feels his future victim
509 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
510 * just set the current matrix with @param matrix
511 */
512 predator(amount: number, multiply: boolean): void;
513 /**
514 * LSD effect
515 *
516 * Multiply the current matrix
517 *
518 * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
519 * just set the current matrix with @param matrix
520 */
521 lsd(multiply: boolean): void;
522 /**
523 * Erase the current matrix by setting the default one
524 *
525 */
526 reset(): void;
527 /**
528 * The matrix of the color matrix filter
529 *
530 * @member {number[]}
531 * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]
532 */
533 matrix: number[];
534 /**
535 * The opacity value to use when mixing the original and resultant colors.
536 *
537 * When the value is 0, the original color is used without modification.
538 * When the value is 1, the result color is used.
539 * When in the range (0, 1) the color is interpolated between the original and result by this amount.
540 *
541 * @member {number}
542 * @default 1
543 */
544 alpha: number;
545 /**
546 * The padding of the filter. Some filters require extra space to breath such as a blur.
547 * Increasing this will add extra width and height to the bounds of the object that the
548 * filter is applied to.
549 *
550 * @member {number} PIXI.Filter#padding
551 */
552 padding: number;
553 /**
554 * The resolution of the filter. Setting this to be lower will lower the quality but
555 * increase the performance of the filter.
556 *
557 * @member {number} PIXI.Filter#resolution
558 */
559 resolution: number;
560 /**
561 * If enabled is true the filter is applied, if false it will not.
562 *
563 * @member {boolean} PIXI.Filter#enabled
564 */
565 enabled: boolean;
566 /**
567 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
568 * Switch it off if it does not work for specific shader.
569 *
570 * @member {boolean} PIXI.Filter#autoFit
571 */
572 autoFit: boolean;
573 /**
574 * Legacy filters use position and uvs from attributes
575 * @member {boolean} PIXI.Filter#legacy
576 * @readonly
577 */
578 readonly legacy: boolean;
579 /**
580 * The WebGL state the filter requires to render
581 * @member {PIXI.State} PIXI.Filter#state
582 */
583 state: PIXI.State;
584 /**
585 * Applies the filter
586 *
587 * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
588 * @param {PIXI.RenderTexture} input - The input render target.
589 * @param {PIXI.RenderTexture} output - The target to output to.
590 * @param {PIXI.CLEAR_MODES} clearMode - Should the output be cleared before rendering to it.
591 * @param {object} [currentState] - It's current state of filter.
592 * There are some useful properties in the currentState :
593 * target, filters, sourceFrame, destinationFrame, renderTarget, resolution
594 */
595 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES, currentState?: any): void;
596 /**
597 * Sets the blendmode of the filter
598 *
599 * @member {number}
600 * @default PIXI.BLEND_MODES.NORMAL
601 */
602 blendMode: number;
603 /**
604 * Program that the shader uses
605 *
606 * @member {PIXI.Program} PIXI.Shader#program
607 */
608 program: PIXI.Program;
609 /**
610 * Shader uniform values, shortcut for `uniformGroup.uniforms`
611 * @readonly
612 * @member {object}
613 */
614 readonly uniforms: any;
615 }
616 /**
617 * The DisplacementFilter class uses the pixel values from the specified texture
618 * (called the displacement map) to perform a displacement of an object.
619 *
620 * You can use this filter to apply all manor of crazy warping effects.
621 * Currently the `r` property of the texture is used to offset the `x`
622 * and the `g` property of the texture is used to offset the `y`.
623 *
624 * The way it works is it uses the values of the displacement map to look up the
625 * correct pixels to output. This means it's not technically moving the original.
626 * Instead, it's starting at the output and asking "which pixel from the original goes here".
627 * For example, if a displacement map pixel has `red = 1` and the filter scale is `20`,
628 * this filter will output the pixel approximately 20 pixels to the right of the original.
629 *
630 * @class
631 * @extends PIXI.Filter
632 * @memberof PIXI.filters
633 */
634 class DisplacementFilter extends PIXI.Filter {
635 constructor(sprite: PIXI.Sprite, scale?: number);
636 /**
637 * scaleX, scaleY for displacements
638 * @member {PIXI.Point} PIXI.filters.DisplacementFilter#scale
639 */
640 scale: PIXI.Point;
641 /**
642 * Applies the filter.
643 *
644 * @param {PIXI.systems.FilterSystem} filterManager - The manager.
645 * @param {PIXI.RenderTexture} input - The input target.
646 * @param {PIXI.RenderTexture} output - The output target.
647 * @param {PIXI.CLEAR_MODES} clearMode - clearMode.
648 */
649 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES): void;
650 /**
651 * The texture used for the displacement map. Must be power of 2 sized texture.
652 *
653 * @member {PIXI.Texture}
654 */
655 map: PIXI.Texture;
656 /**
657 * The padding of the filter. Some filters require extra space to breath such as a blur.
658 * Increasing this will add extra width and height to the bounds of the object that the
659 * filter is applied to.
660 *
661 * @member {number} PIXI.Filter#padding
662 */
663 padding: number;
664 /**
665 * The resolution of the filter. Setting this to be lower will lower the quality but
666 * increase the performance of the filter.
667 *
668 * @member {number} PIXI.Filter#resolution
669 */
670 resolution: number;
671 /**
672 * If enabled is true the filter is applied, if false it will not.
673 *
674 * @member {boolean} PIXI.Filter#enabled
675 */
676 enabled: boolean;
677 /**
678 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
679 * Switch it off if it does not work for specific shader.
680 *
681 * @member {boolean} PIXI.Filter#autoFit
682 */
683 autoFit: boolean;
684 /**
685 * Legacy filters use position and uvs from attributes
686 * @member {boolean} PIXI.Filter#legacy
687 * @readonly
688 */
689 readonly legacy: boolean;
690 /**
691 * The WebGL state the filter requires to render
692 * @member {PIXI.State} PIXI.Filter#state
693 */
694 state: PIXI.State;
695 /**
696 * Sets the blendmode of the filter
697 *
698 * @member {number}
699 * @default PIXI.BLEND_MODES.NORMAL
700 */
701 blendMode: number;
702 /**
703 * Program that the shader uses
704 *
705 * @member {PIXI.Program} PIXI.Shader#program
706 */
707 program: PIXI.Program;
708 /**
709 * Shader uniform values, shortcut for `uniformGroup.uniforms`
710 * @readonly
711 * @member {object}
712 */
713 readonly uniforms: any;
714 }
715 /**
716 * Basic FXAA (Fast Approximate Anti-Aliasing) implementation based on the code on geeks3d.com
717 * with the modification that the texture2DLod stuff was removed since it is unsupported by WebGL.
718 *
719 * @see https://github.com/mitsuhiko/webgl-meincraft
720 *
721 * @class
722 * @extends PIXI.Filter
723 * @memberof PIXI.filters
724 *
725 */
726 class FXAAFilter extends PIXI.Filter {
727 constructor();
728 /**
729 * The padding of the filter. Some filters require extra space to breath such as a blur.
730 * Increasing this will add extra width and height to the bounds of the object that the
731 * filter is applied to.
732 *
733 * @member {number} PIXI.Filter#padding
734 */
735 padding: number;
736 /**
737 * The resolution of the filter. Setting this to be lower will lower the quality but
738 * increase the performance of the filter.
739 *
740 * @member {number} PIXI.Filter#resolution
741 */
742 resolution: number;
743 /**
744 * If enabled is true the filter is applied, if false it will not.
745 *
746 * @member {boolean} PIXI.Filter#enabled
747 */
748 enabled: boolean;
749 /**
750 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
751 * Switch it off if it does not work for specific shader.
752 *
753 * @member {boolean} PIXI.Filter#autoFit
754 */
755 autoFit: boolean;
756 /**
757 * Legacy filters use position and uvs from attributes
758 * @member {boolean} PIXI.Filter#legacy
759 * @readonly
760 */
761 readonly legacy: boolean;
762 /**
763 * The WebGL state the filter requires to render
764 * @member {PIXI.State} PIXI.Filter#state
765 */
766 state: PIXI.State;
767 /**
768 * Applies the filter
769 *
770 * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
771 * @param {PIXI.RenderTexture} input - The input render target.
772 * @param {PIXI.RenderTexture} output - The target to output to.
773 * @param {PIXI.CLEAR_MODES} clearMode - Should the output be cleared before rendering to it.
774 * @param {object} [currentState] - It's current state of filter.
775 * There are some useful properties in the currentState :
776 * target, filters, sourceFrame, destinationFrame, renderTarget, resolution
777 */
778 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES, currentState?: any): void;
779 /**
780 * Sets the blendmode of the filter
781 *
782 * @member {number}
783 * @default PIXI.BLEND_MODES.NORMAL
784 */
785 blendMode: number;
786 /**
787 * Program that the shader uses
788 *
789 * @member {PIXI.Program} PIXI.Shader#program
790 */
791 program: PIXI.Program;
792 /**
793 * Shader uniform values, shortcut for `uniformGroup.uniforms`
794 * @readonly
795 * @member {object}
796 */
797 readonly uniforms: any;
798 }
799 /**
800 * A Noise effect filter.
801 *
802 * @class
803 * @extends PIXI.Filter
804 * @memberof PIXI.filters
805 */
806 class NoiseFilter extends PIXI.Filter {
807 constructor(noise?: number, seed?: number);
808 /**
809 * The amount of noise to apply, this value should be in the range (0, 1].
810 *
811 * @member {number}
812 * @default 0.5
813 */
814 noise: number;
815 /**
816 * A seed value to apply to the random noise generation. `Math.random()` is a good value to use.
817 *
818 * @member {number}
819 */
820 seed: number;
821 /**
822 * The padding of the filter. Some filters require extra space to breath such as a blur.
823 * Increasing this will add extra width and height to the bounds of the object that the
824 * filter is applied to.
825 *
826 * @member {number} PIXI.Filter#padding
827 */
828 padding: number;
829 /**
830 * The resolution of the filter. Setting this to be lower will lower the quality but
831 * increase the performance of the filter.
832 *
833 * @member {number} PIXI.Filter#resolution
834 */
835 resolution: number;
836 /**
837 * If enabled is true the filter is applied, if false it will not.
838 *
839 * @member {boolean} PIXI.Filter#enabled
840 */
841 enabled: boolean;
842 /**
843 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
844 * Switch it off if it does not work for specific shader.
845 *
846 * @member {boolean} PIXI.Filter#autoFit
847 */
848 autoFit: boolean;
849 /**
850 * Legacy filters use position and uvs from attributes
851 * @member {boolean} PIXI.Filter#legacy
852 * @readonly
853 */
854 readonly legacy: boolean;
855 /**
856 * The WebGL state the filter requires to render
857 * @member {PIXI.State} PIXI.Filter#state
858 */
859 state: PIXI.State;
860 /**
861 * Applies the filter
862 *
863 * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
864 * @param {PIXI.RenderTexture} input - The input render target.
865 * @param {PIXI.RenderTexture} output - The target to output to.
866 * @param {PIXI.CLEAR_MODES} clearMode - Should the output be cleared before rendering to it.
867 * @param {object} [currentState] - It's current state of filter.
868 * There are some useful properties in the currentState :
869 * target, filters, sourceFrame, destinationFrame, renderTarget, resolution
870 */
871 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES, currentState?: any): void;
872 /**
873 * Sets the blendmode of the filter
874 *
875 * @member {number}
876 * @default PIXI.BLEND_MODES.NORMAL
877 */
878 blendMode: number;
879 /**
880 * Program that the shader uses
881 *
882 * @member {PIXI.Program} PIXI.Shader#program
883 */
884 program: PIXI.Program;
885 /**
886 * Shader uniform values, shortcut for `uniformGroup.uniforms`
887 * @readonly
888 * @member {object}
889 */
890 readonly uniforms: any;
891 }
892 }
893 /**
894 * The Accessibility manager recreates the ability to tab and have content read by screen readers.
895 * This is very important as it can possibly help people with disabilities access PixiJS content.
896 *
897 * A DisplayObject can be made accessible just like it can be made interactive. This manager will map the
898 * events as if the mouse was being used, minimizing the effort required to implement.
899 *
900 * An instance of this class is automatically created by default, and can be found at `renderer.plugins.accessibility`
901 *
902 * @class
903 * @memberof PIXI
904 */
905 class AccessibilityManager {
906 constructor(renderer: PIXI.CanvasRenderer | PIXI.Renderer);
907 /**
908 * Setting this to true will visually show the divs.
909 *
910 * @type {boolean}
911 */
912 debug: boolean;
913 /**
914 * The renderer this accessibility manager works for.
915 *
916 * @member {PIXI.AbstractRenderer} PIXI.AccessibilityManager#renderer
917 */
918 renderer: PIXI.AbstractRenderer;
919 /**
920 * A flag
921 * @member {boolean}
922 * @readonly
923 */
924 readonly isActive: boolean;
925 /**
926 * A flag
927 * @member {boolean}
928 * @readonly
929 */
930 readonly isMobileAccessibility: boolean;
931 /**
932 * private function that will visually add the information to the
933 * accessability div
934 *
935 * @param {HTMLElement} div
936 */
937 updateDebugHTML(div: HTMLElement): void;
938 /**
939 * Adjust the hit area based on the bounds of a display object
940 *
941 * @param {PIXI.Rectangle} hitArea - Bounds of the child
942 */
943 capHitArea(hitArea: PIXI.Rectangle): void;
944 /**
945 * Destroys the accessibility manager
946 *
947 */
948 destroy(): void;
949 }
950 /**
951 * Convenience class to create a new PIXI application.
952 *
953 * This class automatically creates the renderer, ticker and root container.
954 *
955 * @example
956 * // Create the application
957 * const app = new PIXI.Application();
958 *
959 * // Add the view to the DOM
960 * document.body.appendChild(app.view);
961 *
962 * // ex, add display objects
963 * app.stage.addChild(PIXI.Sprite.from('something.png'));
964 *
965 * @class
966 * @memberof PIXI
967 */
968 class Application {
969 constructor(options?: {
970 autoStart?: boolean;
971 width?: number;
972 height?: number;
973 view?: HTMLCanvasElement;
974 transparent?: boolean;
975 autoDensity?: boolean;
976 antialias?: boolean;
977 preserveDrawingBuffer?: boolean;
978 resolution?: number;
979 forceCanvas?: boolean;
980 backgroundColor?: number;
981 clearBeforeRender?: boolean;
982 powerPreference?: string;
983 sharedTicker?: boolean;
984 sharedLoader?: boolean;
985 resizeTo?: Window | HTMLElement;
986 });
987 /**
988 * WebGL renderer if available, otherwise CanvasRenderer.
989 * @member {PIXI.Renderer|PIXI.CanvasRenderer} PIXI.Application#renderer
990 */
991 renderer: PIXI.Renderer | PIXI.CanvasRenderer;
992 /**
993 * The root display container that's rendered.
994 * @member {PIXI.Container} PIXI.Application#stage
995 */
996 stage: PIXI.Container;
997 /**
998 * Register a middleware plugin for the application
999 * @static
1000 * @param {PIXI.Application.Plugin} plugin - Plugin being installed
1001 */
1002 static registerPlugin(plugin: PIXI.Application.Plugin): void;
1003 /**
1004 * Render the current stage.
1005 */
1006 render(): void;
1007 /**
1008 * Reference to the renderer's canvas element.
1009 * @member {HTMLCanvasElement}
1010 * @readonly
1011 */
1012 readonly view: HTMLCanvasElement;
1013 /**
1014 * Reference to the renderer's screen rectangle. Its safe to use as `filterArea` or `hitArea` for the whole screen.
1015 * @member {PIXI.Rectangle}
1016 * @readonly
1017 */
1018 readonly screen: PIXI.Rectangle;
1019 /**
1020 * Destroy and don't use after this.
1021 * @param {Boolean} [removeView=false] - Automatically remove canvas from DOM.
1022 * @param {object|boolean} [stageOptions] - Options parameter. A boolean will act as if all options
1023 * have been set to that value
1024 * @param {boolean} [stageOptions.children=false] - if set to true, all the children will have their destroy
1025 * method called as well. 'stageOptions' will be passed on to those calls.
1026 * @param {boolean} [stageOptions.texture=false] - Only used for child Sprites if stageOptions.children is set
1027 * to true. Should it destroy the texture of the child sprite
1028 * @param {boolean} [stageOptions.baseTexture=false] - Only used for child Sprites if stageOptions.children is set
1029 * to true. Should it destroy the base texture of the child sprite
1030 */
1031 destroy(removeView?: boolean, stageOptions?: {
1032 children?: boolean;
1033 texture?: boolean;
1034 baseTexture?: boolean;
1035 }): void;
1036 /**
1037 * The HTML element or window to automatically resize the
1038 * renderer's view element to match width and height.
1039 * @type {Window|HTMLElement}
1040 * @name resizeTo
1041 * @memberof PIXI.Application#
1042 */
1043 resizeTo: Window | HTMLElement;
1044 /**
1045 * Resize is throttled, so it's
1046 * safe to call this multiple times per frame and it'll
1047 * only be called once.
1048 * @method PIXI.Application#queueResize
1049 */
1050 queueResize(): void;
1051 /**
1052 * Execute an immediate resize on the renderer, this is not
1053 * throttled and can be expensive to call many times in a row.
1054 * Will resize only if `resizeTo` property is set.
1055 * @method PIXI.Application#resize
1056 */
1057 resize(): void;
1058 /**
1059 * Loader instance to help with asset loading.
1060 * @name PIXI.Application#loader
1061 * @type {PIXI.Loader}
1062 * @readonly
1063 */
1064 readonly loader: PIXI.Loader;
1065 /**
1066 * Convenience method for stopping the render.
1067 *
1068 * @method PIXI.Application#stop
1069 */
1070 stop(): void;
1071 /**
1072 * Convenience method for starting the render.
1073 *
1074 * @method PIXI.Application#start
1075 */
1076 start(): void;
1077 /**
1078 * Ticker for doing render updates.
1079 *
1080 * @type {PIXI.Ticker}
1081 * @name ticker
1082 * @memberof PIXI.Application#
1083 * @default PIXI.Ticker.shared
1084 */
1085 ticker: PIXI.Ticker;
1086 }
1087 module Application {
1088 /**
1089 * @memberof PIXI.Application
1090 * @typedef {object} Plugin
1091 * @property {function} init - Called when Application is constructed, scoped to Application instance.
1092 * Passes in `options` as the only argument, which are Application constructor options.
1093 * @property {function} destroy - Called when destroying Application, scoped to Application instance
1094 */
1095 type Plugin = {
1096 init: (...params: any[]) => any;
1097 destroy: (...params: any[]) => any;
1098 };
1099 }
1100 /**
1101 * The extract manager provides functionality to export content from the renderers.
1102 *
1103 * An instance of this class is automatically created by default, and can be found at `renderer.plugins.extract`
1104 *
1105 * @class
1106 * @memberof PIXI
1107 */
1108 class CanvasExtract {
1109 constructor(renderer: PIXI.CanvasRenderer);
1110 /**
1111 * Will return a HTML Image of the target
1112 *
1113 * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
1114 * to convert. If left empty will use the main renderer
1115 * @param {string} [format] - Image format, e.g. "image/jpeg" or "image/webp".
1116 * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.
1117 * @return {HTMLImageElement} HTML Image of the target
1118 */
1119 image(target: PIXI.DisplayObject | PIXI.RenderTexture, format?: string, quality?: number): HTMLImageElement;
1120 /**
1121 * Will return a a base64 encoded string of this target. It works by calling
1122 * `CanvasExtract.getCanvas` and then running toDataURL on that.
1123 *
1124 * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
1125 * to convert. If left empty will use the main renderer
1126 * @param {string} [format] - Image format, e.g. "image/jpeg" or "image/webp".
1127 * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.
1128 * @return {string} A base64 encoded string of the texture.
1129 */
1130 base64(target: PIXI.DisplayObject | PIXI.RenderTexture, format?: string, quality?: number): string;
1131 /**
1132 * Creates a Canvas element, renders this target to it and then returns it.
1133 *
1134 * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
1135 * to convert. If left empty will use the main renderer
1136 * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.
1137 */
1138 canvas(target: PIXI.DisplayObject | PIXI.RenderTexture): HTMLCanvasElement;
1139 /**
1140 * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA
1141 * order, with integer values between 0 and 255 (included).
1142 *
1143 * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
1144 * to convert. If left empty will use the main renderer
1145 * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture
1146 */
1147 pixels(target: PIXI.DisplayObject | PIXI.RenderTexture): Uint8ClampedArray;
1148 /**
1149 * Destroys the extract
1150 *
1151 */
1152 destroy(): void;
1153 }
1154 /**
1155 * Renderer dedicated to drawing and batching graphics objects.
1156 *
1157 * @class
1158 * @protected
1159 * @memberof PIXI
1160 */
1161 class CanvasGraphicsRenderer {
1162 constructor(renderer: PIXI.CanvasRenderer);
1163 /**
1164 * Renders a Graphics object to a canvas.
1165 *
1166 * @param {PIXI.Graphics} graphics - the actual graphics object to render
1167 */
1168 render(graphics: PIXI.Graphics): void;
1169 /**
1170 * destroy graphics object
1171 *
1172 */
1173 destroy(): void;
1174 }
1175 /**
1176 * Renderer dedicated to meshes.
1177 *
1178 * @class
1179 * @protected
1180 * @memberof PIXI
1181 */
1182 class CanvasMeshRenderer {
1183 constructor(renderer: PIXI.CanvasRenderer);
1184 /**
1185 * Renders the Mesh
1186 *
1187 * @param {PIXI.Mesh} mesh - the Mesh to render
1188 */
1189 render(mesh: PIXI.Mesh): void;
1190 /**
1191 * destroy the the renderer.
1192 *
1193 */
1194 destroy(): void;
1195 }
1196 /**
1197 * The prepare manager provides functionality to upload content to the GPU.
1198 *
1199 * This cannot be done directly for Canvas like in WebGL, but the effect can be achieved by drawing
1200 * textures to an offline canvas. This draw call will force the texture to be moved onto the GPU.
1201 *
1202 * An instance of this class is automatically created by default, and can be found at `renderer.plugins.prepare`
1203 *
1204 * @class
1205 * @extends PIXI.BasePrepare
1206 * @memberof PIXI
1207 */
1208 class CanvasPrepare extends PIXI.BasePrepare {
1209 constructor(renderer: PIXI.CanvasRenderer);
1210 /**
1211 * Destroys the plugin, don't use after this.
1212 *
1213 */
1214 destroy(): void;
1215 /**
1216 * The limiter to be used to control how quickly items are prepared.
1217 * @type {PIXI.CountLimiter|PIXI.TimeLimiter}
1218 */
1219 limiter: PIXI.CountLimiter | PIXI.TimeLimiter;
1220 /**
1221 * Reference to the renderer.
1222 * @type {PIXI.AbstractRenderer}
1223 * @protected
1224 */
1225 protected renderer: PIXI.AbstractRenderer;
1226 /**
1227 * The only real difference between CanvasPrepare and Prepare is what they pass
1228 * to upload hooks. That different parameter is stored here.
1229 * @type {object}
1230 * @protected
1231 */
1232 protected uploadHookHelper: any;
1233 /**
1234 * Upload all the textures and graphics to the GPU.
1235 *
1236 * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item -
1237 * Either the container or display object to search for items to upload, the items to upload themselves,
1238 * or the callback function, if items have been added using `prepare.add`.
1239 * @param {Function} [done] - Optional callback when all queued uploads have completed
1240 */
1241 upload(item: ((...params: any[]) => any) | PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text, done?: (...params: any[]) => any): void;
1242 /**
1243 * Adds hooks for finding items.
1244 *
1245 * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`
1246 * function must return `true` if it was able to add item to the queue.
1247 * @return {this} Instance of plugin for chaining.
1248 */
1249 registerFindHook(addHook: (...params: any[]) => any): this;
1250 /**
1251 * Adds hooks for uploading items.
1252 *
1253 * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and
1254 * function must return `true` if it was able to handle upload of item.
1255 * @return {this} Instance of plugin for chaining.
1256 */
1257 registerUploadHook(uploadHook: (...params: any[]) => any): this;
1258 /**
1259 * Manually add an item to the uploading queue.
1260 *
1261 * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to
1262 * add to the queue
1263 * @return {this} Instance of plugin for chaining.
1264 */
1265 add(item: PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | any): this;
1266 }
1267 /**
1268 * The CanvasRenderer draws the scene and all its content onto a 2d canvas.
1269 *
1270 * This renderer should be used for browsers that do not support WebGL.
1271 * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything!
1272 *
1273 * @class
1274 * @memberof PIXI
1275 * @extends PIXI.AbstractRenderer
1276 */
1277 class CanvasRenderer extends PIXI.AbstractRenderer {
1278 constructor(options?: {
1279 width?: number;
1280 height?: number;
1281 view?: HTMLCanvasElement;
1282 transparent?: boolean;
1283 autoDensity?: boolean;
1284 antialias?: boolean;
1285 resolution?: number;
1286 preserveDrawingBuffer?: boolean;
1287 clearBeforeRender?: boolean;
1288 backgroundColor?: number;
1289 });
1290 /**
1291 * @name PIXI.CanvasRenderer#extract
1292 * @type {PIXI.CanvasExtract}
1293 * @see PIXI.CanvasRenderer#plugins
1294 * @deprecated since 5.3.0
1295 */
1296 extract: PIXI.CanvasExtract;
1297 /**
1298 * The root canvas 2d context that everything is drawn with.
1299 *
1300 * @member {CanvasRenderingContext2D} PIXI.CanvasRenderer#rootContext
1301 */
1302 rootContext: CanvasRenderingContext2D;
1303 /**
1304 * The currently active canvas 2d context (could change with renderTextures)
1305 *
1306 * @member {CanvasRenderingContext2D} PIXI.CanvasRenderer#context
1307 */
1308 context: CanvasRenderingContext2D;
1309 /**
1310 * Boolean flag controlling canvas refresh.
1311 *
1312 * @member {boolean} PIXI.CanvasRenderer#refresh
1313 */
1314 refresh: boolean;
1315 /**
1316 * Instance of a CanvasMaskManager, handles masking when using the canvas renderer.
1317 *
1318 * @member {PIXI.CanvasMaskManager} PIXI.CanvasRenderer#maskManager
1319 */
1320 maskManager: PIXI.CanvasMaskManager;
1321 /**
1322 * The canvas property used to set the canvas smoothing property.
1323 *
1324 * @member {string} PIXI.CanvasRenderer#smoothProperty
1325 */
1326 smoothProperty: string;
1327 /**
1328 * Tracks the blend modes useful for this renderer.
1329 *
1330 * @member {object<number, string>} PIXI.CanvasRenderer#blendModes
1331 */
1332 blendModes: {
1333 [key: number]: string;
1334 };
1335 /**
1336 * Renders the object to this canvas view
1337 *
1338 * @param {PIXI.DisplayObject} displayObject - The object to be rendered
1339 * @param {PIXI.RenderTexture} [renderTexture] - A render texture to be rendered to.
1340 * If unset, it will render to the root context.
1341 * @param {boolean} [clear=this.clearBeforeRender] - Whether to clear the canvas before drawing
1342 * @param {PIXI.Matrix} [transform] - A transformation to be applied
1343 * @param {boolean} [skipUpdateTransform=false] - Whether to skip the update transform
1344 */
1345 render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Matrix, skipUpdateTransform?: boolean): void;
1346 /**
1347 * sets matrix of context
1348 * called only from render() methods
1349 * takes care about resolution
1350 * @param {PIXI.Matrix} transform - world matrix of current element
1351 * @param {boolean} [roundPixels] - whether to round (tx,ty) coords
1352 * @param {number} [localResolution] - If specified, used instead of `renderer.resolution` for local scaling
1353 */
1354 setContextTransform(transform: PIXI.Matrix, roundPixels?: boolean, localResolution?: number): void;
1355 /**
1356 * Clear the canvas of renderer.
1357 *
1358 * @param {string} [clearColor] - Clear the canvas with this color, except the canvas is transparent.
1359 */
1360 clear(clearColor?: string): void;
1361 /**
1362 * Sets the blend mode of the renderer.
1363 *
1364 * @param {number} blendMode - See {@link PIXI.BLEND_MODES} for valid values.
1365 * @param {boolean} [readyForOuterBlend=false] - Some blendModes are dangerous, they affect outer space of sprite.
1366 * Pass `true` only if you are ready to use them.
1367 */
1368 setBlendMode(blendMode: number, readyForOuterBlend?: boolean): void;
1369 /**
1370 * Removes everything from the renderer and optionally removes the Canvas DOM element.
1371 *
1372 * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.
1373 */
1374 destroy(removeView?: boolean): void;
1375 /**
1376 * Resizes the canvas view to the specified width and height.
1377 *
1378 * @extends PIXI.AbstractRenderer#resize
1379 *
1380 * @param {number} screenWidth - the new width of the screen
1381 * @param {number} screenHeight - the new height of the screen
1382 */
1383 resize(screenWidth: number, screenHeight: number): void;
1384 /**
1385 * Checks if blend mode has changed.
1386 */
1387 invalidateBlendMode(): void;
1388 /**
1389 * Collection of installed plugins. These are included by default in PIXI, but can be excluded
1390 * by creating a custom build. Consult the README for more information about creating custom
1391 * builds and excluding plugins.
1392 * @name PIXI.CanvasRenderer#plugins
1393 * @type {object}
1394 * @readonly
1395 * @property {PIXI.AccessibilityManager} accessibility Support tabbing interactive elements.
1396 * @property {PIXI.CanvasExtract} extract Extract image data from renderer.
1397 * @property {PIXI.InteractionManager} interaction Handles mouse, touch and pointer events.
1398 * @property {PIXI.CanvasPrepare} prepare Pre-render display objects.
1399 */
1400 readonly plugins: {
1401 accessibility: PIXI.AccessibilityManager;
1402 extract: PIXI.CanvasExtract;
1403 interaction: PIXI.InteractionManager;
1404 prepare: PIXI.CanvasPrepare;
1405 };
1406 /**
1407 * Adds a plugin to the renderer.
1408 *
1409 * @method
1410 * @param {string} pluginName - The name of the plugin.
1411 * @param {Function} ctor - The constructor function or class for the plugin.
1412 */
1413 static registerPlugin(pluginName: string, ctor: (...params: any[]) => any): void;
1414 /**
1415 * The supplied constructor options.
1416 *
1417 * @member {Object} PIXI.AbstractRenderer#options
1418 * @readOnly
1419 */
1420 readonly options: any;
1421 /**
1422 * The type of the renderer.
1423 *
1424 * @member {number} PIXI.AbstractRenderer#type
1425 * @default PIXI.RENDERER_TYPE.UNKNOWN
1426 * @see PIXI.RENDERER_TYPE
1427 */
1428 type: number;
1429 /**
1430 * Measurements of the screen. (0, 0, screenWidth, screenHeight).
1431 *
1432 * Its safe to use as filterArea or hitArea for the whole stage.
1433 *
1434 * @member {PIXI.Rectangle} PIXI.AbstractRenderer#screen
1435 */
1436 screen: PIXI.Rectangle;
1437 /**
1438 * The canvas element that everything is drawn to.
1439 *
1440 * @member {HTMLCanvasElement} PIXI.AbstractRenderer#view
1441 */
1442 view: HTMLCanvasElement;
1443 /**
1444 * The resolution / device pixel ratio of the renderer.
1445 *
1446 * @member {number} PIXI.AbstractRenderer#resolution
1447 * @default 1
1448 */
1449 resolution: number;
1450 /**
1451 * Whether the render view is transparent.
1452 *
1453 * @member {boolean} PIXI.AbstractRenderer#transparent
1454 */
1455 transparent: boolean;
1456 /**
1457 * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
1458 *
1459 * @member {boolean} PIXI.AbstractRenderer#autoDensity
1460 */
1461 autoDensity: boolean;
1462 /**
1463 * The value of the preserveDrawingBuffer flag affects whether or not the contents of
1464 * the stencil buffer is retained after rendering.
1465 *
1466 * @member {boolean} PIXI.AbstractRenderer#preserveDrawingBuffer
1467 */
1468 preserveDrawingBuffer: boolean;
1469 /**
1470 * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
1471 * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every
1472 * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect
1473 * to clear the canvas every frame. Disable this by setting this to false. For example, if
1474 * your game has a canvas filling background image you often don't need this set.
1475 *
1476 * @member {boolean} PIXI.AbstractRenderer#clearBeforeRender
1477 * @default
1478 */
1479 clearBeforeRender: boolean;
1480 /**
1481 * The background color as a number.
1482 *
1483 * @member {number} PIXI.AbstractRenderer#_backgroundColor
1484 * @protected
1485 */
1486 protected _backgroundColor: number;
1487 /**
1488 * The background color as an [R, G, B] array.
1489 *
1490 * @member {number[]} PIXI.AbstractRenderer#_backgroundColorRgba
1491 * @protected
1492 */
1493 protected _backgroundColorRgba: number[];
1494 /**
1495 * The background color as a string.
1496 *
1497 * @member {string} PIXI.AbstractRenderer#_backgroundColorString
1498 * @protected
1499 */
1500 protected _backgroundColorString: string;
1501 /**
1502 * The last root object that the renderer tried to render.
1503 *
1504 * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_lastObjectRendered
1505 * @protected
1506 */
1507 protected _lastObjectRendered: PIXI.DisplayObject;
1508 /**
1509 * Initialize the plugins.
1510 *
1511 * @protected
1512 * @param {object} staticMap - The dictionary of statically saved plugins.
1513 */
1514 protected initPlugins(staticMap: any): void;
1515 /**
1516 * Same as view.width, actual number of pixels in the canvas by horizontal.
1517 *
1518 * @member {number}
1519 * @readonly
1520 * @default 800
1521 */
1522 readonly width: number;
1523 /**
1524 * Same as view.height, actual number of pixels in the canvas by vertical.
1525 *
1526 * @member {number}
1527 * @readonly
1528 * @default 600
1529 */
1530 readonly height: number;
1531 /**
1532 * Useful function that returns a texture of the display object that can then be used to create sprites
1533 * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.
1534 *
1535 * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from.
1536 * @param {PIXI.SCALE_MODES} scaleMode - The scale mode of the texture.
1537 * @param {number} resolution - The resolution / device pixel ratio of the texture being generated.
1538 * @param {PIXI.Rectangle} [region] - The region of the displayObject, that shall be rendered,
1539 * if no region is specified, defaults to the local bounds of the displayObject.
1540 * @return {PIXI.RenderTexture} A texture of the graphics object.
1541 */
1542 generateTexture(displayObject: PIXI.DisplayObject, scaleMode: PIXI.SCALE_MODES, resolution: number, region?: PIXI.Rectangle): PIXI.RenderTexture;
1543 /**
1544 * The background color to fill if not transparent
1545 *
1546 * @member {number}
1547 */
1548 backgroundColor: number;
1549 }
1550 /**
1551 * Utility methods for Sprite/Texture tinting.
1552 *
1553 * Tinting with the CanvasRenderer involves creating a new canvas to use as a texture,
1554 * so be aware of the performance implications.
1555 *
1556 * @namespace PIXI.canvasUtils
1557 * @memberof PIXI
1558 */
1559 namespace canvasUtils {
1560 /**
1561 * Basically this method just needs a sprite and a color and tints the sprite with the given color.
1562 *
1563 * @memberof PIXI.canvasUtils
1564 * @param {PIXI.Sprite} sprite - the sprite to tint
1565 * @param {number} color - the color to use to tint the sprite with
1566 * @return {HTMLCanvasElement} The tinted canvas
1567 */
1568 function getTintedCanvas(sprite: PIXI.Sprite, color: number): HTMLCanvasElement;
1569 /**
1570 * Basically this method just needs a sprite and a color and tints the sprite with the given color.
1571 *
1572 * @memberof PIXI.canvasUtils
1573 * @param {PIXI.Texture} texture - the sprite to tint
1574 * @param {number} color - the color to use to tint the sprite with
1575 * @return {HTMLCanvasElement} The tinted canvas
1576 */
1577 function getTintedPattern(texture: PIXI.Texture, color: number): HTMLCanvasElement;
1578 /**
1579 * Tint a texture using the 'multiply' operation.
1580 *
1581 * @memberof PIXI.canvasUtils
1582 * @param {PIXI.Texture} texture - the texture to tint
1583 * @param {number} color - the color to use to tint the sprite with
1584 * @param {HTMLCanvasElement} canvas - the current canvas
1585 */
1586 function tintWithMultiply(texture: PIXI.Texture, color: number, canvas: HTMLCanvasElement): void;
1587 /**
1588 * Tint a texture using the 'overlay' operation.
1589 *
1590 * @memberof PIXI.canvasUtils
1591 * @param {PIXI.Texture} texture - the texture to tint
1592 * @param {number} color - the color to use to tint the sprite with
1593 * @param {HTMLCanvasElement} canvas - the current canvas
1594 */
1595 function tintWithOverlay(texture: PIXI.Texture, color: number, canvas: HTMLCanvasElement): void;
1596 /**
1597 * Tint a texture pixel per pixel.
1598 *
1599 * @memberof PIXI.canvasUtils
1600 * @param {PIXI.Texture} texture - the texture to tint
1601 * @param {number} color - the color to use to tint the sprite with
1602 * @param {HTMLCanvasElement} canvas - the current canvas
1603 */
1604 function tintWithPerPixel(texture: PIXI.Texture, color: number, canvas: HTMLCanvasElement): void;
1605 /**
1606 * Rounds the specified color according to the canvasUtils.cacheStepsPerColorChannel.
1607 *
1608 * @memberof PIXI.canvasUtils
1609 * @param {number} color - the color to round, should be a hex color
1610 * @return {number} The rounded color.
1611 */
1612 function roundColor(color: number): number;
1613 /**
1614 * Number of steps which will be used as a cap when rounding colors.
1615 *
1616 * @memberof PIXI.canvasUtils
1617 * @type {number}
1618 */
1619 var cacheStepsPerColorChannel: number;
1620 /**
1621 * Tint cache boolean flag.
1622 *
1623 * @memberof PIXI.canvasUtils
1624 * @type {boolean}
1625 */
1626 var convertTintToImage: boolean;
1627 /**
1628 * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.
1629 *
1630 * @memberof PIXI.canvasUtils
1631 * @type {boolean}
1632 */
1633 var canUseMultiply: boolean;
1634 /**
1635 * The tinting method that will be used.
1636 *
1637 * @memberof PIXI.canvasUtils
1638 * @type {Function}
1639 */
1640 var tintMethod: (...params: any[]) => any;
1641 }
1642 /**
1643 * A set of functions used to handle masking.
1644 *
1645 * Sprite masking is not supported on the CanvasRenderer.
1646 *
1647 * @class
1648 * @memberof PIXI
1649 */
1650 class CanvasMaskManager {
1651 constructor(renderer: PIXI.CanvasRenderer);
1652 /**
1653 * This method adds it to the current stack of masks.
1654 *
1655 * @param {PIXI.MaskData | PIXI.Graphics} maskData - the maskData that will be pushed
1656 */
1657 pushMask(maskData: PIXI.MaskData | PIXI.Graphics): void;
1658 /**
1659 * Renders all PIXI.Graphics shapes in a subtree.
1660 *
1661 * @param {PIXI.Container} container - container to scan.
1662 * @param {PIXI.Graphics[]} out - where to put found shapes
1663 */
1664 recursiveFindShapes(container: PIXI.Container, out: PIXI.Graphics[]): void;
1665 /**
1666 * Renders a PIXI.Graphics shape.
1667 *
1668 * @param {PIXI.Graphics} graphics - The object to render.
1669 */
1670 renderGraphicsShape(graphics: PIXI.Graphics): void;
1671 /**
1672 * Restores the current drawing context to the state it was before the mask was applied.
1673 *
1674 * @param {PIXI.CanvasRenderer} renderer - The renderer context to use.
1675 */
1676 popMask(renderer: PIXI.CanvasRenderer): void;
1677 /**
1678 * Destroys this canvas mask manager.
1679 *
1680 */
1681 destroy(): void;
1682 }
1683 /**
1684 * Types that can be passed to drawImage
1685 * @typedef {HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap} ICanvasImageSource
1686 * @memberof PIXI
1687 */
1688 type ICanvasImageSource = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap;
1689 /**
1690 * Renderer dedicated to drawing and batching sprites.
1691 *
1692 * @class
1693 * @protected
1694 * @memberof PIXI
1695 */
1696 class CanvasSpriteRenderer {
1697 constructor(renderer: PIXI.Renderer);
1698 /**
1699 * Renders the sprite object.
1700 *
1701 * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch
1702 */
1703 render(sprite: PIXI.Sprite): void;
1704 /**
1705 * destroy the sprite object.
1706 *
1707 */
1708 destroy(): void;
1709 }
1710 /**
1711 * Different types of environments for WebGL.
1712 *
1713 * @static
1714 * @memberof PIXI
1715 * @name ENV
1716 * @enum {number}
1717 * @property {number} WEBGL_LEGACY - Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility
1718 * with older / less advanced devices. If you experience unexplained flickering prefer this environment.
1719 * @property {number} WEBGL - Version 1 of WebGL
1720 * @property {number} WEBGL2 - Version 2 of WebGL
1721 */
1722 enum ENV {
1723 WEBGL_LEGACY,
1724 WEBGL,
1725 WEBGL2
1726 }
1727 /**
1728 * Constant to identify the Renderer Type.
1729 *
1730 * @static
1731 * @memberof PIXI
1732 * @name RENDERER_TYPE
1733 * @enum {number}
1734 * @property {number} UNKNOWN - Unknown render type.
1735 * @property {number} WEBGL - WebGL render type.
1736 * @property {number} CANVAS - Canvas render type.
1737 */
1738 enum RENDERER_TYPE {
1739 UNKNOWN,
1740 WEBGL,
1741 CANVAS
1742 }
1743 /**
1744 * Bitwise OR of masks that indicate the buffers to be cleared.
1745 *
1746 * @static
1747 * @memberof PIXI
1748 * @name BUFFER_BITS
1749 * @enum {number}
1750 * @property {number} COLOR - Indicates the buffers currently enabled for color writing.
1751 * @property {number} DEPTH - Indicates the depth buffer.
1752 * @property {number} STENCIL - Indicates the stencil buffer.
1753 */
1754 enum BUFFER_BITS {
1755 COLOR,
1756 DEPTH,
1757 STENCIL
1758 }
1759 /**
1760 * Various blend modes supported by PIXI.
1761 *
1762 * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.
1763 * Anything else will silently act like NORMAL.
1764 *
1765 * @memberof PIXI
1766 * @name BLEND_MODES
1767 * @enum {number}
1768 * @property {number} NORMAL
1769 * @property {number} ADD
1770 * @property {number} MULTIPLY
1771 * @property {number} SCREEN
1772 * @property {number} OVERLAY
1773 * @property {number} DARKEN
1774 * @property {number} LIGHTEN
1775 * @property {number} COLOR_DODGE
1776 * @property {number} COLOR_BURN
1777 * @property {number} HARD_LIGHT
1778 * @property {number} SOFT_LIGHT
1779 * @property {number} DIFFERENCE
1780 * @property {number} EXCLUSION
1781 * @property {number} HUE
1782 * @property {number} SATURATION
1783 * @property {number} COLOR
1784 * @property {number} LUMINOSITY
1785 * @property {number} NORMAL_NPM
1786 * @property {number} ADD_NPM
1787 * @property {number} SCREEN_NPM
1788 * @property {number} NONE
1789 * @property {number} SRC_IN
1790 * @property {number} SRC_OUT
1791 * @property {number} SRC_ATOP
1792 * @property {number} DST_OVER
1793 * @property {number} DST_IN
1794 * @property {number} DST_OUT
1795 * @property {number} DST_ATOP
1796 * @property {number} SUBTRACT
1797 * @property {number} SRC_OVER
1798 * @property {number} ERASE
1799 * @property {number} XOR
1800 */
1801 enum BLEND_MODES {
1802 NORMAL,
1803 ADD,
1804 MULTIPLY,
1805 SCREEN,
1806 OVERLAY,
1807 DARKEN,
1808 LIGHTEN,
1809 COLOR_DODGE,
1810 COLOR_BURN,
1811 HARD_LIGHT,
1812 SOFT_LIGHT,
1813 DIFFERENCE,
1814 EXCLUSION,
1815 HUE,
1816 SATURATION,
1817 COLOR,
1818 LUMINOSITY,
1819 NORMAL_NPM,
1820 ADD_NPM,
1821 SCREEN_NPM,
1822 NONE,
1823 SRC_IN,
1824 SRC_OUT,
1825 SRC_ATOP,
1826 DST_OVER,
1827 DST_IN,
1828 DST_OUT,
1829 DST_ATOP,
1830 SUBTRACT,
1831 SRC_OVER,
1832 ERASE,
1833 XOR
1834 }
1835 /**
1836 * Various webgl draw modes. These can be used to specify which GL drawMode to use
1837 * under certain situations and renderers.
1838 *
1839 * @memberof PIXI
1840 * @static
1841 * @name DRAW_MODES
1842 * @enum {number}
1843 * @property {number} POINTS
1844 * @property {number} LINES
1845 * @property {number} LINE_LOOP
1846 * @property {number} LINE_STRIP
1847 * @property {number} TRIANGLES
1848 * @property {number} TRIANGLE_STRIP
1849 * @property {number} TRIANGLE_FAN
1850 */
1851 enum DRAW_MODES {
1852 POINTS,
1853 LINES,
1854 LINE_LOOP,
1855 LINE_STRIP,
1856 TRIANGLES,
1857 TRIANGLE_STRIP,
1858 TRIANGLE_FAN
1859 }
1860 /**
1861 * Various GL texture/resources formats.
1862 *
1863 * @memberof PIXI
1864 * @static
1865 * @name FORMATS
1866 * @enum {number}
1867 * @property {number} RGBA=6408
1868 * @property {number} RGB=6407
1869 * @property {number} ALPHA=6406
1870 * @property {number} LUMINANCE=6409
1871 * @property {number} LUMINANCE_ALPHA=6410
1872 * @property {number} DEPTH_COMPONENT=6402
1873 * @property {number} DEPTH_STENCIL=34041
1874 */
1875 enum FORMATS {
1876 RGBA,
1877 RGB,
1878 ALPHA,
1879 LUMINANCE,
1880 LUMINANCE_ALPHA,
1881 DEPTH_COMPONENT,
1882 DEPTH_STENCIL
1883 }
1884 /**
1885 * Various GL target types.
1886 *
1887 * @memberof PIXI
1888 * @static
1889 * @name TARGETS
1890 * @enum {number}
1891 * @property {number} TEXTURE_2D=3553
1892 * @property {number} TEXTURE_CUBE_MAP=34067
1893 * @property {number} TEXTURE_2D_ARRAY=35866
1894 * @property {number} TEXTURE_CUBE_MAP_POSITIVE_X=34069
1895 * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_X=34070
1896 * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Y=34071
1897 * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Y=34072
1898 * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Z=34073
1899 * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Z=34074
1900 */
1901 enum TARGETS {
1902 TEXTURE_2D,
1903 TEXTURE_CUBE_MAP,
1904 TEXTURE_2D_ARRAY,
1905 TEXTURE_CUBE_MAP_POSITIVE_X,
1906 TEXTURE_CUBE_MAP_NEGATIVE_X,
1907 TEXTURE_CUBE_MAP_POSITIVE_Y,
1908 TEXTURE_CUBE_MAP_NEGATIVE_Y,
1909 TEXTURE_CUBE_MAP_POSITIVE_Z,
1910 TEXTURE_CUBE_MAP_NEGATIVE_Z
1911 }
1912 /**
1913 * Various GL data format types.
1914 *
1915 * @memberof PIXI
1916 * @static
1917 * @name TYPES
1918 * @enum {number}
1919 * @property {number} UNSIGNED_BYTE=5121
1920 * @property {number} UNSIGNED_SHORT=5123
1921 * @property {number} UNSIGNED_SHORT_5_6_5=33635
1922 * @property {number} UNSIGNED_SHORT_4_4_4_4=32819
1923 * @property {number} UNSIGNED_SHORT_5_5_5_1=32820
1924 * @property {number} FLOAT=5126
1925 * @property {number} HALF_FLOAT=36193
1926 */
1927 enum TYPES {
1928 UNSIGNED_BYTE,
1929 UNSIGNED_SHORT,
1930 UNSIGNED_SHORT_5_6_5,
1931 UNSIGNED_SHORT_4_4_4_4,
1932 UNSIGNED_SHORT_5_5_5_1,
1933 FLOAT,
1934 HALF_FLOAT
1935 }
1936 /**
1937 * The scale modes that are supported by pixi.
1938 *
1939 * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.
1940 * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.
1941 *
1942 * @memberof PIXI
1943 * @static
1944 * @name SCALE_MODES
1945 * @enum {number}
1946 * @property {number} LINEAR Smooth scaling
1947 * @property {number} NEAREST Pixelating scaling
1948 */
1949 enum SCALE_MODES {
1950 LINEAR,
1951 NEAREST
1952 }
1953 /**
1954 * The wrap modes that are supported by pixi.
1955 *
1956 * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wrapping mode of future operations.
1957 * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.
1958 * If the texture is non power of two then clamp will be used regardless as WebGL can
1959 * only use REPEAT if the texture is po2.
1960 *
1961 * This property only affects WebGL.
1962 *
1963 * @name WRAP_MODES
1964 * @memberof PIXI
1965 * @static
1966 * @enum {number}
1967 * @property {number} CLAMP - The textures uvs are clamped
1968 * @property {number} REPEAT - The texture uvs tile and repeat
1969 * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring
1970 */
1971 enum WRAP_MODES {
1972 CLAMP,
1973 REPEAT,
1974 MIRRORED_REPEAT
1975 }
1976 /**
1977 * Mipmap filtering modes that are supported by pixi.
1978 *
1979 * The {@link PIXI.settings.MIPMAP_TEXTURES} affects default texture filtering.
1980 * Mipmaps are generated for a baseTexture if its `mipmap` field is `ON`,
1981 * or its `POW2` and texture dimensions are powers of 2.
1982 * Due to platform restriction, `ON` option will work like `POW2` for webgl-1.
1983 *
1984 * This property only affects WebGL.
1985 *
1986 * @name MIPMAP_MODES
1987 * @memberof PIXI
1988 * @static
1989 * @enum {number}
1990 * @property {number} OFF - No mipmaps
1991 * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2
1992 * @property {number} ON - Always generate mipmaps
1993 */
1994 enum MIPMAP_MODES {
1995 OFF,
1996 POW2,
1997 ON
1998 }
1999 /**
2000 * How to treat textures with premultiplied alpha
2001 *
2002 * @name ALPHA_MODES
2003 * @memberof PIXI
2004 * @static
2005 * @enum {number}
2006 * @property {number} NO_PREMULTIPLIED_ALPHA - Source is not premultiplied, leave it like that.
2007 * Option for compressed and data textures that are created from typed arrays.
2008 * @property {number} PREMULTIPLY_ON_UPLOAD - Source is not premultiplied, premultiply on upload.
2009 * Default option, used for all loaded images.
2010 * @property {number} PREMULTIPLIED_ALPHA - Source is already premultiplied
2011 * Example: spine atlases with `_pma` suffix.
2012 * @property {number} NPM - Alias for NO_PREMULTIPLIED_ALPHA.
2013 * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD.
2014 * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA.
2015 */
2016 enum ALPHA_MODES {
2017 NO_PREMULTIPLIED_ALPHA,
2018 PREMULTIPLY_ON_UPLOAD,
2019 PREMULTIPLIED_ALPHA,
2020 NPM,
2021 UNPACK,
2022 PMA
2023 }
2024 /**
2025 * How to clear renderTextures in filter
2026 *
2027 * @name CLEAR_MODES
2028 * @memberof PIXI
2029 * @static
2030 * @enum {number}
2031 * @property {number} BLEND - Preserve the information in the texture, blend above
2032 * @property {number} CLEAR - Must use `gl.clear` operation
2033 * @property {number} BLIT - Clear or blit it, depends on device and level of paranoia
2034 * @property {number} NO - Alias for BLEND, same as `false` in earlier versions
2035 * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions
2036 * @property {number} AUTO - Alias for BLIT
2037 */
2038 enum CLEAR_MODES {
2039 BLEND,
2040 CLEAR,
2041 BLIT,
2042 NO,
2043 YES,
2044 AUTO
2045 }
2046 /**
2047 * The gc modes that are supported by pixi.
2048 *
2049 * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO
2050 * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not
2051 * used for a specified period of time they will be removed from the GPU. They will of course
2052 * be uploaded again when they are required. This is a silent behind the scenes process that
2053 * should ensure that the GPU does not get filled up.
2054 *
2055 * Handy for mobile devices!
2056 * This property only affects WebGL.
2057 *
2058 * @name GC_MODES
2059 * @enum {number}
2060 * @static
2061 * @memberof PIXI
2062 * @property {number} AUTO - Garbage collection will happen periodically automatically
2063 * @property {number} MANUAL - Garbage collection will need to be called manually
2064 */
2065 enum GC_MODES {
2066 AUTO,
2067 MANUAL
2068 }
2069 /**
2070 * Constants that specify float precision in shaders.
2071 *
2072 * @name PRECISION
2073 * @memberof PIXI
2074 * @constant
2075 * @static
2076 * @enum {string}
2077 * @property {string} LOW='lowp'
2078 * @property {string} MEDIUM='mediump'
2079 * @property {string} HIGH='highp'
2080 */
2081 enum PRECISION {
2082 LOW,
2083 MEDIUM,
2084 HIGH
2085 }
2086 /**
2087 * Constants for mask implementations.
2088 * We use `type` suffix because it leads to very different behaviours
2089 *
2090 * @name MASK_TYPES
2091 * @memberof PIXI
2092 * @static
2093 * @enum {number}
2094 * @property {number} NONE - Mask is ignored
2095 * @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap
2096 * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil
2097 * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture
2098 */
2099 enum MASK_TYPES {
2100 NONE,
2101 SCISSOR,
2102 STENCIL,
2103 SPRITE
2104 }
2105 /**
2106 * Constants for multi-sampling antialiasing.
2107 *
2108 * @see PIXI.Framebuffer#multisample
2109 *
2110 * @name MSAA_QUALITY
2111 * @memberof PIXI
2112 * @static
2113 * @enum {number}
2114 * @property {number} NONE - No multisampling for this renderTexture
2115 * @property {number} LOW - Try 2 samples
2116 * @property {number} MEDIUM - Try 4 samples
2117 * @property {number} HIGH - Try 8 samples
2118 */
2119 enum MSAA_QUALITY {
2120 NONE,
2121 LOW,
2122 MEDIUM,
2123 HIGH
2124 }
2125 /**
2126 * The AbstractRenderer is the base for a PixiJS Renderer. It is extended by the {@link PIXI.CanvasRenderer}
2127 * and {@link PIXI.Renderer} which can be used for rendering a PixiJS scene.
2128 *
2129 * @abstract
2130 * @class
2131 * @extends PIXI.utils.EventEmitter
2132 * @memberof PIXI
2133 */
2134 class AbstractRenderer extends PIXI.utils.EventEmitter {
2135 constructor(system: string, options?: {
2136 width?: number;
2137 height?: number;
2138 view?: HTMLCanvasElement;
2139 transparent?: boolean;
2140 autoDensity?: boolean;
2141 antialias?: boolean;
2142 resolution?: number;
2143 preserveDrawingBuffer?: boolean;
2144 clearBeforeRender?: boolean;
2145 backgroundColor?: number;
2146 });
2147 /**
2148 * The supplied constructor options.
2149 *
2150 * @member {Object} PIXI.AbstractRenderer#options
2151 * @readOnly
2152 */
2153 readonly options: any;
2154 /**
2155 * The type of the renderer.
2156 *
2157 * @member {number} PIXI.AbstractRenderer#type
2158 * @default PIXI.RENDERER_TYPE.UNKNOWN
2159 * @see PIXI.RENDERER_TYPE
2160 */
2161 type: number;
2162 /**
2163 * Measurements of the screen. (0, 0, screenWidth, screenHeight).
2164 *
2165 * Its safe to use as filterArea or hitArea for the whole stage.
2166 *
2167 * @member {PIXI.Rectangle} PIXI.AbstractRenderer#screen
2168 */
2169 screen: PIXI.Rectangle;
2170 /**
2171 * The canvas element that everything is drawn to.
2172 *
2173 * @member {HTMLCanvasElement} PIXI.AbstractRenderer#view
2174 */
2175 view: HTMLCanvasElement;
2176 /**
2177 * The resolution / device pixel ratio of the renderer.
2178 *
2179 * @member {number} PIXI.AbstractRenderer#resolution
2180 * @default 1
2181 */
2182 resolution: number;
2183 /**
2184 * Whether the render view is transparent.
2185 *
2186 * @member {boolean} PIXI.AbstractRenderer#transparent
2187 */
2188 transparent: boolean;
2189 /**
2190 * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
2191 *
2192 * @member {boolean} PIXI.AbstractRenderer#autoDensity
2193 */
2194 autoDensity: boolean;
2195 /**
2196 * The value of the preserveDrawingBuffer flag affects whether or not the contents of
2197 * the stencil buffer is retained after rendering.
2198 *
2199 * @member {boolean} PIXI.AbstractRenderer#preserveDrawingBuffer
2200 */
2201 preserveDrawingBuffer: boolean;
2202 /**
2203 * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
2204 * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every
2205 * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect
2206 * to clear the canvas every frame. Disable this by setting this to false. For example, if
2207 * your game has a canvas filling background image you often don't need this set.
2208 *
2209 * @member {boolean} PIXI.AbstractRenderer#clearBeforeRender
2210 * @default
2211 */
2212 clearBeforeRender: boolean;
2213 /**
2214 * The background color as a number.
2215 *
2216 * @member {number} PIXI.AbstractRenderer#_backgroundColor
2217 * @protected
2218 */
2219 protected _backgroundColor: number;
2220 /**
2221 * The background color as an [R, G, B] array.
2222 *
2223 * @member {number[]} PIXI.AbstractRenderer#_backgroundColorRgba
2224 * @protected
2225 */
2226 protected _backgroundColorRgba: number[];
2227 /**
2228 * The background color as a string.
2229 *
2230 * @member {string} PIXI.AbstractRenderer#_backgroundColorString
2231 * @protected
2232 */
2233 protected _backgroundColorString: string;
2234 /**
2235 * The last root object that the renderer tried to render.
2236 *
2237 * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_lastObjectRendered
2238 * @protected
2239 */
2240 protected _lastObjectRendered: PIXI.DisplayObject;
2241 /**
2242 * Collection of plugins.
2243 * @readonly
2244 * @member {object} PIXI.AbstractRenderer#plugins
2245 */
2246 readonly plugins: any;
2247 /**
2248 * Initialize the plugins.
2249 *
2250 * @protected
2251 * @param {object} staticMap - The dictionary of statically saved plugins.
2252 */
2253 protected initPlugins(staticMap: any): void;
2254 /**
2255 * Same as view.width, actual number of pixels in the canvas by horizontal.
2256 *
2257 * @member {number}
2258 * @readonly
2259 * @default 800
2260 */
2261 readonly width: number;
2262 /**
2263 * Same as view.height, actual number of pixels in the canvas by vertical.
2264 *
2265 * @member {number}
2266 * @readonly
2267 * @default 600
2268 */
2269 readonly height: number;
2270 /**
2271 * Resizes the screen and canvas to the specified width and height.
2272 * Canvas dimensions are multiplied by resolution.
2273 *
2274 * @param {number} screenWidth - The new width of the screen.
2275 * @param {number} screenHeight - The new height of the screen.
2276 */
2277 resize(screenWidth: number, screenHeight: number): void;
2278 /**
2279 * Useful function that returns a texture of the display object that can then be used to create sprites
2280 * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.
2281 *
2282 * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from.
2283 * @param {PIXI.SCALE_MODES} scaleMode - The scale mode of the texture.
2284 * @param {number} resolution - The resolution / device pixel ratio of the texture being generated.
2285 * @param {PIXI.Rectangle} [region] - The region of the displayObject, that shall be rendered,
2286 * if no region is specified, defaults to the local bounds of the displayObject.
2287 * @return {PIXI.RenderTexture} A texture of the graphics object.
2288 */
2289 generateTexture(displayObject: PIXI.DisplayObject, scaleMode: PIXI.SCALE_MODES, resolution: number, region?: PIXI.Rectangle): PIXI.RenderTexture;
2290 /**
2291 * Removes everything from the renderer and optionally removes the Canvas DOM element.
2292 *
2293 * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.
2294 */
2295 destroy(removeView?: boolean): void;
2296 /**
2297 * The background color to fill if not transparent
2298 *
2299 * @member {number}
2300 */
2301 backgroundColor: number;
2302 }
2303 /**
2304 * The Renderer draws the scene and all its content onto a WebGL enabled canvas.
2305 *
2306 * This renderer should be used for browsers that support WebGL.
2307 *
2308 * This renderer works by automatically managing WebGLBatchesm, so no need for Sprite Batches or Sprite Clouds.
2309 * Don't forget to add the view to your DOM or you will not see anything!
2310 *
2311 * @class
2312 * @memberof PIXI
2313 * @extends PIXI.AbstractRenderer
2314 */
2315 class Renderer extends PIXI.AbstractRenderer {
2316 constructor(options?: {
2317 width?: number;
2318 height?: number;
2319 view?: HTMLCanvasElement;
2320 transparent?: boolean;
2321 autoDensity?: boolean;
2322 antialias?: boolean;
2323 resolution?: number;
2324 clearBeforeRender?: boolean;
2325 preserveDrawingBuffer?: boolean;
2326 backgroundColor?: number;
2327 powerPreference?: string;
2328 context?: any;
2329 });
2330 /**
2331 * WebGL context, set by the contextSystem (this.context)
2332 *
2333 * @readonly
2334 * @member {WebGLRenderingContext} PIXI.Renderer#gl
2335 */
2336 readonly gl: WebGLRenderingContext;
2337 /**
2338 * Global uniforms
2339 * @member {PIXI.UniformGroup} PIXI.Renderer#globalUniforms
2340 */
2341 globalUniforms: PIXI.UniformGroup;
2342 /**
2343 * Mask system instance
2344 * @member {PIXI.systems.MaskSystem} mask
2345 * @memberof PIXI.Renderer#
2346 * @readonly
2347 */
2348 readonly mask: PIXI.systems.MaskSystem;
2349 /**
2350 * Context system instance
2351 * @member {PIXI.systems.ContextSystem} context
2352 * @memberof PIXI.Renderer#
2353 * @readonly
2354 */
2355 readonly context: PIXI.systems.ContextSystem;
2356 /**
2357 * State system instance
2358 * @member {PIXI.systems.StateSystem} state
2359 * @memberof PIXI.Renderer#
2360 * @readonly
2361 */
2362 readonly state: PIXI.systems.StateSystem;
2363 /**
2364 * Shader system instance
2365 * @member {PIXI.systems.ShaderSystem} shader
2366 * @memberof PIXI.Renderer#
2367 * @readonly
2368 */
2369 readonly shader: PIXI.systems.ShaderSystem;
2370 /**
2371 * Texture system instance
2372 * @member {PIXI.systems.TextureSystem} texture
2373 * @memberof PIXI.Renderer#
2374 * @readonly
2375 */
2376 readonly texture: PIXI.systems.TextureSystem;
2377 /**
2378 * Geometry system instance
2379 * @member {PIXI.systems.GeometrySystem} geometry
2380 * @memberof PIXI.Renderer#
2381 * @readonly
2382 */
2383 readonly geometry: PIXI.systems.GeometrySystem;
2384 /**
2385 * Framebuffer system instance
2386 * @member {PIXI.systems.FramebufferSystem} framebuffer
2387 * @memberof PIXI.Renderer#
2388 * @readonly
2389 */
2390 readonly framebuffer: PIXI.systems.FramebufferSystem;
2391 /**
2392 * Scissor system instance
2393 * @member {PIXI.systems.ScissorSystem} scissor
2394 * @memberof PIXI.Renderer#
2395 * @readonly
2396 */
2397 readonly scissor: PIXI.systems.ScissorSystem;
2398 /**
2399 * Stencil system instance
2400 * @member {PIXI.systems.StencilSystem} stencil
2401 * @memberof PIXI.Renderer#
2402 * @readonly
2403 */
2404 readonly stencil: PIXI.systems.StencilSystem;
2405 /**
2406 * Projection system instance
2407 * @member {PIXI.systems.ProjectionSystem} projection
2408 * @memberof PIXI.Renderer#
2409 * @readonly
2410 */
2411 readonly projection: PIXI.systems.ProjectionSystem;
2412 /**
2413 * Texture garbage collector system instance
2414 * @member {PIXI.systems.TextureGCSystem} textureGC
2415 * @memberof PIXI.Renderer#
2416 * @readonly
2417 */
2418 readonly textureGC: PIXI.systems.TextureGCSystem;
2419 /**
2420 * Filter system instance
2421 * @member {PIXI.systems.FilterSystem} filter
2422 * @memberof PIXI.Renderer#
2423 * @readonly
2424 */
2425 readonly filter: PIXI.systems.FilterSystem;
2426 /**
2427 * RenderTexture system instance
2428 * @member {PIXI.systems.RenderTextureSystem} renderTexture
2429 * @memberof PIXI.Renderer#
2430 * @readonly
2431 */
2432 readonly renderTexture: PIXI.systems.RenderTextureSystem;
2433 /**
2434 * Batch system instance
2435 * @member {PIXI.systems.BatchSystem} batch
2436 * @memberof PIXI.Renderer#
2437 * @readonly
2438 */
2439 readonly batch: PIXI.systems.BatchSystem;
2440 /**
2441 * Flag if we are rendering to the screen vs renderTexture
2442 * @member {boolean} PIXI.Renderer#renderingToScreen
2443 * @readonly
2444 * @default true
2445 */
2446 readonly renderingToScreen: boolean;
2447 /**
2448 * Add a new system to the renderer.
2449 * @param {Function} ClassRef - Class reference
2450 * @param {string} [name] - Property name for system, if not specified
2451 * will use a static `name` property on the class itself. This
2452 * name will be assigned as s property on the Renderer so make
2453 * sure it doesn't collide with properties on Renderer.
2454 * @return {PIXI.Renderer} Return instance of renderer
2455 */
2456 addSystem(ClassRef: (...params: any[]) => any, name?: string): PIXI.Renderer;
2457 /**
2458 * Renders the object to its WebGL view
2459 *
2460 * @param {PIXI.DisplayObject} displayObject - The object to be rendered.
2461 * @param {PIXI.RenderTexture} [renderTexture] - The render texture to render to.
2462 * @param {boolean} [clear=true] - Should the canvas be cleared before the new render.
2463 * @param {PIXI.Matrix} [transform] - A transform to apply to the render texture before rendering.
2464 * @param {boolean} [skipUpdateTransform=false] - Should we skip the update transform pass?
2465 */
2466 render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Matrix, skipUpdateTransform?: boolean): void;
2467 /**
2468 * Resizes the WebGL view to the specified width and height.
2469 *
2470 * @param {number} screenWidth - The new width of the screen.
2471 * @param {number} screenHeight - The new height of the screen.
2472 */
2473 resize(screenWidth: number, screenHeight: number): void;
2474 /**
2475 * Resets the WebGL state so you can render things however you fancy!
2476 *
2477 * @return {PIXI.Renderer} Returns itself.
2478 */
2479 reset(): PIXI.Renderer;
2480 /**
2481 * Clear the frame buffer
2482 */
2483 clear(): void;
2484 /**
2485 * Removes everything from the renderer (event listeners, spritebatch, etc...)
2486 *
2487 * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.
2488 * See: https://github.com/pixijs/pixi.js/issues/2233
2489 */
2490 destroy(removeView?: boolean): void;
2491 /**
2492 * Adds a plugin to the renderer.
2493 *
2494 * @method
2495 * @param {string} pluginName - The name of the plugin.
2496 * @param {Function} ctor - The constructor function or class for the plugin.
2497 */
2498 static registerPlugin(pluginName: string, ctor: (...params: any[]) => any): void;
2499 /**
2500 * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture
2501 *
2502 * @member {PIXI.Extract} extract
2503 * @memberof PIXI.Renderer#
2504 * @see PIXI.Extract
2505 */
2506 extract: PIXI.Extract;
2507 /**
2508 * The supplied constructor options.
2509 *
2510 * @member {Object} PIXI.AbstractRenderer#options
2511 * @readOnly
2512 */
2513 readonly options: any;
2514 /**
2515 * The type of the renderer.
2516 *
2517 * @member {number} PIXI.AbstractRenderer#type
2518 * @default PIXI.RENDERER_TYPE.UNKNOWN
2519 * @see PIXI.RENDERER_TYPE
2520 */
2521 type: number;
2522 /**
2523 * Measurements of the screen. (0, 0, screenWidth, screenHeight).
2524 *
2525 * Its safe to use as filterArea or hitArea for the whole stage.
2526 *
2527 * @member {PIXI.Rectangle} PIXI.AbstractRenderer#screen
2528 */
2529 screen: PIXI.Rectangle;
2530 /**
2531 * The canvas element that everything is drawn to.
2532 *
2533 * @member {HTMLCanvasElement} PIXI.AbstractRenderer#view
2534 */
2535 view: HTMLCanvasElement;
2536 /**
2537 * The resolution / device pixel ratio of the renderer.
2538 *
2539 * @member {number} PIXI.AbstractRenderer#resolution
2540 * @default 1
2541 */
2542 resolution: number;
2543 /**
2544 * Whether the render view is transparent.
2545 *
2546 * @member {boolean} PIXI.AbstractRenderer#transparent
2547 */
2548 transparent: boolean;
2549 /**
2550 * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
2551 *
2552 * @member {boolean} PIXI.AbstractRenderer#autoDensity
2553 */
2554 autoDensity: boolean;
2555 /**
2556 * The value of the preserveDrawingBuffer flag affects whether or not the contents of
2557 * the stencil buffer is retained after rendering.
2558 *
2559 * @member {boolean} PIXI.AbstractRenderer#preserveDrawingBuffer
2560 */
2561 preserveDrawingBuffer: boolean;
2562 /**
2563 * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
2564 * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every
2565 * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect
2566 * to clear the canvas every frame. Disable this by setting this to false. For example, if
2567 * your game has a canvas filling background image you often don't need this set.
2568 *
2569 * @member {boolean} PIXI.AbstractRenderer#clearBeforeRender
2570 * @default
2571 */
2572 clearBeforeRender: boolean;
2573 /**
2574 * The background color as a number.
2575 *
2576 * @member {number} PIXI.AbstractRenderer#_backgroundColor
2577 * @protected
2578 */
2579 protected _backgroundColor: number;
2580 /**
2581 * The background color as an [R, G, B] array.
2582 *
2583 * @member {number[]} PIXI.AbstractRenderer#_backgroundColorRgba
2584 * @protected
2585 */
2586 protected _backgroundColorRgba: number[];
2587 /**
2588 * The background color as a string.
2589 *
2590 * @member {string} PIXI.AbstractRenderer#_backgroundColorString
2591 * @protected
2592 */
2593 protected _backgroundColorString: string;
2594 /**
2595 * The last root object that the renderer tried to render.
2596 *
2597 * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_lastObjectRendered
2598 * @protected
2599 */
2600 protected _lastObjectRendered: PIXI.DisplayObject;
2601 /**
2602 * Collection of plugins.
2603 * @readonly
2604 * @member {object} PIXI.AbstractRenderer#plugins
2605 */
2606 readonly plugins: any;
2607 /**
2608 * Initialize the plugins.
2609 *
2610 * @protected
2611 * @param {object} staticMap - The dictionary of statically saved plugins.
2612 */
2613 protected initPlugins(staticMap: any): void;
2614 /**
2615 * Same as view.width, actual number of pixels in the canvas by horizontal.
2616 *
2617 * @member {number}
2618 * @readonly
2619 * @default 800
2620 */
2621 readonly width: number;
2622 /**
2623 * Same as view.height, actual number of pixels in the canvas by vertical.
2624 *
2625 * @member {number}
2626 * @readonly
2627 * @default 600
2628 */
2629 readonly height: number;
2630 /**
2631 * Useful function that returns a texture of the display object that can then be used to create sprites
2632 * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.
2633 *
2634 * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from.
2635 * @param {PIXI.SCALE_MODES} scaleMode - The scale mode of the texture.
2636 * @param {number} resolution - The resolution / device pixel ratio of the texture being generated.
2637 * @param {PIXI.Rectangle} [region] - The region of the displayObject, that shall be rendered,
2638 * if no region is specified, defaults to the local bounds of the displayObject.
2639 * @return {PIXI.RenderTexture} A texture of the graphics object.
2640 */
2641 generateTexture(displayObject: PIXI.DisplayObject, scaleMode: PIXI.SCALE_MODES, resolution: number, region?: PIXI.Rectangle): PIXI.RenderTexture;
2642 /**
2643 * The background color to fill if not transparent
2644 *
2645 * @member {number}
2646 */
2647 backgroundColor: number;
2648 }
2649 /**
2650 * System is a base class used for extending systems used by the {@link PIXI.Renderer}
2651 *
2652 * @see PIXI.Renderer#addSystem
2653 * @class
2654 * @memberof PIXI
2655 */
2656 class System {
2657 constructor(renderer: PIXI.Renderer);
2658 /**
2659 * The renderer this manager works for.
2660 *
2661 * @member {PIXI.Renderer} PIXI.System#renderer
2662 */
2663 renderer: PIXI.Renderer;
2664 /**
2665 * Generic destroy methods to be overridden by the subclass
2666 */
2667 destroy(): void;
2668 }
2669 /**
2670 * This helper function will automatically detect which renderer you should be using.
2671 * WebGL is the preferred renderer as it is a lot faster. If WebGL is not supported by
2672 * the browser then this function will return a canvas renderer
2673 *
2674 * @memberof PIXI
2675 * @function autoDetectRenderer
2676 * @param {object} [options] - The optional renderer parameters
2677 * @param {number} [options.width=800] - the width of the renderers view
2678 * @param {number} [options.height=600] - the height of the renderers view
2679 * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional
2680 * @param {boolean} [options.transparent=false] - If the render view is transparent, default false
2681 * @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for
2682 * resolutions other than 1
2683 * @param {boolean} [options.antialias=false] - sets antialias
2684 * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you
2685 * need to call toDataUrl on the webgl context
2686 * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area
2687 * (shown if not transparent).
2688 * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or
2689 * not before the new render pass.
2690 * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2
2691 * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present, this
2692 * option only is available when using **pixi.js-legacy** or **@pixi/canvas-renderer** modules, otherwise
2693 * it is ignored.
2694 * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance"
2695 * for devices with dual graphics card **webgl only**
2696 * @return {PIXI.Renderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer
2697 */
2698 function autoDetectRenderer(options?: {
2699 width?: number;
2700 height?: number;
2701 view?: HTMLCanvasElement;
2702 transparent?: boolean;
2703 autoDensity?: boolean;
2704 antialias?: boolean;
2705 preserveDrawingBuffer?: boolean;
2706 backgroundColor?: number;
2707 clearBeforeRender?: boolean;
2708 resolution?: number;
2709 forceCanvas?: boolean;
2710 powerPreference?: string;
2711 }): PIXI.Renderer | PIXI.CanvasRenderer;
2712 /**
2713 * Renderer dedicated to drawing and batching sprites.
2714 *
2715 * This is the default batch renderer. It buffers objects
2716 * with texture-based geometries and renders them in
2717 * batches. It uploads multiple textures to the GPU to
2718 * reduce to the number of draw calls.
2719 *
2720 * @class
2721 * @protected
2722 * @memberof PIXI
2723 * @extends PIXI.ObjectRenderer
2724 */
2725 class AbstractBatchRenderer extends PIXI.ObjectRenderer {
2726 constructor(renderer: PIXI.Renderer);
2727 /**
2728 * This is used to generate a shader that can
2729 * color each vertex based on a `aTextureId`
2730 * attribute that points to an texture in `uSampler`.
2731 *
2732 * This enables the objects with different textures
2733 * to be drawn in the same draw call.
2734 *
2735 * You can customize your shader by creating your
2736 * custom shader generator.
2737 *
2738 * @member {PIXI.BatchShaderGenerator} PIXI.AbstractBatchRenderer#shaderGenerator
2739 * @protected
2740 */
2741 protected shaderGenerator: PIXI.BatchShaderGenerator;
2742 /**
2743 * The class that represents the geometry of objects
2744 * that are going to be batched with this.
2745 *
2746 * @member {object} PIXI.AbstractBatchRenderer#geometryClass
2747 * @default PIXI.BatchGeometry
2748 * @protected
2749 */
2750 protected geometryClass: any;
2751 /**
2752 * Size of data being buffered per vertex in the
2753 * attribute buffers (in floats). By default, the
2754 * batch-renderer plugin uses 6:
2755 *
2756 * | aVertexPosition | 2 |
2757 * |-----------------|---|
2758 * | aTextureCoords | 2 |
2759 * | aColor | 1 |
2760 * | aTextureId | 1 |
2761 *
2762 * @member {number} PIXI.AbstractBatchRenderer#vertexSize
2763 * @readonly
2764 */
2765 readonly vertexSize: number;
2766 /**
2767 * The WebGL state in which this renderer will work.
2768 *
2769 * @member {PIXI.State} PIXI.AbstractBatchRenderer#state
2770 * @readonly
2771 */
2772 readonly state: PIXI.State;
2773 /**
2774 * The number of bufferable objects before a flush
2775 * occurs automatically.
2776 *
2777 * @member {number} PIXI.AbstractBatchRenderer#size
2778 * @default settings.SPRITE_BATCH_SIZE * 4
2779 */
2780 size: number;
2781 /**
2782 * This shader is generated by `this.shaderGenerator`.
2783 *
2784 * It is generated specifically to handle the required
2785 * number of textures being batched together.
2786 *
2787 * @member {PIXI.Shader} PIXI.AbstractBatchRenderer#_shader
2788 * @protected
2789 */
2790 protected _shader: PIXI.Shader;
2791 /**
2792 * Maximum number of textures that can be uploaded to
2793 * the GPU under the current context. It is initialized
2794 * properly in `this.contextChange`.
2795 *
2796 * @member {number} PIXI.AbstractBatchRenderer#MAX_TEXTURES
2797 * @see PIXI.AbstractBatchRenderer#contextChange
2798 * @readonly
2799 */
2800 readonly MAX_TEXTURES: number;
2801 /**
2802 * Handles the `contextChange` signal.
2803 *
2804 * It calculates `this.MAX_TEXTURES` and allocating the
2805 * packed-geometry object pool.
2806 */
2807 contextChange(): void;
2808 /**
2809 * Makes sure that static and dynamic flush pooled objects have correct dimensions
2810 */
2811 initFlushBuffers(): void;
2812 /**
2813 * Handles the `prerender` signal.
2814 *
2815 * It ensures that flushes start from the first geometry
2816 * object again.
2817 */
2818 onPrerender(): void;
2819 /**
2820 * Buffers the "batchable" object. It need not be rendered
2821 * immediately.
2822 *
2823 * @param {PIXI.DisplayObject} element - the element to render when
2824 * using this renderer
2825 */
2826 render(element: PIXI.DisplayObject): void;
2827 /**
2828 * Populating drawcalls for rendering
2829 *
2830 * @param {PIXI.BatchTextureArray} texArray
2831 * @param {number} start
2832 * @param {number} finish
2833 */
2834 buildDrawCalls(texArray: PIXI.BatchTextureArray, start: number, finish: number): void;
2835 /**
2836 * Bind textures for current rendering
2837 *
2838 * @param {PIXI.BatchTextureArray} texArray
2839 */
2840 bindAndClearTexArray(texArray: PIXI.BatchTextureArray): void;
2841 /**
2842 * Renders the content _now_ and empties the current batch.
2843 */
2844 flush(): void;
2845 /**
2846 * Starts a new sprite batch.
2847 */
2848 start(): void;
2849 /**
2850 * Stops and flushes the current batch.
2851 */
2852 stop(): void;
2853 /**
2854 * Destroys this `AbstractBatchRenderer`. It cannot be used again.
2855 */
2856 destroy(): void;
2857 /**
2858 * Takes the four batching parameters of `element`, interleaves
2859 * and pushes them into the batching attribute/index buffers given.
2860 *
2861 * It uses these properties: `vertexData` `uvs`, `textureId` and
2862 * `indicies`. It also uses the "tint" of the base-texture, if
2863 * present.
2864 *
2865 * @param {PIXI.Sprite} element - element being rendered
2866 * @param {PIXI.ViewableBuffer} attributeBuffer - attribute buffer.
2867 * @param {Uint16Array} indexBuffer - index buffer
2868 * @param {number} aIndex - number of floats already in the attribute buffer
2869 * @param {number} iIndex - number of indices already in `indexBuffer`
2870 */
2871 packInterleavedGeometry(element: PIXI.Sprite, attributeBuffer: PIXI.ViewableBuffer, indexBuffer: Uint16Array, aIndex: number, iIndex: number): void;
2872 /**
2873 * Pool of `BatchDrawCall` objects that `flush` used
2874 * to create "batches" of the objects being rendered.
2875 *
2876 * These are never re-allocated again.
2877 * Shared between all batch renderers because it can be only one "flush" working at the moment.
2878 *
2879 * @static
2880 * @member {PIXI.BatchDrawCall[]}
2881 */
2882 static _drawCallPool: PIXI.BatchDrawCall[];
2883 /**
2884 * Pool of `BatchDrawCall` objects that `flush` used
2885 * to create "batches" of the objects being rendered.
2886 *
2887 * These are never re-allocated again.
2888 * Shared between all batch renderers because it can be only one "flush" working at the moment.
2889 *
2890 * @static
2891 * @member {PIXI.BatchTextureArray[]}
2892 */
2893 static _textureArrayPool: PIXI.BatchTextureArray[];
2894 /**
2895 * The renderer this manager works for.
2896 *
2897 * @member {PIXI.Renderer} PIXI.ObjectRenderer#renderer
2898 */
2899 renderer: PIXI.Renderer;
2900 }
2901 /**
2902 * Used by the batcher to draw batches.
2903 * Each one of these contains all information required to draw a bound geometry.
2904 *
2905 * @class
2906 * @memberof PIXI
2907 */
2908 class BatchDrawCall {
2909 constructor();
2910 /**
2911 * data for uniforms or custom webgl state
2912 * @member {object} PIXI.BatchDrawCall#data
2913 */
2914 data: any;
2915 }
2916 /**
2917 * Geometry used to batch standard PIXI content (e.g. Mesh, Sprite, Graphics objects).
2918 *
2919 * @class
2920 * @memberof PIXI
2921 */
2922 class BatchGeometry {
2923 constructor(_static?: boolean);
2924 /**
2925 * Buffer used for position, color, texture IDs
2926 *
2927 * @member {PIXI.Buffer} PIXI.BatchGeometry#_buffer
2928 * @protected
2929 */
2930 protected _buffer: PIXI.Buffer;
2931 /**
2932 * Index buffer data
2933 *
2934 * @member {PIXI.Buffer} PIXI.BatchGeometry#_indexBuffer
2935 * @protected
2936 */
2937 protected _indexBuffer: PIXI.Buffer;
2938 }
2939 /**
2940 * @class
2941 * @memberof PIXI
2942 * @hideconstructor
2943 */
2944 class BatchPluginFactory {
2945 /**
2946 * Create a new BatchRenderer plugin for Renderer. this convenience can provide an easy way
2947 * to extend BatchRenderer with all the necessary pieces.
2948 * @example
2949 * const fragment = `
2950 * varying vec2 vTextureCoord;
2951 * varying vec4 vColor;
2952 * varying float vTextureId;
2953 * uniform sampler2D uSamplers[%count%];
2954 *
2955 * void main(void){
2956 * vec4 color;
2957 * %forloop%
2958 * gl_FragColor = vColor * vec4(color.a - color.rgb, color.a);
2959 * }
2960 * `;
2961 * const InvertBatchRenderer = PIXI.BatchPluginFactory.create({ fragment });
2962 * PIXI.Renderer.registerPlugin('invert', InvertBatchRenderer);
2963 * const sprite = new PIXI.Sprite();
2964 * sprite.pluginName = 'invert';
2965 *
2966 * @static
2967 * @param {object} [options]
2968 * @param {string} [options.vertex=PIXI.BatchPluginFactory.defaultVertexSrc] - Vertex shader source
2969 * @param {string} [options.fragment=PIXI.BatchPluginFactory.defaultFragmentTemplate] - Fragment shader template
2970 * @param {number} [options.vertexSize=6] - Vertex size
2971 * @param {object} [options.geometryClass=PIXI.BatchGeometry]
2972 * @return {*} New batch renderer plugin
2973 */
2974 static create(options?: {
2975 vertex?: string;
2976 fragment?: string;
2977 vertexSize?: number;
2978 geometryClass?: any;
2979 }): any;
2980 /**
2981 * The default vertex shader source
2982 *
2983 * @static
2984 * @type {string}
2985 * @constant
2986 */
2987 static readonly defaultVertexSrc: string;
2988 /**
2989 * The default fragment shader source
2990 *
2991 * @static
2992 * @type {string}
2993 * @constant
2994 */
2995 static readonly defaultFragmentTemplate: string;
2996 }
2997 /**
2998 * Helper that generates batching multi-texture shader. Use it with your new BatchRenderer
2999 *
3000 * @class
3001 * @memberof PIXI
3002 */
3003 class BatchShaderGenerator {
3004 constructor(vertexSrc: string, fragTemplate: string);
3005 /**
3006 * Reference to the vertex shader source.
3007 *
3008 * @member {string} PIXI.BatchShaderGenerator#vertexSrc
3009 */
3010 vertexSrc: string;
3011 /**
3012 * Reference to the fragement shader template. Must contain "%count%" and "%forloop%".
3013 *
3014 * @member {string} PIXI.BatchShaderGenerator#fragTemplate
3015 */
3016 fragTemplate: string;
3017 }
3018 /**
3019 * Used by the batcher to build texture batches.
3020 * Holds list of textures and their respective locations.
3021 *
3022 * @class
3023 * @memberof PIXI
3024 */
3025 class BatchTextureArray {
3026 constructor();
3027 /**
3028 * inside textures array
3029 * @member {PIXI.BaseTexture[]} PIXI.BatchTextureArray#elements
3030 */
3031 elements: PIXI.BaseTexture[];
3032 /**
3033 * Respective locations for textures
3034 * @member {number[]} PIXI.BatchTextureArray#ids
3035 */
3036 ids: number[];
3037 /**
3038 * number of filled elements
3039 * @member {number} PIXI.BatchTextureArray#count
3040 */
3041 count: number;
3042 }
3043 /**
3044 * Base for a common object renderer that can be used as a
3045 * system renderer plugin.
3046 *
3047 * @class
3048 * @extends PIXI.System
3049 * @memberof PIXI
3050 */
3051 class ObjectRenderer extends PIXI.System {
3052 constructor(renderer: PIXI.Renderer);
3053 /**
3054 * The renderer this manager works for.
3055 *
3056 * @member {PIXI.Renderer} PIXI.ObjectRenderer#renderer
3057 */
3058 renderer: PIXI.Renderer;
3059 /**
3060 * Stub method that should be used to empty the current
3061 * batch by rendering objects now.
3062 */
3063 flush(): void;
3064 /**
3065 * Generic destruction method that frees all resources. This
3066 * should be called by subclasses.
3067 */
3068 destroy(): void;
3069 /**
3070 * Stub method that initializes any state required before
3071 * rendering starts. It is different from the `prerender`
3072 * signal, which occurs every frame, in that it is called
3073 * whenever an object requests _this_ renderer specifically.
3074 */
3075 start(): void;
3076 /**
3077 * Stops the renderer. It should free up any state and
3078 * become dormant.
3079 */
3080 stop(): void;
3081 /**
3082 * Keeps the object to render. It doesn't have to be
3083 * rendered immediately.
3084 *
3085 * @param {PIXI.DisplayObject} object - The object to render.
3086 */
3087 render(object: PIXI.DisplayObject): void;
3088 }
3089 /**
3090 * Filter is a special type of WebGL shader that is applied to the screen.
3091 *
3092 * {@link http://pixijs.io/examples/#/filters/blur-filter.js Example} of the
3093 * {@link PIXI.filters.BlurFilter BlurFilter}.
3094 *
3095 * ### Usage
3096 * Filters can be applied to any DisplayObject or Container.
3097 * PixiJS' `FilterSystem` renders the container into temporary Framebuffer,
3098 * then filter renders it to the screen.
3099 * Multiple filters can be added to the `filters` array property and stacked on each other.
3100 *
3101 * ```
3102 * const filter = new PIXI.Filter(myShaderVert, myShaderFrag, { myUniform: 0.5 });
3103 * const container = new PIXI.Container();
3104 * container.filters = [filter];
3105 * ```
3106 *
3107 * ### Previous Version Differences
3108 *
3109 * In PixiJS **v3**, a filter was always applied to _whole screen_.
3110 *
3111 * In PixiJS **v4**, a filter can be applied _only part of the screen_.
3112 * Developers had to create a set of uniforms to deal with coordinates.
3113 *
3114 * In PixiJS **v5** combines _both approaches_.
3115 * Developers can use normal coordinates of v3 and then allow filter to use partial Framebuffers,
3116 * bringing those extra uniforms into account.
3117 *
3118 * Also be aware that we have changed default vertex shader, please consult
3119 * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.
3120 *
3121 * ### Built-in Uniforms
3122 *
3123 * PixiJS viewport uses screen (CSS) coordinates, `(0, 0, renderer.screen.width, renderer.screen.height)`,
3124 * and `projectionMatrix` uniform maps it to the gl viewport.
3125 *
3126 * **uSampler**
3127 *
3128 * The most important uniform is the input texture that container was rendered into.
3129 * _Important note: as with all Framebuffers in PixiJS, both input and output are
3130 * premultiplied by alpha._
3131 *
3132 * By default, input normalized coordinates are passed to fragment shader with `vTextureCoord`.
3133 * Use it to sample the input.
3134 *
3135 * ```
3136 * const fragment = `
3137 * varying vec2 vTextureCoord;
3138 * uniform sampler2D uSampler;
3139 * void main(void)
3140 * {
3141 * gl_FragColor = texture2D(uSampler, vTextureCoord);
3142 * }
3143 * `;
3144 *
3145 * const myFilter = new PIXI.Filter(null, fragment);
3146 * ```
3147 *
3148 * This filter is just one uniform less than {@link PIXI.filters.AlphaFilter AlphaFilter}.
3149 *
3150 * **outputFrame**
3151 *
3152 * The `outputFrame` holds the rectangle where filter is applied in screen (CSS) coordinates.
3153 * It's the same as `renderer.screen` for a fullscreen filter.
3154 * Only a part of `outputFrame.zw` size of temporary Framebuffer is used,
3155 * `(0, 0, outputFrame.width, outputFrame.height)`,
3156 *
3157 * Filters uses this quad to normalized (0-1) space, its passed into `aVertexPosition` attribute.
3158 * To calculate vertex position in screen space using normalized (0-1) space:
3159 *
3160 * ```
3161 * vec4 filterVertexPosition( void )
3162 * {
3163 * vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
3164 * return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
3165 * }
3166 * ```
3167 *
3168 * **inputSize**
3169 *
3170 * Temporary framebuffer is different, it can be either the size of screen, either power-of-two.
3171 * The `inputSize.xy` are size of temporary framebuffer that holds input.
3172 * The `inputSize.zw` is inverted, it's a shortcut to evade division inside the shader.
3173 *
3174 * Set `inputSize.xy = outputFrame.zw` for a fullscreen filter.
3175 *
3176 * To calculate input normalized coordinate, you have to map it to filter normalized space.
3177 * Multiply by `outputFrame.zw` to get input coordinate.
3178 * Divide by `inputSize.xy` to get input normalized coordinate.
3179 *
3180 * ```
3181 * vec2 filterTextureCoord( void )
3182 * {
3183 * return aVertexPosition * (outputFrame.zw * inputSize.zw); // same as /inputSize.xy
3184 * }
3185 * ```
3186 * **resolution**
3187 *
3188 * The `resolution` is the ratio of screen (CSS) pixels to real pixels.
3189 *
3190 * **inputPixel**
3191 *
3192 * `inputPixel.xy` is the size of framebuffer in real pixels, same as `inputSize.xy * resolution`
3193 * `inputPixel.zw` is inverted `inputPixel.xy`.
3194 *
3195 * It's handy for filters that use neighbour pixels, like {@link PIXI.filters.FXAAFilter FXAAFilter}.
3196 *
3197 * **inputClamp**
3198 *
3199 * If you try to get info from outside of used part of Framebuffer - you'll get undefined behaviour.
3200 * For displacements, coordinates has to be clamped.
3201 *
3202 * The `inputClamp.xy` is left-top pixel center, you may ignore it, because we use left-top part of Framebuffer
3203 * `inputClamp.zw` is bottom-right pixel center.
3204 *
3205 * ```
3206 * vec4 color = texture2D(uSampler, clamp(modifigedTextureCoord, inputClamp.xy, inputClamp.zw))
3207 * ```
3208 * OR
3209 * ```
3210 * vec4 color = texture2D(uSampler, min(modifigedTextureCoord, inputClamp.zw))
3211 * ```
3212 *
3213 * ### Additional Information
3214 *
3215 * Complete documentation on Filter usage is located in the
3216 * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.
3217 *
3218 * Since PixiJS only had a handful of built-in filters, additional filters can be downloaded
3219 * {@link https://github.com/pixijs/pixi-filters here} from the PixiJS Filters repository.
3220 *
3221 * @class
3222 * @memberof PIXI
3223 * @extends PIXI.Shader
3224 */
3225 class Filter extends PIXI.Shader {
3226 constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: any);
3227 /**
3228 * The padding of the filter. Some filters require extra space to breath such as a blur.
3229 * Increasing this will add extra width and height to the bounds of the object that the
3230 * filter is applied to.
3231 *
3232 * @member {number} PIXI.Filter#padding
3233 */
3234 padding: number;
3235 /**
3236 * The resolution of the filter. Setting this to be lower will lower the quality but
3237 * increase the performance of the filter.
3238 *
3239 * @member {number} PIXI.Filter#resolution
3240 */
3241 resolution: number;
3242 /**
3243 * If enabled is true the filter is applied, if false it will not.
3244 *
3245 * @member {boolean} PIXI.Filter#enabled
3246 */
3247 enabled: boolean;
3248 /**
3249 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
3250 * Switch it off if it does not work for specific shader.
3251 *
3252 * @member {boolean} PIXI.Filter#autoFit
3253 */
3254 autoFit: boolean;
3255 /**
3256 * Legacy filters use position and uvs from attributes
3257 * @member {boolean} PIXI.Filter#legacy
3258 * @readonly
3259 */
3260 readonly legacy: boolean;
3261 /**
3262 * The WebGL state the filter requires to render
3263 * @member {PIXI.State} PIXI.Filter#state
3264 */
3265 state: PIXI.State;
3266 /**
3267 * Applies the filter
3268 *
3269 * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
3270 * @param {PIXI.RenderTexture} input - The input render target.
3271 * @param {PIXI.RenderTexture} output - The target to output to.
3272 * @param {PIXI.CLEAR_MODES} clearMode - Should the output be cleared before rendering to it.
3273 * @param {object} [currentState] - It's current state of filter.
3274 * There are some useful properties in the currentState :
3275 * target, filters, sourceFrame, destinationFrame, renderTarget, resolution
3276 */
3277 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES, currentState?: any): void;
3278 /**
3279 * Sets the blendmode of the filter
3280 *
3281 * @member {number}
3282 * @default PIXI.BLEND_MODES.NORMAL
3283 */
3284 blendMode: number;
3285 /**
3286 * The default vertex shader source
3287 *
3288 * @static
3289 * @type {string}
3290 * @constant
3291 */
3292 static readonly defaultVertexSrc: string;
3293 /**
3294 * The default fragment shader source
3295 *
3296 * @static
3297 * @type {string}
3298 * @constant
3299 */
3300 static readonly defaultFragmentSrc: string;
3301 /**
3302 * Program that the shader uses
3303 *
3304 * @member {PIXI.Program} PIXI.Shader#program
3305 */
3306 program: PIXI.Program;
3307 /**
3308 * Shader uniform values, shortcut for `uniformGroup.uniforms`
3309 * @readonly
3310 * @member {object}
3311 */
3312 readonly uniforms: any;
3313 }
3314 /**
3315 * This handles a Sprite acting as a mask, as opposed to a Graphic.
3316 *
3317 * WebGL only.
3318 *
3319 * @class
3320 * @extends PIXI.Filter
3321 * @memberof PIXI
3322 */
3323 class SpriteMaskFilter extends PIXI.Filter {
3324 constructor(sprite: PIXI.Sprite);
3325 /**
3326 * Sprite mask
3327 * @member {PIXI.Sprite} PIXI.SpriteMaskFilter#maskSprite
3328 */
3329 maskSprite: PIXI.Sprite;
3330 /**
3331 * Mask matrix
3332 * @member {PIXI.Matrix} PIXI.SpriteMaskFilter#maskMatrix
3333 */
3334 maskMatrix: PIXI.Matrix;
3335 /**
3336 * Applies the filter
3337 *
3338 * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
3339 * @param {PIXI.RenderTexture} input - The input render target.
3340 * @param {PIXI.RenderTexture} output - The target to output to.
3341 * @param {PIXI.CLEAR_MODES} clearMode - Should the output be cleared before rendering to it.
3342 */
3343 apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode: PIXI.CLEAR_MODES): void;
3344 /**
3345 * The padding of the filter. Some filters require extra space to breath such as a blur.
3346 * Increasing this will add extra width and height to the bounds of the object that the
3347 * filter is applied to.
3348 *
3349 * @member {number} PIXI.Filter#padding
3350 */
3351 padding: number;
3352 /**
3353 * The resolution of the filter. Setting this to be lower will lower the quality but
3354 * increase the performance of the filter.
3355 *
3356 * @member {number} PIXI.Filter#resolution
3357 */
3358 resolution: number;
3359 /**
3360 * If enabled is true the filter is applied, if false it will not.
3361 *
3362 * @member {boolean} PIXI.Filter#enabled
3363 */
3364 enabled: boolean;
3365 /**
3366 * If enabled, PixiJS will fit the filter area into boundaries for better performance.
3367 * Switch it off if it does not work for specific shader.
3368 *
3369 * @member {boolean} PIXI.Filter#autoFit
3370 */
3371 autoFit: boolean;
3372 /**
3373 * Legacy filters use position and uvs from attributes
3374 * @member {boolean} PIXI.Filter#legacy
3375 * @readonly
3376 */
3377 readonly legacy: boolean;
3378 /**
3379 * The WebGL state the filter requires to render
3380 * @member {PIXI.State} PIXI.Filter#state
3381 */
3382 state: PIXI.State;
3383 /**
3384 * Sets the blendmode of the filter
3385 *
3386 * @member {number}
3387 * @default PIXI.BLEND_MODES.NORMAL
3388 */
3389 blendMode: number;
3390 /**
3391 * Program that the shader uses
3392 *
3393 * @member {PIXI.Program} PIXI.Shader#program
3394 */
3395 program: PIXI.Program;
3396 /**
3397 * Shader uniform values, shortcut for `uniformGroup.uniforms`
3398 * @readonly
3399 * @member {object}
3400 */
3401 readonly uniforms: any;
3402 }
3403 /**
3404 * Default vertex shader
3405 * @memberof PIXI
3406 * @member {string} defaultVertex
3407 */
3408 var defaultVertex: string;
3409 /**
3410 * Default filter vertex shader
3411 * @memberof PIXI
3412 * @member {string} defaultFilterVertex
3413 */
3414 var defaultFilterVertex: string;
3415 /**
3416 * Frame buffer used by the BaseRenderTexture
3417 *
3418 * @class
3419 * @memberof PIXI
3420 */
3421 class Framebuffer {
3422 constructor(width: number, height: number);
3423 /**
3424 * Width of framebuffer in pixels
3425 * @member {number} PIXI.Framebuffer#width
3426 */
3427 width: number;
3428 /**
3429 * Height of framebuffer in pixels
3430 * @member {number} PIXI.Framebuffer#height
3431 */
3432 height: number;
3433 /**
3434 * Desired number of samples for antialiasing. 0 means AA should not be used.
3435 *
3436 * Experimental WebGL2 feature, allows to use antialiasing in individual renderTextures.
3437 * Antialiasing is the same as for main buffer with renderer `antialias:true` options.
3438 * Seriously affects GPU memory consumption and GPU performance.
3439 *
3440 *```js
3441 * renderTexture.framebuffer.multisample = PIXI.MSAA_QUALITY.HIGH;
3442 * //...
3443 * renderer.render(renderTexture, myContainer);
3444 * renderer.framebuffer.blit(); // copies data from MSAA framebuffer to texture
3445 * ```
3446 *
3447 * @member {PIXI.MSAA_QUALITY} PIXI.Framebuffer#multisample
3448 * @default PIXI.MSAA_QUALITY.NONE
3449 */
3450 multisample: PIXI.MSAA_QUALITY;
3451 /**
3452 * Reference to the colorTexture.
3453 *
3454 * @member {PIXI.BaseTexture[]}
3455 * @readonly
3456 */
3457 readonly colorTexture: PIXI.BaseTexture[];
3458 /**
3459 * Add texture to the colorTexture array
3460 *
3461 * @param {number} [index=0] - Index of the array to add the texture to
3462 * @param {PIXI.BaseTexture} [texture] - Texture to add to the array
3463 */
3464 addColorTexture(index?: number, texture?: PIXI.BaseTexture): void;
3465 /**
3466 * Add a depth texture to the frame buffer
3467 *
3468 * @param {PIXI.BaseTexture} [texture] - Texture to add
3469 */
3470 addDepthTexture(texture?: PIXI.BaseTexture): void;
3471 /**
3472 * Enable depth on the frame buffer
3473 */
3474 enableDepth(): void;
3475 /**
3476 * Enable stencil on the frame buffer
3477 */
3478 enableStencil(): void;
3479 /**
3480 * Resize the frame buffer
3481 *
3482 * @param {number} width - Width of the frame buffer to resize to
3483 * @param {number} height - Height of the frame buffer to resize to
3484 */
3485 resize(width: number, height: number): void;
3486 /**
3487 * Disposes WebGL resources that are connected to this geometry
3488 */
3489 dispose(): void;
3490 /**
3491 * Destroys and removes the depth texture added to this framebuffer.
3492 */
3493 destroyDepthTexture(): void;
3494 }
3495 /**
3496 * Internal framebuffer for WebGL context
3497 * @class
3498 * @memberof PIXI
3499 */
3500 class GLFramebuffer {
3501 constructor();
3502 /**
3503 * The WebGL framebuffer
3504 * @member {WebGLFramebuffer} PIXI.GLFramebuffer#framebuffer
3505 */
3506 framebuffer: WebGLFramebuffer;
3507 /**
3508 * stencil+depth , usually costs 32bits per pixel
3509 * @member {WebGLRenderbuffer} PIXI.GLFramebuffer#stencil
3510 */
3511 stencil: WebGLRenderbuffer;
3512 /**
3513 * latest known version of framebuffer
3514 * @member {number} PIXI.GLFramebuffer#dirtyId
3515 * @protected
3516 */
3517 protected dirtyId: number;
3518 /**
3519 * latest known version of framebuffer format
3520 * @member {number} PIXI.GLFramebuffer#dirtyFormat
3521 * @protected
3522 */
3523 protected dirtyFormat: number;
3524 /**
3525 * latest known version of framebuffer size
3526 * @member {number} PIXI.GLFramebuffer#dirtySize
3527 * @protected
3528 */
3529 protected dirtySize: number;
3530 /**
3531 * Detected AA samples number
3532 * @member {PIXI.MSAA_QUALITY} PIXI.GLFramebuffer#multisample
3533 */
3534 multisample: PIXI.MSAA_QUALITY;
3535 /**
3536 * In case MSAA, we use this Renderbuffer instead of colorTextures[0] when we write info
3537 * @member {WebGLRenderbuffer} PIXI.GLFramebuffer#msaaBuffer
3538 */
3539 msaaBuffer: WebGLRenderbuffer;
3540 /**
3541 * In case we use MSAA, this is actual framebuffer that has colorTextures[0]
3542 * The contents of that framebuffer are read when we use that renderTexture in sprites
3543 * @member {PIXI.Framebuffer} PIXI.GLFramebuffer#blitFramebuffer
3544 */
3545 blitFramebuffer: PIXI.Framebuffer;
3546 }
3547 /**
3548 * Holds the information for a single attribute structure required to render geometry.
3549 *
3550 * This does not contain the actual data, but instead has a buffer id that maps to a {@link PIXI.Buffer}
3551 * This can include anything from positions, uvs, normals, colors etc.
3552 *
3553 * @class
3554 * @memberof PIXI
3555 */
3556 class Attribute {
3557 constructor(buffer: string, size?: number, normalized?: boolean, type?: number, stride?: number, start?: number);
3558 /**
3559 * Destroys the Attribute.
3560 */
3561 destroy(): void;
3562 /**
3563 * Helper function that creates an Attribute based on the information provided
3564 *
3565 * @static
3566 * @param {string} buffer - the id of the buffer that this attribute will look for
3567 * @param {Number} [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
3568 * @param {Boolean} [normalized=false] - should the data be normalized.
3569 * @param {Number} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available
3570 * @param {Number} [stride=0] - How far apart (in floats) the start of each value is. (used for interleaving data)
3571 *
3572 * @returns {PIXI.Attribute} A new {@link PIXI.Attribute} based on the information provided
3573 */
3574 static from(buffer: string, size?: number, normalized?: boolean, type?: number, stride?: number): PIXI.Attribute;
3575 }
3576 /**
3577 * A wrapper for data so that it can be used and uploaded by WebGL
3578 *
3579 * @class
3580 * @memberof PIXI
3581 */
3582 class Buffer {
3583 constructor(data: ArrayBuffer | SharedArrayBuffer | ArrayBufferView, _static?: boolean, index?: boolean);
3584 /**
3585 * The data in the buffer, as a typed array
3586 *
3587 * @member {ArrayBuffer| SharedArrayBuffer | ArrayBufferView} PIXI.Buffer#data
3588 */
3589 data: ArrayBuffer | SharedArrayBuffer | ArrayBufferView;
3590 /**
3591 * flags this buffer as requiring an upload to the GPU
3592 * @param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView} [data] - the data to update in the buffer.
3593 */
3594 update(data?: ArrayBuffer | SharedArrayBuffer | ArrayBufferView): void;
3595 /**
3596 * disposes WebGL resources that are connected to this geometry
3597 */
3598 dispose(): void;
3599 /**
3600 * Destroys the buffer
3601 */
3602 destroy(): void;
3603 /**
3604 * Helper function that creates a buffer based on an array or TypedArray
3605 *
3606 * @static
3607 * @param {ArrayBufferView | number[]} data - the TypedArray that the buffer will store. If this is a regular Array it will be converted to a Float32Array.
3608 * @return {PIXI.Buffer} A new Buffer based on the data provided.
3609 */
3610 static from(data: ArrayBufferView | number[]): PIXI.Buffer;
3611 }
3612 /**
3613 * The Geometry represents a model. It consists of two components:
3614 * - GeometryStyle - The structure of the model such as the attributes layout
3615 * - GeometryData - the data of the model - this consists of buffers.
3616 * This can include anything from positions, uvs, normals, colors etc.
3617 *
3618 * Geometry can be defined without passing in a style or data if required (thats how I prefer!)
3619 *
3620 * ```js
3621 * let geometry = new PIXI.Geometry();
3622 *
3623 * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);
3624 * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1],2)
3625 * geometry.addIndex([0,1,2,1,3,2])
3626 *
3627 * ```
3628 * @class
3629 * @memberof PIXI
3630 */
3631 class Geometry {
3632 constructor(buffers?: PIXI.Buffer[], attributes?: any);
3633 /**
3634 * A map of renderer IDs to webgl VAOs
3635 *
3636 * @protected
3637 * @type {object}
3638 */
3639 protected glVertexArrayObjects: any;
3640 /**
3641 * Number of instances in this geometry, pass it to `GeometrySystem.draw()`
3642 * @member {number} PIXI.Geometry#instanceCount
3643 * @default 1
3644 */
3645 instanceCount: number;
3646 /**
3647 * Count of existing (not destroyed) meshes that reference this geometry
3648 * @member {number} PIXI.Geometry#refCount
3649 */
3650 refCount: number;
3651 /**
3652 *
3653 * Adds an attribute to the geometry
3654 * Note: `stride` and `start` should be `undefined` if you dont know them, not 0!
3655 *
3656 * @param {String} id - the name of the attribute (matching up to a shader)
3657 * @param {PIXI.Buffer|number[]} [buffer] - the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
3658 * @param {Number} [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
3659 * @param {Boolean} [normalized=false] - should the data be normalized.
3660 * @param {Number} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {PIXI.TYPES} to see the ones available
3661 * @param {Number} [stride] - How far apart (in floats) the start of each value is. (used for interleaving data)
3662 * @param {Number} [start] - How far into the array to start reading values (used for interleaving data)
3663 * @param {boolean} [instance=false] - Instancing flag
3664 *
3665 * @return {PIXI.Geometry} returns self, useful for chaining.
3666 */
3667 addAttribute(id: string, buffer?: PIXI.Buffer | number[], size?: number, normalized?: boolean, type?: number, stride?: number, start?: number, instance?: boolean): PIXI.Geometry;
3668 /**
3669 * returns the requested attribute
3670 *
3671 * @param {String} id - the name of the attribute required
3672 * @return {PIXI.Attribute} the attribute requested.
3673 */
3674 getAttribute(id: string): PIXI.Attribute;
3675 /**
3676 * returns the requested buffer
3677 *
3678 * @param {String} id - the name of the buffer required
3679 * @return {PIXI.Buffer} the buffer requested.
3680 */
3681 getBuffer(id: string): PIXI.Buffer;
3682 /**
3683 *
3684 * Adds an index buffer to the geometry
3685 * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
3686 *
3687 * @param {PIXI.Buffer|number[]} [buffer] - the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
3688 * @return {PIXI.Geometry} returns self, useful for chaining.
3689 */
3690 addIndex(buffer?: PIXI.Buffer | number[]): PIXI.Geometry;
3691 /**
3692 * returns the index buffer
3693 *
3694 * @return {PIXI.Buffer} the index buffer.
3695 */
3696 getIndex(): PIXI.Buffer;
3697 /**
3698 * this function modifies the structure so that all current attributes become interleaved into a single buffer
3699 * This can be useful if your model remains static as it offers a little performance boost
3700 *
3701 * @return {PIXI.Geometry} returns self, useful for chaining.
3702 */
3703 interleave(): PIXI.Geometry;
3704 /**
3705 * disposes WebGL resources that are connected to this geometry
3706 */
3707 dispose(): void;
3708 /**
3709 * Destroys the geometry.
3710 */
3711 destroy(): void;
3712 /**
3713 * returns a clone of the geometry
3714 *
3715 * @returns {PIXI.Geometry} a new clone of this geometry
3716 */
3717 clone(): PIXI.Geometry;
3718 /**
3719 * merges an array of geometries into a new single one
3720 * geometry attribute styles must match for this operation to work
3721 *
3722 * @param {PIXI.Geometry[]} geometries - array of geometries to merge
3723 * @returns {PIXI.Geometry} shiny new geometry!
3724 */
3725 static merge(geometries: PIXI.Geometry[]): PIXI.Geometry;
3726 }
3727 /**
3728 * Flexible wrapper around `ArrayBuffer` that also provides
3729 * typed array views on demand.
3730 *
3731 * @class
3732 * @memberof PIXI
3733 */
3734 class ViewableBuffer {
3735 constructor(size: number);
3736 /**
3737 * Underlying `ArrayBuffer` that holds all the data
3738 * and is of capacity `size`.
3739 *
3740 * @member {ArrayBuffer} PIXI.ViewableBuffer#rawBinaryData
3741 */
3742 rawBinaryData: ArrayBuffer;
3743 /**
3744 * View on the raw binary data as a `Uint32Array`.
3745 *
3746 * @member {Uint32Array} PIXI.ViewableBuffer#uint32View
3747 */
3748 uint32View: Uint32Array;
3749 /**
3750 * View on the raw binary data as a `Float32Array`.
3751 *
3752 * @member {Float32Array} PIXI.ViewableBuffer#float32View
3753 */
3754 float32View: Float32Array;
3755 /**
3756 * View on the raw binary data as a `Int8Array`.
3757 *
3758 * @member {Int8Array}
3759 */
3760 int8View: Int8Array;
3761 /**
3762 * View on the raw binary data as a `Uint8Array`.
3763 *
3764 * @member {Uint8Array}
3765 */
3766 uint8View: Uint8Array;
3767 /**
3768 * View on the raw binary data as a `Int16Array`.
3769 *
3770 * @member {Int16Array}
3771 */
3772 int16View: Int16Array;
3773 /**
3774 * View on the raw binary data as a `Uint16Array`.
3775 *
3776 * @member {Uint16Array}
3777 */
3778 uint16View: Uint16Array;
3779 /**
3780 * View on the raw binary data as a `Int32Array`.
3781 *
3782 * @member {Int32Array}
3783 */
3784 int32View: Int32Array;
3785 /**
3786 * Returns the view of the given type.
3787 *
3788 * @param {string} type - One of `int8`, `uint8`, `int16`,
3789 * `uint16`, `int32`, `uint32`, and `float32`.
3790 * @return {object} typed array of given type
3791 */
3792 view(type: string): any;
3793 /**
3794 * Destroys all buffer references. Do not use after calling
3795 * this.
3796 */
3797 destroy(): void;
3798 }
3799 /**
3800 * Component for masked elements
3801 *
3802 * Holds mask mode and temporary data about current mask
3803 *
3804 * @class
3805 * @memberof PIXI
3806 */
3807 class MaskData {
3808 constructor(maskObject?: PIXI.DisplayObject);
3809 /**
3810 * Mask type
3811 * @member {PIXI.MASK_TYPES} PIXI.MaskData#type
3812 */
3813 type: PIXI.MASK_TYPES;
3814 /**
3815 * Whether we know the mask type beforehand
3816 * @member {boolean} PIXI.MaskData#autoDetect
3817 * @default true
3818 */
3819 autoDetect: boolean;
3820 /**
3821 * Which element we use to mask
3822 * @member {PIXI.DisplayObject} PIXI.MaskData#maskObject
3823 */
3824 maskObject: PIXI.DisplayObject;
3825 /**
3826 * Whether it belongs to MaskSystem pool
3827 * @member {boolean} PIXI.MaskData#pooled
3828 */
3829 pooled: boolean;
3830 /**
3831 * Indicator of the type
3832 * @member {boolean} PIXI.MaskData#isMaskData
3833 */
3834 isMaskData: boolean;
3835 /**
3836 * Scissor operation above the mask in stack.
3837 * Null if _scissorCounter is zero, rectangle instance if positive.
3838 * @member {PIXI.Rectangle} PIXI.MaskData#_scissorRect
3839 */
3840 _scissorRect: PIXI.Rectangle;
3841 /**
3842 * resets the mask data after popMask()
3843 */
3844 reset(): void;
3845 /**
3846 * copies counters from maskData above, called from pushMask()
3847 * @param {PIXI.MaskData|null} maskAbove
3848 */
3849 copyCountersOrReset(maskAbove: PIXI.MaskData | null): void;
3850 }
3851 /**
3852 * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it.
3853 *
3854 * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded
3855 * otherwise black rectangles will be drawn instead.
3856 *
3857 * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position
3858 * and rotation of the given Display Objects is ignored. For example:
3859 *
3860 * ```js
3861 * let renderer = PIXI.autoDetectRenderer();
3862 * let baseRenderTexture = new PIXI.BaseRenderTexture({ width: 800, height: 600 });
3863 * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);
3864 * let sprite = PIXI.Sprite.from("spinObj_01.png");
3865 *
3866 * sprite.position.x = 800/2;
3867 * sprite.position.y = 600/2;
3868 * sprite.anchor.x = 0.5;
3869 * sprite.anchor.y = 0.5;
3870 *
3871 * renderer.render(sprite, renderTexture);
3872 * ```
3873 *
3874 * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0
3875 * you can clear the transform
3876 *
3877 * ```js
3878 *
3879 * sprite.setTransform()
3880 *
3881 * let baseRenderTexture = new PIXI.BaseRenderTexture({ width: 100, height: 100 });
3882 * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);
3883 *
3884 * renderer.render(sprite, renderTexture); // Renders to center of RenderTexture
3885 * ```
3886 *
3887 * @class
3888 * @extends PIXI.BaseTexture
3889 * @memberof PIXI
3890 */
3891 class BaseRenderTexture extends PIXI.BaseTexture {
3892 constructor(options?: {
3893 width?: number;
3894 height?: number;
3895 scaleMode?: PIXI.SCALE_MODES;
3896 resolution?: number;
3897 });
3898 /**
3899 * A reference to the canvas render target (we only need one as this can be shared across renderers)
3900 *
3901 * @protected
3902 * @member {PIXI.utils.CanvasRenderTarget} _canvasRenderTarget
3903 * @memberof PIXI.BaseRenderTexture#
3904 */
3905 protected _canvasRenderTarget: PIXI.utils.CanvasRenderTarget;
3906 /**
3907 * The data structure for the stencil masks.
3908 *
3909 * @member {PIXI.MaskData[]} PIXI.BaseRenderTexture#maskStack
3910 */
3911 maskStack: PIXI.MaskData[];
3912 /**
3913 * The data structure for the filters.
3914 *
3915 * @member {Object[]} PIXI.BaseRenderTexture#filterStack
3916 */
3917 filterStack: any[];
3918 /**
3919 * Resizes the BaseRenderTexture.
3920 *
3921 * @param {number} width - The width to resize to.
3922 * @param {number} height - The height to resize to.
3923 */
3924 resize(width: number, height: number): void;
3925 /**
3926 * Frees the texture and framebuffer from WebGL memory without destroying this texture object.
3927 * This means you can still use the texture later which will upload it to GPU
3928 * memory again.
3929 *
3930 * @fires PIXI.BaseTexture#dispose
3931 */
3932 dispose(): void;
3933 /**
3934 * Destroys this texture.
3935 */
3936 destroy(): void;
3937 /**
3938 * Get the drawable source, such as HTMLCanvasElement or HTMLImageElement suitable
3939 * for rendering with CanvasRenderer. Provided by **@pixi/canvas-renderer** package.
3940 * @method getDrawableSource
3941 * @memberof PIXI.BaseTexture#
3942 * @return {PIXI.ICanvasImageSource} Source to render with CanvasRenderer
3943 */
3944 getDrawableSource(): PIXI.ICanvasImageSource;
3945 /**
3946 * The width of the base texture set when the image has loaded
3947 *
3948 * @readonly
3949 * @member {number} PIXI.BaseTexture#width
3950 */
3951 readonly width: number;
3952 /**
3953 * The height of the base texture set when the image has loaded
3954 *
3955 * @readonly
3956 * @member {number} PIXI.BaseTexture#height
3957 */
3958 readonly height: number;
3959 /**
3960 * The resolution / device pixel ratio of the texture
3961 *
3962 * @member {number} PIXI.BaseTexture#resolution
3963 * @default PIXI.settings.RESOLUTION
3964 */
3965 resolution: number;
3966 /**
3967 * Mipmap mode of the texture, affects downscaled images
3968 *
3969 * @member {PIXI.MIPMAP_MODES} PIXI.BaseTexture#mipmap
3970 * @default PIXI.settings.MIPMAP_TEXTURES
3971 */
3972 mipmap: PIXI.MIPMAP_MODES;
3973 /**
3974 * Anisotropic filtering level of texture
3975 *
3976 * @member {number} PIXI.BaseTexture#anisotropicLevel
3977 * @default PIXI.settings.ANISOTROPIC_LEVEL
3978 */
3979 anisotropicLevel: number;
3980 /**
3981 * How the texture wraps
3982 * @member {number} PIXI.BaseTexture#wrapMode
3983 */
3984 wrapMode: number;
3985 /**
3986 * The scale mode to apply when scaling this texture
3987 *
3988 * @member {PIXI.SCALE_MODES} PIXI.BaseTexture#scaleMode
3989 * @default PIXI.settings.SCALE_MODE
3990 */
3991 scaleMode: PIXI.SCALE_MODES;
3992 /**
3993 * The pixel format of the texture
3994 *
3995 * @member {PIXI.FORMATS} PIXI.BaseTexture#format
3996 * @default PIXI.FORMATS.RGBA
3997 */
3998 format: PIXI.FORMATS;
3999 /**
4000 * The type of resource data
4001 *
4002 * @member {PIXI.TYPES} PIXI.BaseTexture#type
4003 * @default PIXI.TYPES.UNSIGNED_BYTE
4004 */
4005 type: PIXI.TYPES;
4006 /**
4007 * The target type
4008 *
4009 * @member {PIXI.TARGETS} PIXI.BaseTexture#target
4010 * @default PIXI.TARGETS.TEXTURE_2D
4011 */
4012 target: PIXI.TARGETS;
4013 /**
4014 * How to treat premultiplied alpha, see {@link PIXI.ALPHA_MODES}.
4015 *
4016 * @member {PIXI.ALPHA_MODES} PIXI.BaseTexture#alphaMode
4017 * @default PIXI.ALPHA_MODES.UNPACK
4018 */
4019 alphaMode: PIXI.ALPHA_MODES;
4020 /**
4021 * Global unique identifier for this BaseTexture
4022 *
4023 * @member {number} PIXI.BaseTexture#uid
4024 * @protected
4025 */
4026 protected uid: number;
4027 /**
4028 * Used by automatic texture Garbage Collection, stores last GC tick when it was bound
4029 *
4030 * @member {number} PIXI.BaseTexture#touched
4031 * @protected
4032 */
4033 protected touched: number;
4034 /**
4035 * Whether or not the texture is a power of two, try to use power of two textures as much
4036 * as you can
4037 *
4038 * @readonly
4039 * @member {boolean} PIXI.BaseTexture#isPowerOfTwo
4040 * @default false
4041 */
4042 readonly isPowerOfTwo: boolean;
4043 /**
4044 * Used by TextureSystem to only update texture to the GPU when needed.
4045 * Please call `update()` to increment it.
4046 *
4047 * @readonly
4048 * @member {number} PIXI.BaseTexture#dirtyId
4049 */
4050 readonly dirtyId: number;
4051 /**
4052 * Used by TextureSystem to only update texture style when needed.
4053 *
4054 * @protected
4055 * @member {number} PIXI.BaseTexture#dirtyStyleId
4056 */
4057 protected dirtyStyleId: number;
4058 /**
4059 * Currently default cache ID.
4060 *
4061 * @member {string} PIXI.BaseTexture#cacheId
4062 */
4063 cacheId: string;
4064 /**
4065 * Generally speaking means when resource is loaded.
4066 * @readonly
4067 * @member {boolean} PIXI.BaseTexture#valid
4068 */
4069 readonly valid: boolean;
4070 /**
4071 * The collection of alternative cache ids, since some BaseTextures
4072 * can have more than one ID, short name and longer full URL
4073 *
4074 * @member {Array<string>} PIXI.BaseTexture#textureCacheIds
4075 * @readonly
4076 */
4077 readonly textureCacheIds: string[];
4078 /**
4079 * Flag if BaseTexture has been destroyed.
4080 *
4081 * @member {boolean} PIXI.BaseTexture#destroyed
4082 * @readonly
4083 */
4084 readonly destroyed: boolean;
4085 /**
4086 * The resource used by this BaseTexture, there can only
4087 * be one resource per BaseTexture, but textures can share
4088 * resources.
4089 *
4090 * @member {PIXI.resources.Resource} PIXI.BaseTexture#resource
4091 * @readonly
4092 */
4093 readonly resource: PIXI.resources.Resource;
4094 /**
4095 * Number of the texture batch, used by multi-texture renderers
4096 *
4097 * @member {number} PIXI.BaseTexture#_batchEnabled
4098 */
4099 _batchEnabled: number;
4100 /**
4101 * Location inside texture batch, used by multi-texture renderers
4102 *
4103 * @member {number} PIXI.BaseTexture#_batchLocation
4104 */
4105 _batchLocation: number;
4106 /**
4107 * Whether its a part of another texture, handled by ArrayResource or CubeResource
4108 *
4109 * @member {PIXI.BaseTexture} PIXI.BaseTexture#parentTextureArray
4110 */
4111 parentTextureArray: PIXI.BaseTexture;
4112 /**
4113 * Pixel width of the source of this texture
4114 *
4115 * @readonly
4116 * @member {number}
4117 */
4118 readonly realWidth: number;
4119 /**
4120 * Pixel height of the source of this texture
4121 *
4122 * @readonly
4123 * @member {number}
4124 */
4125 readonly realHeight: number;
4126 /**
4127 * Changes style options of BaseTexture
4128 *
4129 * @param {PIXI.SCALE_MODES} [scaleMode] - Pixi scalemode
4130 * @param {PIXI.MIPMAP_MODES} [mipmap] - enable mipmaps
4131 * @returns {PIXI.BaseTexture} this
4132 */
4133 setStyle(scaleMode?: PIXI.SCALE_MODES, mipmap?: PIXI.MIPMAP_MODES): PIXI.BaseTexture;
4134 /**
4135 * Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.
4136 *
4137 * @param {number} width - Visual width
4138 * @param {number} height - Visual height
4139 * @param {number} [resolution] - Optionally set resolution
4140 * @returns {PIXI.BaseTexture} this
4141 */
4142 setSize(width: number, height: number, resolution?: number): PIXI.BaseTexture;
4143 /**
4144 * Sets real size of baseTexture, preserves current resolution.
4145 *
4146 * @param {number} realWidth - Full rendered width
4147 * @param {number} realHeight - Full rendered height
4148 * @param {number} [resolution] - Optionally set resolution
4149 * @returns {PIXI.BaseTexture} this
4150 */
4151 setRealSize(realWidth: number, realHeight: number, resolution?: number): PIXI.BaseTexture;
4152 /**
4153 * Changes resolution
4154 *
4155 * @param {number} resolution - res
4156 * @returns {PIXI.BaseTexture} this
4157 */
4158 setResolution(resolution: number): PIXI.BaseTexture;
4159 /**
4160 * Sets the resource if it wasn't set. Throws error if resource already present
4161 *
4162 * @param {PIXI.resources.Resource} resource - that is managing this BaseTexture
4163 * @returns {PIXI.BaseTexture} this
4164 */
4165 setResource(resource: PIXI.resources.Resource): PIXI.BaseTexture;
4166 /**
4167 * Invalidates the object. Texture becomes valid if width and height are greater than zero.
4168 */
4169 update(): void;
4170 /**
4171 * Utility function for BaseTexture|Texture cast
4172 */
4173 castToBaseTexture(): void;
4174 }
4175 /**
4176 * A RenderTexture is a special texture that allows any PixiJS display object to be rendered to it.
4177 *
4178 * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded
4179 * otherwise black rectangles will be drawn instead.
4180 *
4181 * __Hint-2__: The actual memory allocation will happen on first render.
4182 * You shouldn't create renderTextures each frame just to delete them after, try to reuse them.
4183 *
4184 * A RenderTexture takes a snapshot of any Display Object given to its render method. For example:
4185 *
4186 * ```js
4187 * let renderer = PIXI.autoDetectRenderer();
4188 * let renderTexture = PIXI.RenderTexture.create({ width: 800, height: 600 });
4189 * let sprite = PIXI.Sprite.from("spinObj_01.png");
4190 *
4191 * sprite.position.x = 800/2;
4192 * sprite.position.y = 600/2;
4193 * sprite.anchor.x = 0.5;
4194 * sprite.anchor.y = 0.5;
4195 *
4196 * renderer.render(sprite, renderTexture);
4197 * ```
4198 *
4199 * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0
4200 * you can clear the transform
4201 *
4202 * ```js
4203 *
4204 * sprite.setTransform()
4205 *
4206 * let renderTexture = new PIXI.RenderTexture.create(100, 100);
4207 *
4208 * renderer.render(sprite, renderTexture); // Renders to center of RenderTexture
4209 * ```
4210 *
4211 * @class
4212 * @extends PIXI.Texture
4213 * @memberof PIXI
4214 */
4215 class RenderTexture extends PIXI.Texture {
4216 constructor(baseRenderTexture: PIXI.BaseRenderTexture, frame?: PIXI.Rectangle);
4217 /**
4218 * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
4219 *
4220 * @member {boolean} PIXI.RenderTexture#valid
4221 */
4222 valid: boolean;
4223 /**
4224 * Stores `sourceFrame` when this texture is inside current filter stack.
4225 * You can read it inside filters.
4226 *
4227 * @readonly
4228 * @member {PIXI.Rectangle} PIXI.RenderTexture#filterFrame
4229 */
4230 readonly filterFrame: PIXI.Rectangle;
4231 /**
4232 * The key for pooled texture of FilterSystem
4233 * @protected
4234 * @member {string} PIXI.RenderTexture#filterPoolKey
4235 */
4236 protected filterPoolKey: string;
4237 /**
4238 * Shortcut to `this.baseTexture.framebuffer`, saves baseTexture cast.
4239 * @member {PIXI.Framebuffer}
4240 * @readonly
4241 */
4242 readonly framebuffer: PIXI.Framebuffer;
4243 /**
4244 * Resizes the RenderTexture.
4245 *
4246 * @param {number} width - The width to resize to.
4247 * @param {number} height - The height to resize to.
4248 * @param {boolean} [resizeBaseTexture=true] - Should the baseTexture.width and height values be resized as well?
4249 */
4250 resize(width: number, height: number, resizeBaseTexture?: boolean): void;
4251 /**
4252 * Changes the resolution of baseTexture, but does not change framebuffer size.
4253 *
4254 * @param {number} resolution - The new resolution to apply to RenderTexture
4255 */
4256 setResolution(resolution: number): void;
4257 /**
4258 * A short hand way of creating a render texture.
4259 *
4260 * @param {object} [options] - Options
4261 * @param {number} [options.width=100] - The width of the render texture
4262 * @param {number} [options.height=100] - The height of the render texture
4263 * @param {number} [options.scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values
4264 * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the texture being generated
4265 * @return {PIXI.RenderTexture} The new render texture
4266 */
4267 static create(options?: {
4268 width?: number;
4269 height?: number;
4270 scaleMode?: number;
4271 resolution?: number;
4272 }): PIXI.RenderTexture;
4273 /**
4274 * Does this Texture have any frame data assigned to it?
4275 *
4276 * This mode is enabled automatically if no frame was passed inside constructor.
4277 *
4278 * In this mode texture is subscribed to baseTexture events, and fires `update` on any change.
4279 *
4280 * Beware, after loading or resize of baseTexture event can fired two times!
4281 * If you want more control, subscribe on baseTexture itself.
4282 *
4283 * ```js
4284 * texture.on('update', () => {});
4285 * ```
4286 *
4287 * Any assignment of `frame` switches off `noFrame` mode.
4288 *
4289 * @member {boolean} PIXI.Texture#noFrame
4290 */
4291 noFrame: boolean;
4292 /**
4293 * The base texture that this texture uses.
4294 *
4295 * @member {PIXI.BaseTexture} PIXI.Texture#baseTexture
4296 */
4297 baseTexture: PIXI.BaseTexture;
4298 /**
4299 * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
4300 * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
4301 *
4302 * @member {PIXI.Rectangle} PIXI.Texture#_frame
4303 */
4304 _frame: PIXI.Rectangle;
4305 /**
4306 * This is the trimmed area of original texture, before it was put in atlas
4307 * Please call `updateUvs()` after you change coordinates of `trim` manually.
4308 *
4309 * @member {PIXI.Rectangle} PIXI.Texture#trim
4310 */
4311 trim: PIXI.Rectangle;
4312 /**
4313 * The WebGL UV data cache. Can be used as quad UV
4314 *
4315 * @member {PIXI.TextureUvs} PIXI.Texture#_uvs
4316 * @protected
4317 */
4318 protected _uvs: PIXI.TextureUvs;
4319 /**
4320 * Default TextureMatrix instance for this texture
4321 * By default that object is not created because its heavy
4322 *
4323 * @member {PIXI.TextureMatrix} PIXI.Texture#uvMatrix
4324 */
4325 uvMatrix: PIXI.TextureMatrix;
4326 /**
4327 * This is the area of original texture, before it was put in atlas
4328 *
4329 * @member {PIXI.Rectangle} PIXI.Texture#orig
4330 */
4331 orig: PIXI.Rectangle;
4332 /**
4333 * Anchor point that is used as default if sprite is created with this texture.
4334 * Changing the `defaultAnchor` at a later point of time will not update Sprite's anchor point.
4335 * @member {PIXI.Point} PIXI.Texture#defaultAnchor
4336 * @default {0,0}
4337 */
4338 defaultAnchor: PIXI.Point;
4339 /**
4340 * Update ID is observed by sprites and TextureMatrix instances.
4341 * Call updateUvs() to increment it.
4342 *
4343 * @member {number} PIXI.Texture#_updateID
4344 * @protected
4345 */
4346 protected _updateID: number;
4347 /**
4348 * The ids under which this Texture has been added to the texture cache. This is
4349 * automatically set as long as Texture.addToCache is used, but may not be set if a
4350 * Texture is added directly to the TextureCache array.
4351 *
4352 * @member {string[]} PIXI.Texture#textureCacheIds
4353 */
4354 textureCacheIds: string[];
4355 /**
4356 * Updates this texture on the gpu.
4357 *
4358 * Calls the TextureResource update.
4359 *
4360 * If you adjusted `frame` manually, please call `updateUvs()` instead.
4361 *
4362 */
4363 update(): void;
4364 /**
4365 * Called when the base texture is updated
4366 *
4367 * @protected
4368 * @param {PIXI.BaseTexture} baseTexture - The base texture.
4369 */
4370 protected onBaseTextureUpdated(baseTexture: PIXI.BaseTexture): void;
4371 /**
4372 * Destroys this texture
4373 *
4374 * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well
4375 */
4376 destroy(destroyBase?: boolean): void;
4377 /**
4378 * Creates a new texture object that acts the same as this one.
4379 *
4380 * @return {PIXI.Texture} The new texture
4381 */
4382 clone(): PIXI.Texture;
4383 /**
4384 * Updates the internal WebGL UV cache. Use it after you change `frame` or `trim` of the texture.
4385 * Call it after changing the frame
4386 */
4387 updateUvs(): void;
4388 /**
4389 * Returns resolution of baseTexture
4390 *
4391 * @member {number}
4392 * @readonly
4393 */
4394 readonly resolution: number;
4395 /**
4396 * The frame specifies the region of the base texture that this texture uses.
4397 * Please call `updateUvs()` after you change coordinates of `frame` manually.
4398 *
4399 * @member {PIXI.Rectangle}
4400 */
4401 frame: PIXI.Rectangle;
4402 /**
4403 * Indicates whether the texture is rotated inside the atlas
4404 * set to 2 to compensate for texture packer rotation
4405 * set to 6 to compensate for spine packer rotation
4406 * can be used to rotate or mirror sprites
4407 * See {@link PIXI.groupD8} for explanation
4408 *
4409 * @member {number}
4410 */
4411 rotate: number;
4412 /**
4413 * The width of the Texture in pixels.
4414 *
4415 * @member {number}
4416 */
4417 width: number;
4418 /**
4419 * The height of the Texture in pixels.
4420 *
4421 * @member {number}
4422 */
4423 height: number;
4424 /**
4425 * Utility function for BaseTexture|Texture cast
4426 */
4427 castToBaseTexture(): void;
4428 }
4429 /**
4430 * Experimental!
4431 *
4432 * Texture pool, used by FilterSystem and plugins
4433 * Stores collection of temporary pow2 or screen-sized renderTextures
4434 *
4435 * If you use custom RenderTexturePool for your filters, you can use methods
4436 * `getFilterTexture` and `returnFilterTexture` same as in
4437 *
4438 * @class
4439 * @memberof PIXI
4440 */
4441 class RenderTexturePool {
4442 constructor(textureOptions?: {
4443 scaleMode?: PIXI.SCALE_MODES;
4444 });
4445 /**
4446 * Allow renderTextures of the same size as screen, not just pow2
4447 *
4448 * Automatically sets to true after `setScreenSize`
4449 *
4450 * @member {boolean} PIXI.RenderTexturePool#enableFullScreen
4451 * @default false
4452 */
4453 enableFullScreen: boolean;
4454 /**
4455 * creates of texture with params that were specified in pool constructor
4456 *
4457 * @param {number} realWidth - width of texture in pixels
4458 * @param {number} realHeight - height of texture in pixels
4459 * @returns {RenderTexture}
4460 */
4461 createTexture(realWidth: number, realHeight: number): RenderTexture;
4462 /**
4463 * Gets a Power-of-Two render texture or fullScreen texture
4464 *
4465 * @protected
4466 * @param {number} minWidth - The minimum width of the render texture in real pixels.
4467 * @param {number} minHeight - The minimum height of the render texture in real pixels.
4468 * @param {number} [resolution=1] - The resolution of the render texture.
4469 * @return {PIXI.RenderTexture} The new render texture.
4470 */
4471 protected getOptimalTexture(minWidth: number, minHeight: number, resolution?: number): PIXI.RenderTexture;
4472 /**
4473 * Gets extra texture of the same size as input renderTexture
4474 *
4475 * `getFilterTexture(input, 0.5)` or `getFilterTexture(0.5, input)`
4476 *
4477 * @param {PIXI.RenderTexture} input - renderTexture from which size and resolution will be copied
4478 * @param {number} [resolution] - override resolution of the renderTexture
4479 * It overrides, it does not multiply
4480 * @returns {PIXI.RenderTexture}
4481 */
4482 getFilterTexture(input: PIXI.RenderTexture, resolution?: number): PIXI.RenderTexture;
4483 /**
4484 * Place a render texture back into the pool.
4485 * @param {PIXI.RenderTexture} renderTexture - The renderTexture to free
4486 */
4487 returnTexture(renderTexture: PIXI.RenderTexture): void;
4488 /**
4489 * Alias for returnTexture, to be compliant with FilterSystem interface
4490 * @param {PIXI.RenderTexture} renderTexture - The renderTexture to free
4491 */
4492 returnFilterTexture(renderTexture: PIXI.RenderTexture): void;
4493 /**
4494 * Clears the pool
4495 *
4496 * @param {boolean} [destroyTextures=true] - destroy all stored textures
4497 */
4498 clear(destroyTextures?: boolean): void;
4499 /**
4500 * If screen size was changed, drops all screen-sized textures,
4501 * sets new screen size, sets `enableFullScreen` to true
4502 *
4503 * Size is measured in pixels, `renderer.view` can be passed here, not `renderer.screen`
4504 *
4505 * @param {PIXI.ISize} size - Initial size of screen
4506 */
4507 setScreenSize(size: PIXI.ISize): void;
4508 /**
4509 * Key that is used to store fullscreen renderTextures in a pool
4510 *
4511 * @static
4512 * @const {string}
4513 */
4514 static readonly SCREEN_KEY: string;
4515 }
4516 /**
4517 * Helper class to create a WebGL Program
4518 *
4519 * @class
4520 * @memberof PIXI
4521 */
4522 class GLProgram {
4523 constructor(program: WebGLProgram, uniformData: any);
4524 /**
4525 * Destroys this program
4526 */
4527 destroy(): void;
4528 }
4529 /**
4530 * Helper class to create a shader program.
4531 *
4532 * @class
4533 * @memberof PIXI
4534 */
4535 class Program {
4536 constructor(vertexSrc?: string, fragmentSrc?: string, name?: string);
4537 /**
4538 * The vertex shader.
4539 *
4540 * @member {string} PIXI.Program#vertexSrc
4541 */
4542 vertexSrc: string;
4543 /**
4544 * The fragment shader.
4545 *
4546 * @member {string} PIXI.Program#fragmentSrc
4547 */
4548 fragmentSrc: string;
4549 /**
4550 * Extracts the data for a buy creating a small test program
4551 * or reading the src directly.
4552 * @protected
4553 *
4554 * @param {string} [vertexSrc] - The source of the vertex shader.
4555 * @param {string} [fragmentSrc] - The source of the fragment shader.
4556 */
4557 protected extractData(vertexSrc?: string, fragmentSrc?: string): void;
4558 /**
4559 * The default vertex shader source
4560 *
4561 * @static
4562 * @constant
4563 * @member {string}
4564 */
4565 static defaultVertexSrc: string;
4566 /**
4567 * The default fragment shader source
4568 *
4569 * @static
4570 * @constant
4571 * @member {string}
4572 */
4573 static defaultFragmentSrc: string;
4574 /**
4575 * A short hand function to create a program based of a vertex and fragment shader
4576 * this method will also check to see if there is a cached program.
4577 *
4578 * @param {string} [vertexSrc] - The source of the vertex shader.
4579 * @param {string} [fragmentSrc] - The source of the fragment shader.
4580 * @param {string} [name=pixi-shader] - Name for shader
4581 *
4582 * @returns {PIXI.Program} an shiny new Pixi shader!
4583 */
4584 static from(vertexSrc?: string, fragmentSrc?: string, name?: string): PIXI.Program;
4585 }
4586 /**
4587 * A helper class for shaders
4588 *
4589 * @class
4590 * @memberof PIXI
4591 */
4592 class Shader {
4593 constructor(program?: PIXI.Program, uniforms?: any);
4594 /**
4595 * Program that the shader uses
4596 *
4597 * @member {PIXI.Program} PIXI.Shader#program
4598 */
4599 program: PIXI.Program;
4600 /**
4601 * Shader uniform values, shortcut for `uniformGroup.uniforms`
4602 * @readonly
4603 * @member {object}
4604 */
4605 readonly uniforms: any;
4606 /**
4607 * A short hand function to create a shader based of a vertex and fragment shader
4608 *
4609 * @param {string} [vertexSrc] - The source of the vertex shader.
4610 * @param {string} [fragmentSrc] - The source of the fragment shader.
4611 * @param {object} [uniforms] - Custom uniforms to use to augment the built-in ones.
4612 *
4613 * @returns {PIXI.Shader} an shiny new Pixi shader!
4614 */
4615 static from(vertexSrc?: string, fragmentSrc?: string, uniforms?: any): PIXI.Shader;
4616 }
4617 /**
4618 * Uniform group holds uniform map and some ID's for work
4619 *
4620 * @class
4621 * @memberof PIXI
4622 */
4623 class UniformGroup {
4624 constructor(uniforms?: any, _static?: boolean);
4625 /**
4626 * uniform values
4627 * @member {object} PIXI.UniformGroup#uniforms
4628 * @readonly
4629 */
4630 readonly uniforms: any;
4631 /**
4632 * Its a group and not a single uniforms
4633 * @member {boolean} PIXI.UniformGroup#group
4634 * @readonly
4635 * @default true
4636 */
4637 readonly group: boolean;
4638 /**
4639 * dirty version
4640 * @protected
4641 * @member {number} PIXI.UniformGroup#dirtyId
4642 */
4643 protected dirtyId: number;
4644 /**
4645 * unique id
4646 * @protected
4647 * @member {number} PIXI.UniformGroup#id
4648 */
4649 protected id: number;
4650 /**
4651 * Uniforms wont be changed after creation
4652 * @member {boolean} PIXI.UniformGroup#static
4653 */
4654 static: boolean;
4655 }
4656 /**
4657 * This is a WebGL state, and is is passed The WebGL StateManager.
4658 *
4659 * Each mesh rendered may require WebGL to be in a different state.
4660 * For example you may want different blend mode or to enable polygon offsets
4661 *
4662 * @class
4663 * @memberof PIXI
4664 */
4665 class State {
4666 constructor();
4667 /**
4668 * Activates blending of the computed fragment color values
4669 *
4670 * @member {boolean}
4671 */
4672 blend: boolean;
4673 /**
4674 * Activates adding an offset to depth values of polygon's fragments
4675 *
4676 * @member {boolean}
4677 * @default false
4678 */
4679 offsets: boolean;
4680 /**
4681 * Activates culling of polygons.
4682 *
4683 * @member {boolean}
4684 * @default false
4685 */
4686 culling: boolean;
4687 /**
4688 * Activates depth comparisons and updates to the depth buffer.
4689 *
4690 * @member {boolean}
4691 * @default false
4692 */
4693 depthTest: boolean;
4694 /**
4695 * Specifies whether or not front or back-facing polygons can be culled.
4696 * @member {boolean}
4697 * @default false
4698 */
4699 clockwiseFrontFace: boolean;
4700 /**
4701 * The blend mode to be applied when this state is set. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
4702 * Setting this mode to anything other than NO_BLEND will automatically switch blending on.
4703 *
4704 * @member {number}
4705 * @default PIXI.BLEND_MODES.NORMAL
4706 * @see PIXI.BLEND_MODES
4707 */
4708 blendMode: number;
4709 /**
4710 * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.
4711 *
4712 * @member {number}
4713 * @default 0
4714 */
4715 polygonOffset: number;
4716 }
4717 /**
4718 * Systems are individual components to the Renderer pipeline.
4719 * @namespace PIXI.systems
4720 */
4721 namespace systems {
4722 /**
4723 * System plugin to the renderer to manage batching.
4724 *
4725 * @class
4726 * @extends PIXI.System
4727 * @memberof PIXI.systems
4728 */
4729 class BatchSystem extends PIXI.System {
4730 constructor(renderer: PIXI.Renderer);
4731 /**
4732 * An empty renderer.
4733 *
4734 * @member {PIXI.ObjectRenderer} PIXI.systems.BatchSystem#emptyRenderer
4735 */
4736 emptyRenderer: PIXI.ObjectRenderer;
4737 /**
4738 * The currently active ObjectRenderer.
4739 *
4740 * @member {PIXI.ObjectRenderer} PIXI.systems.BatchSystem#currentRenderer
4741 */
4742 currentRenderer: PIXI.ObjectRenderer;
4743 /**
4744 * Changes the current renderer to the one given in parameter
4745 *
4746 * @param {PIXI.ObjectRenderer} objectRenderer - The object renderer to use.
4747 */
4748 setObjectRenderer(objectRenderer: PIXI.ObjectRenderer): void;
4749 /**
4750 * This should be called if you wish to do some custom rendering
4751 * It will basically render anything that may be batched up such as sprites
4752 */
4753 flush(): void;
4754 /**
4755 * Reset the system to an empty renderer
4756 */
4757 reset(): void;
4758 /**
4759 * Handy function for batch renderers: copies bound textures in first maxTextures locations to array
4760 * sets actual _batchLocation for them
4761 *
4762 * @param {PIXI.BaseTexture[]} - arr copy destination
4763 * @param {number} maxTextures - number of copied elements
4764 */
4765 copyBoundTextures(arr: PIXI.BaseTexture[], maxTextures: number): void;
4766 /**
4767 * Assigns batch locations to textures in array based on boundTextures state.
4768 * All textures in texArray should have `_batchEnabled = _batchId`,
4769 * and their count should be less than `maxTextures`.
4770 *
4771 * @param {PIXI.BatchTextureArray} texArray - textures to bound
4772 * @param {PIXI.BaseTexture[]} boundTextures - current state of bound textures
4773 * @param {number} batchId - marker for _batchEnabled param of textures in texArray
4774 * @param {number} maxTextures - number of texture locations to manipulate
4775 */
4776 boundArray(texArray: PIXI.BatchTextureArray, boundTextures: PIXI.BaseTexture[], batchId: number, maxTextures: number): void;
4777 /**
4778 * The renderer this manager works for.
4779 *
4780 * @member {PIXI.Renderer} PIXI.System#renderer
4781 */
4782 renderer: PIXI.Renderer;
4783 /**
4784 * Generic destroy methods to be overridden by the subclass
4785 */
4786 destroy(): void;
4787 }
4788 /**
4789 * System plugin to the renderer to manage the context.
4790 *
4791 * @class
4792 * @extends PIXI.System
4793 * @memberof PIXI.systems
4794 */
4795 class ContextSystem extends PIXI.System {
4796 constructor(renderer: PIXI.Renderer);
4797 /**
4798 * Either 1 or 2 to reflect the WebGL version being used
4799 * @member {number} PIXI.systems.ContextSystem#webGLVersion
4800 * @readonly
4801 */
4802 readonly webGLVersion: number;
4803 /**
4804 * Extensions being used
4805 * @member {object} PIXI.systems.ContextSystem#extensions
4806 * @readonly
4807 * @property {WEBGL_draw_buffers} drawBuffers - WebGL v1 extension
4808 * @property {WEBGL_depth_texture} depthTexture - WebGL v1 extension
4809 * @property {OES_texture_float} floatTexture - WebGL v1 extension
4810 * @property {WEBGL_lose_context} loseContext - WebGL v1 extension
4811 * @property {OES_vertex_array_object} vertexArrayObject - WebGL v1 extension
4812 * @property {EXT_texture_filter_anisotropic} anisotropicFiltering - WebGL v1 and v2 extension
4813 */
4814 readonly extensions: {
4815 drawBuffers: WEBGL_draw_buffers;
4816 depthTexture: WEBGL_depth_texture;
4817 floatTexture: OES_texture_float;
4818 loseContext: WEBGL_lose_context;
4819 vertexArrayObject: OES_vertex_array_object;
4820 anisotropicFiltering: EXT_texture_filter_anisotropic;
4821 };
4822 /**
4823 * `true` if the context is lost
4824 * @member {boolean}
4825 * @readonly
4826 */
4827 readonly isLost: boolean;
4828 /**
4829 * Handle the context change event
4830 * @param {WebGLRenderingContext} gl - new webgl context
4831 */
4832 contextChange(gl: WebGLRenderingContext): void;
4833 /**
4834 * Initialize the context
4835 *
4836 * @protected
4837 * @param {WebGLRenderingContext} gl - WebGL context
4838 */
4839 protected initFromContext(gl: WebGLRenderingContext): void;
4840 /**
4841 * Initialize from context options
4842 *
4843 * @protected
4844 * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
4845 * @param {object} options - context attributes
4846 */
4847 protected initFromOptions(options: any): void;
4848 /**
4849 * Helper class to create a WebGL Context
4850 *
4851 * @param canvas {HTMLCanvasElement} the canvas element that we will get the context from
4852 * @param options {object} An options object that gets passed in to the canvas element containing the context attributes
4853 * @see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext
4854 * @return {WebGLRenderingContext} the WebGL context
4855 */
4856 createContext(canvas: HTMLCanvasElement, options: any): WebGLRenderingContext;
4857 /**
4858 * Auto-populate the extensions
4859 *
4860 * @protected
4861 */
4862 protected getExtensions(): void;
4863 /**
4864 * Handles a lost webgl context
4865 *
4866 * @protected
4867 * @param {WebGLContextEvent} event - The context lost event.
4868 */
4869 protected handleContextLost(event: WebGLContextEvent): void;
4870 /**
4871 * Handles a restored webgl context
4872 *
4873 * @protected
4874 */
4875 protected handleContextRestored(): void;
4876 /**
4877 * Handle the post-render runner event
4878 *
4879 * @protected
4880 */
4881 protected postrender(): void;
4882 /**
4883 * Validate context
4884 *
4885 * @protected
4886 * @param {WebGLRenderingContext} gl - Render context
4887 */
4888 protected validateContext(gl: WebGLRenderingContext): void;
4889 /**
4890 * The renderer this manager works for.
4891 *
4892 * @member {PIXI.Renderer} PIXI.System#renderer
4893 */
4894 renderer: PIXI.Renderer;
4895 /**
4896 * Generic destroy methods to be overridden by the subclass
4897 */
4898 destroy(): void;
4899 }
4900 /**
4901 * System plugin to the renderer to manage the filters.
4902 *
4903 * @class
4904 * @memberof PIXI.systems
4905 * @extends PIXI.System
4906 */
4907 class FilterSystem extends PIXI.System {
4908 constructor(renderer: PIXI.Renderer);
4909 /**
4910 * List of filters for the FilterSystem
4911 * @member {Object[]} PIXI.systems.FilterSystem#defaultFilterStack
4912 * @readonly
4913 */
4914 readonly defaultFilterStack: any[];
4915 /**
4916 * stores a bunch of PO2 textures used for filtering
4917 * @member {Object} PIXI.systems.FilterSystem#texturePool
4918 */
4919 texturePool: any;
4920 /**
4921 * a pool for storing filter states, save us creating new ones each tick
4922 * @member {Object[]} PIXI.systems.FilterSystem#statePool
4923 */
4924 statePool: any[];
4925 /**
4926 * A very simple geometry used when drawing a filter effect to the screen
4927 * @member {PIXI.Quad} PIXI.systems.FilterSystem#quad
4928 */
4929 quad: PIXI.Quad;
4930 /**
4931 * Quad UVs
4932 * @member {PIXI.QuadUv} PIXI.systems.FilterSystem#quadUv
4933 */
4934 quadUv: PIXI.QuadUv;
4935 /**
4936 * Temporary rect for maths
4937 * @type {PIXI.Rectangle}
4938 */
4939 tempRect: PIXI.Rectangle;
4940 /**
4941 * Active state
4942 * @member {object} PIXI.systems.FilterSystem#activeState
4943 */
4944 activeState: any;
4945 /**
4946 * This uniform group is attached to filter uniforms when used
4947 * @member {PIXI.UniformGroup} PIXI.systems.FilterSystem#globalUniforms
4948 * @property {PIXI.Rectangle} outputFrame
4949 * @property {Float32Array} inputSize
4950 * @property {Float32Array} inputPixel
4951 * @property {Float32Array} inputClamp
4952 * @property {Number} resolution
4953 * @property {Float32Array} filterArea
4954 * @property {Fload32Array} filterClamp
4955 */
4956 globalUniforms: PIXI.UniformGroup;
4957 /**
4958 * Whether to clear output renderTexture in AUTO/BLIT mode. See {@link PIXI.CLEAR_MODES}
4959 * @member {boolean} PIXI.systems.FilterSystem#forceClear
4960 */
4961 forceClear: boolean;
4962 /**
4963 * Old padding behavior is to use the max amount instead of sum padding.
4964 * Use this flag if you need the old behavior.
4965 * @member {boolean} PIXI.systems.FilterSystem#useMaxPadding
4966 * @default false
4967 */
4968 useMaxPadding: boolean;
4969 /**
4970 * Adds a new filter to the System.
4971 *
4972 * @param {PIXI.DisplayObject} target - The target of the filter to render.
4973 * @param {PIXI.Filter[]} filters - The filters to apply.
4974 */
4975 push(target: PIXI.DisplayObject, filters: PIXI.Filter[]): void;
4976 /**
4977 * Pops off the filter and applies it.
4978 *
4979 */
4980 pop(): void;
4981 /**
4982 * Binds a renderTexture with corresponding `filterFrame`, clears it if mode corresponds.
4983 * @param {PIXI.RenderTexture} filterTexture - renderTexture to bind, should belong to filter pool or filter stack
4984 * @param {PIXI.CLEAR_MODES} [clearMode] - clearMode, by default its CLEAR/YES. See {@link PIXI.CLEAR_MODES}
4985 */
4986 bindAndClear(filterTexture: PIXI.RenderTexture, clearMode?: PIXI.CLEAR_MODES): void;
4987 /**
4988 * Draws a filter.
4989 *
4990 * @param {PIXI.Filter} filter - The filter to draw.
4991 * @param {PIXI.RenderTexture} input - The input render target.
4992 * @param {PIXI.RenderTexture} output - The target to output to.
4993 * @param {PIXI.CLEAR_MODES} [clearMode] - Should the output be cleared before rendering to it
4994 */
4995 applyFilter(filter: PIXI.Filter, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clearMode?: PIXI.CLEAR_MODES): void;
4996 /**
4997 * Multiply _input normalized coordinates_ to this matrix to get _sprite texture normalized coordinates_.
4998 *
4999 * Use `outputMatrix * vTextureCoord` in the shader.
5000 *
5001 * @param {PIXI.Matrix} outputMatrix - The matrix to output to.
5002 * @param {PIXI.Sprite} sprite - The sprite to map to.
5003 * @return {PIXI.Matrix} The mapped matrix.
5004 */
5005 calculateSpriteMatrix(outputMatrix: PIXI.Matrix, sprite: PIXI.Sprite): PIXI.Matrix;
5006 /**
5007 * Destroys this Filter System.
5008 */
5009 destroy(): void;
5010 /**
5011 * Gets a Power-of-Two render texture or fullScreen texture
5012 *
5013 * @protected
5014 * @param {number} minWidth - The minimum width of the render texture in real pixels.
5015 * @param {number} minHeight - The minimum height of the render texture in real pixels.
5016 * @param {number} [resolution=1] - The resolution of the render texture.
5017 * @return {PIXI.RenderTexture} The new render texture.
5018 */
5019 protected getOptimalFilterTexture(minWidth: number, minHeight: number, resolution?: number): PIXI.RenderTexture;
5020 /**
5021 * Gets extra render texture to use inside current filter
5022 * To be compliant with older filters, you can use params in any order
5023 *
5024 * @param {PIXI.RenderTexture} [input] - renderTexture from which size and resolution will be copied
5025 * @param {number} [resolution] - override resolution of the renderTexture
5026 * @returns {PIXI.RenderTexture}
5027 */
5028 getFilterTexture(input?: PIXI.RenderTexture, resolution?: number): PIXI.RenderTexture;
5029 /**
5030 * Frees a render texture back into the pool.
5031 *
5032 * @param {PIXI.RenderTexture} renderTexture - The renderTarget to free
5033 */
5034 returnFilterTexture(renderTexture: PIXI.RenderTexture): void;
5035 /**
5036 * Empties the texture pool.
5037 */
5038 emptyPool(): void;
5039 /**
5040 * calls `texturePool.resize()`, affects fullScreen renderTextures
5041 */
5042 resize(): void;
5043 /**
5044 * The renderer this manager works for.
5045 *
5046 * @member {PIXI.Renderer} PIXI.System#renderer
5047 */
5048 renderer: PIXI.Renderer;
5049 }
5050 /**
5051 * System plugin to the renderer to manage framebuffers.
5052 *
5053 * @class
5054 * @extends PIXI.System
5055 * @memberof PIXI.systems
5056 */
5057 class FramebufferSystem extends PIXI.System {
5058 constructor(renderer: PIXI.Renderer);
5059 /**
5060 * A list of managed framebuffers
5061 * @member {PIXI.Framebuffer[]} PIXI.systems.FramebufferSystem#managedFramebuffers
5062 * @readonly
5063 */
5064 readonly managedFramebuffers: PIXI.Framebuffer[];
5065 /**
5066 * Framebuffer value that shows that we don't know what is bound
5067 * @member {Framebuffer} PIXI.systems.FramebufferSystem#unknownFramebuffer
5068 * @readonly
5069 */
5070 readonly unknownFramebuffer: Framebuffer;
5071 /**
5072 * Sets up the renderer context and necessary buffers.
5073 */
5074 contextChange(): void;
5075 /**
5076 * Bind a framebuffer
5077 *
5078 * @param {PIXI.Framebuffer} framebuffer
5079 * @param {PIXI.Rectangle} [frame] frame, default is framebuffer size
5080 */
5081 bind(framebuffer: PIXI.Framebuffer, frame?: PIXI.Rectangle): void;
5082 /**
5083 * Set the WebGLRenderingContext's viewport.
5084 *
5085 * @param {Number} x - X position of viewport
5086 * @param {Number} y - Y position of viewport
5087 * @param {Number} width - Width of viewport
5088 * @param {Number} height - Height of viewport
5089 */
5090 setViewport(x: number, y: number, width: number, height: number): void;
5091 /**
5092 * Get the size of the current width and height. Returns object with `width` and `height` values.
5093 *
5094 * @member {object}
5095 * @readonly
5096 */
5097 readonly size: any;
5098 /**
5099 * Clear the color of the context
5100 *
5101 * @param {Number} r - Red value from 0 to 1
5102 * @param {Number} g - Green value from 0 to 1
5103 * @param {Number} b - Blue value from 0 to 1
5104 * @param {Number} a - Alpha value from 0 to 1
5105 * @param {PIXI.BUFFER_BITS} [mask=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH] - Bitwise OR of masks
5106 * that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.
5107 */
5108 clear(r: number, g: number, b: number, a: number, mask?: PIXI.BUFFER_BITS): void;
5109 /**
5110 * Initialize framebuffer for this context
5111 *
5112 * @protected
5113 * @param {PIXI.Framebuffer} framebuffer
5114 * @returns {PIXI.GLFramebuffer} created GLFramebuffer
5115 */
5116 protected initFramebuffer(framebuffer: PIXI.Framebuffer): PIXI.GLFramebuffer;
5117 /**
5118 * Resize the framebuffer
5119 *
5120 * @protected
5121 * @param {PIXI.Framebuffer} framebuffer
5122 */
5123 protected resizeFramebuffer(framebuffer: PIXI.Framebuffer): void;
5124 /**
5125 * Update the framebuffer
5126 *
5127 * @protected
5128 * @param {PIXI.Framebuffer} framebuffer
5129 */
5130 protected updateFramebuffer(framebuffer: PIXI.Framebuffer): void;
5131 /**
5132 * Detects number of samples that is not more than a param but as close to it as possible
5133 *
5134 * @param {PIXI.MSAA_QUALITY} samples - number of samples
5135 * @returns {PIXI.MSAA_QUALITY} - recommended number of samples
5136 */
5137 detectSamples(samples: PIXI.MSAA_QUALITY): PIXI.MSAA_QUALITY;
5138 /**
5139 * Only works with WebGL2
5140 *
5141 * blits framebuffer to another of the same or bigger size
5142 * after that target framebuffer is bound
5143 *
5144 * Fails with WebGL warning if blits multisample framebuffer to different size
5145 *
5146 * @param {PIXI.Framebuffer} [framebuffer] - by default it blits "into itself", from renderBuffer to texture.
5147 * @param {PIXI.Rectangle} [sourcePixels] - source rectangle in pixels
5148 * @param {PIXI.Rectangle} [destPixels] - dest rectangle in pixels, assumed to be the same as sourcePixels
5149 */
5150 blit(framebuffer?: PIXI.Framebuffer, sourcePixels?: PIXI.Rectangle, destPixels?: PIXI.Rectangle): void;
5151 /**
5152 * Disposes framebuffer
5153 * @param {PIXI.Framebuffer} framebuffer - framebuffer that has to be disposed of
5154 * @param {boolean} [contextLost=false] - If context was lost, we suppress all delete function calls
5155 */
5156 disposeFramebuffer(framebuffer: PIXI.Framebuffer, contextLost?: boolean): void;
5157 /**
5158 * Disposes all framebuffers, but not textures bound to them
5159 * @param {boolean} [contextLost=false] - If context was lost, we suppress all delete function calls
5160 */
5161 disposeAll(contextLost?: boolean): void;
5162 /**
5163 * resets framebuffer stored state, binds screen framebuffer
5164 *
5165 * should be called before renderTexture reset()
5166 */
5167 reset(): void;
5168 /**
5169 * The renderer this manager works for.
5170 *
5171 * @member {PIXI.Renderer} PIXI.System#renderer
5172 */
5173 renderer: PIXI.Renderer;
5174 /**
5175 * Generic destroy methods to be overridden by the subclass
5176 */
5177 destroy(): void;
5178 }
5179 /**
5180 * System plugin to the renderer to manage geometry.
5181 *
5182 * @class
5183 * @extends PIXI.System
5184 * @memberof PIXI.systems
5185 */
5186 class GeometrySystem extends PIXI.System {
5187 constructor(renderer: PIXI.Renderer);
5188 /**
5189 * `true` if we has `*_vertex_array_object` extension
5190 * @member {boolean} PIXI.systems.GeometrySystem#hasVao
5191 * @readonly
5192 */
5193 readonly hasVao: boolean;
5194 /**
5195 * `true` if has `ANGLE_instanced_arrays` extension
5196 * @member {boolean} PIXI.systems.GeometrySystem#hasInstance
5197 * @readonly
5198 */
5199 readonly hasInstance: boolean;
5200 /**
5201 * `true` if support `gl.UNSIGNED_INT` in `gl.drawElements` or `gl.drawElementsInstanced`
5202 * @member {boolean} PIXI.systems.GeometrySystem#canUseUInt32ElementIndex
5203 * @readonly
5204 */
5205 readonly canUseUInt32ElementIndex: boolean;
5206 /**
5207 * Cache for all geometries by id, used in case renderer gets destroyed or for profiling
5208 * @member {object} PIXI.systems.GeometrySystem#managedGeometries
5209 * @readonly
5210 */
5211 readonly managedGeometries: any;
5212 /**
5213 * Cache for all buffers by id, used in case renderer gets destroyed or for profiling
5214 * @member {object} PIXI.systems.GeometrySystem#managedBuffers
5215 * @readonly
5216 */
5217 readonly managedBuffers: any;
5218 /**
5219 * Sets up the renderer context and necessary buffers.
5220 */
5221 contextChange(): void;
5222 /**
5223 * Binds geometry so that is can be drawn. Creating a Vao if required
5224 *
5225 * @param {PIXI.Geometry} geometry - instance of geometry to bind
5226 * @param {PIXI.Shader} [shader] - instance of shader to use vao for
5227 */
5228 bind(geometry: PIXI.Geometry, shader?: PIXI.Shader): void;
5229 /**
5230 * Reset and unbind any active VAO and geometry
5231 */
5232 reset(): void;
5233 /**
5234 * Update buffers
5235 * @protected
5236 */
5237 protected updateBuffers(): void;
5238 /**
5239 * Check compability between a geometry and a program
5240 * @protected
5241 * @param {PIXI.Geometry} geometry - Geometry instance
5242 * @param {PIXI.Program} program - Program instance
5243 */
5244 protected checkCompatibility(geometry: PIXI.Geometry, program: PIXI.Program): void;
5245 /**
5246 * Takes a geometry and program and generates a unique signature for them.
5247 *
5248 * @param {PIXI.Geometry} geometry - to get signature from
5249 * @param {PIXI.Program} program - to test geometry against
5250 * @returns {String} Unique signature of the geometry and program
5251 * @protected
5252 */
5253 protected getSignature(geometry: PIXI.Geometry, program: PIXI.Program): string;
5254 /**
5255 * Creates or gets Vao with the same structure as the geometry and stores it on the geometry.
5256 * If vao is created, it is bound automatically.
5257 *
5258 * @protected
5259 * @param {PIXI.Geometry} geometry - Instance of geometry to to generate Vao for
5260 * @param {PIXI.Program} program - Instance of program
5261 * @param {boolean} [incRefCount=false] - Increment refCount of all geometry buffers
5262 */
5263 protected initGeometryVao(geometry: PIXI.Geometry, program: PIXI.Program, incRefCount?: boolean): void;
5264 /**
5265 * Disposes buffer
5266 * @param {PIXI.Buffer} buffer - buffer with data
5267 * @param {boolean} [contextLost=false] - If context was lost, we suppress deleteVertexArray
5268 */
5269 disposeBuffer(buffer: PIXI.Buffer, contextLost?: boolean): void;
5270 /**
5271 * Disposes geometry
5272 * @param {PIXI.Geometry} geometry - Geometry with buffers. Only VAO will be disposed
5273 * @param {boolean} [contextLost=false] - If context was lost, we suppress deleteVertexArray
5274 */
5275 disposeGeometry(geometry: PIXI.Geometry, contextLost?: boolean): void;
5276 /**
5277 * dispose all WebGL resources of all managed geometries and buffers
5278 * @param {boolean} [contextLost=false] - If context was lost, we suppress `gl.delete` calls
5279 */
5280 disposeAll(contextLost?: boolean): void;
5281 /**
5282 * Activate vertex array object
5283 *
5284 * @protected
5285 * @param {PIXI.Geometry} geometry - Geometry instance
5286 * @param {PIXI.Program} program - Shader program instance
5287 */
5288 protected activateVao(geometry: PIXI.Geometry, program: PIXI.Program): void;
5289 /**
5290 * Draw the geometry
5291 *
5292 * @param {Number} type - the type primitive to render
5293 * @param {Number} [size] - the number of elements to be rendered
5294 * @param {Number} [start] - Starting index
5295 * @param {Number} [instanceCount] - the number of instances of the set of elements to execute
5296 */
5297 draw(type: number, size?: number, start?: number, instanceCount?: number): void;
5298 /**
5299 * Unbind/reset everything
5300 * @protected
5301 */
5302 protected unbind(): void;
5303 /**
5304 * The renderer this manager works for.
5305 *
5306 * @member {PIXI.Renderer} PIXI.System#renderer
5307 */
5308 renderer: PIXI.Renderer;
5309 /**
5310 * Generic destroy methods to be overridden by the subclass
5311 */
5312 destroy(): void;
5313 }
5314 /**
5315 * System plugin to the renderer to manage masks of certain type
5316 *
5317 * @class
5318 * @extends PIXI.System
5319 * @memberof PIXI.systems
5320 */
5321 class AbstractMaskSystem extends PIXI.System {
5322 constructor(renderer: PIXI.Renderer);
5323 /**
5324 * The mask stack
5325 * @member {PIXI.MaskData[]} PIXI.systems.AbstractMaskSystem#maskStack
5326 */
5327 maskStack: PIXI.MaskData[];
5328 /**
5329 * gets count of masks of certain type
5330 * @returns {number}
5331 */
5332 getStackLength(): number;
5333 /**
5334 * Changes the mask stack that is used by this System.
5335 *
5336 * @param {PIXI.MaskData[]} maskStack - The mask stack
5337 */
5338 setMaskStack(maskStack: PIXI.MaskData[]): void;
5339 /**
5340 * Destroys the mask stack.
5341 *
5342 */
5343 destroy(): void;
5344 /**
5345 * The renderer this manager works for.
5346 *
5347 * @member {PIXI.Renderer} PIXI.System#renderer
5348 */
5349 renderer: PIXI.Renderer;
5350 }
5351 /**
5352 * System plugin to the renderer to manage masks.
5353 *
5354 * @class
5355 * @extends PIXI.System
5356 * @memberof PIXI.systems
5357 */
5358 class MaskSystem extends PIXI.System {
5359 constructor(renderer: PIXI.Renderer);
5360 /**
5361 * Enable scissor
5362 * @member {boolean} PIXI.systems.MaskSystem#enableScissor
5363 * @readonly
5364 */
5365 readonly enableScissor: boolean;
5366 /**
5367 * Pool of used sprite mask filters
5368 * @member {PIXI.SpriteMaskFilter[]} PIXI.systems.MaskSystem#alphaMaskPool
5369 * @readonly
5370 */
5371 readonly alphaMaskPool: PIXI.SpriteMaskFilter[];
5372 /**
5373 * Pool of mask data
5374 * @member {PIXI.MaskData[]} PIXI.systems.MaskSystem#maskDataPool
5375 * @readonly
5376 */
5377 readonly maskDataPool: PIXI.MaskData[];
5378 /**
5379 * Current index of alpha mask pool
5380 * @member {number} PIXI.systems.MaskSystem#alphaMaskIndex
5381 * @default 0
5382 * @readonly
5383 */
5384 readonly alphaMaskIndex: number;
5385 /**
5386 * Changes the mask stack that is used by this System.
5387 *
5388 * @param {PIXI.MaskData[]} maskStack - The mask stack
5389 */
5390 setMaskStack(maskStack: PIXI.MaskData[]): void;
5391 /**
5392 * Applies the Mask and adds it to the current filter stack.
5393 * Renderer batch must be flushed beforehand.
5394 *
5395 * @param {PIXI.DisplayObject} target - Display Object to push the mask to
5396 * @param {PIXI.MaskData|PIXI.Sprite|PIXI.Graphics|PIXI.DisplayObject} maskData - The masking data.
5397 */
5398 push(target: PIXI.DisplayObject, maskData: PIXI.MaskData | PIXI.Sprite | PIXI.Graphics | PIXI.DisplayObject): void;
5399 /**
5400 * Removes the last mask from the mask stack and doesn't return it.
5401 * Renderer batch must be flushed beforehand.
5402 *
5403 * @param {PIXI.DisplayObject} target - Display Object to pop the mask from
5404 */
5405 pop(target: PIXI.DisplayObject): void;
5406 /**
5407 * Sets type of MaskData based on its maskObject
5408 * @param {PIXI.MaskData} maskData
5409 */
5410 detect(maskData: PIXI.MaskData): void;
5411 /**
5412 * Applies the Mask and adds it to the current filter stack.
5413 *
5414 * @param {PIXI.MaskData} maskData - Sprite to be used as the mask
5415 */
5416 pushSpriteMask(maskData: PIXI.MaskData): void;
5417 /**
5418 * Removes the last filter from the filter stack and doesn't return it.
5419 */
5420 popSpriteMask(): void;
5421 /**
5422 * The renderer this manager works for.
5423 *
5424 * @member {PIXI.Renderer} PIXI.System#renderer
5425 */
5426 renderer: PIXI.Renderer;
5427 /**
5428 * Generic destroy methods to be overridden by the subclass
5429 */
5430 destroy(): void;
5431 }
5432 /**
5433 * System plugin to the renderer to manage scissor rects (used for masks).
5434 *
5435 * @class
5436 * @extends PIXI.System
5437 * @memberof PIXI.systems
5438 */
5439 class ScissorSystem extends PIXI.System {
5440 constructor(renderer: PIXI.Renderer);
5441 /**
5442 * Applies the Mask and adds it to the current stencil stack. @alvin
5443 *
5444 * @param {PIXI.MaskData} maskData - The mask data
5445 */
5446 push(maskData: PIXI.MaskData): void;
5447 /**
5448 * Pops scissor mask. MaskData is already removed from stack
5449 */
5450 pop(): void;
5451 /**
5452 * The renderer this manager works for.
5453 *
5454 * @member {PIXI.Renderer} PIXI.System#renderer
5455 */
5456 renderer: PIXI.Renderer;
5457 /**
5458 * Generic destroy methods to be overridden by the subclass
5459 */
5460 destroy(): void;
5461 }
5462 /**
5463 * System plugin to the renderer to manage stencils (used for masks).
5464 *
5465 * @class
5466 * @extends PIXI.System
5467 * @memberof PIXI.systems
5468 */
5469 class StencilSystem extends PIXI.System {
5470 constructor(renderer: PIXI.Renderer);
5471 /**
5472 * Applies the Mask and adds it to the current stencil stack.
5473 *
5474 * @param {PIXI.MaskData} maskData - The mask data
5475 */
5476 push(maskData: PIXI.MaskData): void;
5477 /**
5478 * Pops stencil mask. MaskData is already removed from stack
5479 *
5480 * @param {PIXI.DisplayObject} maskObject - object of popped mask data
5481 */
5482 pop(maskObject: PIXI.DisplayObject): void;
5483 /**
5484 * The renderer this manager works for.
5485 *
5486 * @member {PIXI.Renderer} PIXI.System#renderer
5487 */
5488 renderer: PIXI.Renderer;
5489 /**
5490 * Generic destroy methods to be overridden by the subclass
5491 */
5492 destroy(): void;
5493 }
5494 /**
5495 * System plugin to the renderer to manage the projection matrix.
5496 *
5497 * @class
5498 * @extends PIXI.System
5499 * @memberof PIXI.systems
5500 */
5501 class ProjectionSystem extends PIXI.System {
5502 constructor(renderer: PIXI.Renderer);
5503 /**
5504 * Destination frame
5505 * @member {PIXI.Rectangle} PIXI.systems.ProjectionSystem#destinationFrame
5506 * @readonly
5507 */
5508 readonly destinationFrame: PIXI.Rectangle;
5509 /**
5510 * Source frame
5511 * @member {PIXI.Rectangle} PIXI.systems.ProjectionSystem#sourceFrame
5512 * @readonly
5513 */
5514 readonly sourceFrame: PIXI.Rectangle;
5515 /**
5516 * Default destination frame
5517 * @member {PIXI.Rectangle} PIXI.systems.ProjectionSystem#defaultFrame
5518 * @readonly
5519 */
5520 readonly defaultFrame: PIXI.Rectangle;
5521 /**
5522 * Project matrix
5523 * @member {PIXI.Matrix} PIXI.systems.ProjectionSystem#projectionMatrix
5524 * @readonly
5525 */
5526 readonly projectionMatrix: PIXI.Matrix;
5527 /**
5528 * A transform that will be appended to the projection matrix
5529 * if null, nothing will be applied
5530 * @member {PIXI.Matrix} PIXI.systems.ProjectionSystem#transform
5531 */
5532 transform: PIXI.Matrix;
5533 /**
5534 * Updates the projection matrix based on a projection frame (which is a rectangle).
5535 *
5536 * Make sure to run `renderer.framebuffer.setViewport(destinationFrame)` after calling this.
5537 *
5538 * @param {PIXI.Rectangle} destinationFrame - The destination frame.
5539 * @param {PIXI.Rectangle} sourceFrame - The source frame.
5540 * @param {Number} resolution - Resolution
5541 * @param {boolean} root - If is root
5542 */
5543 update(destinationFrame: PIXI.Rectangle, sourceFrame: PIXI.Rectangle, resolution: number, root: boolean): void;
5544 /**
5545 * Updates the projection matrix based on a projection frame (which is a rectangle)
5546 *
5547 * @param {PIXI.Rectangle} destinationFrame - The destination frame.
5548 * @param {PIXI.Rectangle} sourceFrame - The source frame.
5549 * @param {Number} resolution - Resolution
5550 * @param {boolean} root - If is root
5551 */
5552 calculateProjection(destinationFrame: PIXI.Rectangle, sourceFrame: PIXI.Rectangle, resolution: number, root: boolean): void;
5553 /**
5554 * Sets the transform of the active render target to the given matrix
5555 *
5556 * @param {PIXI.Matrix} matrix - The transformation matrix
5557 */
5558 setTransform(matrix: PIXI.Matrix): void;
5559 /**
5560 * The renderer this manager works for.
5561 *
5562 * @member {PIXI.Renderer} PIXI.System#renderer
5563 */
5564 renderer: PIXI.Renderer;
5565 /**
5566 * Generic destroy methods to be overridden by the subclass
5567 */
5568 destroy(): void;
5569 }
5570 /**
5571 * System plugin to the renderer to manage render textures.
5572 *
5573 * Should be added after FramebufferSystem
5574 *
5575 * @class
5576 * @extends PIXI.System
5577 * @memberof PIXI.systems
5578 */
5579 class RenderTextureSystem extends PIXI.System {
5580 constructor(renderer: PIXI.Renderer);
5581 /**
5582 * The clear background color as rgba
5583 * @member {number[]} PIXI.systems.RenderTextureSystem#clearColor
5584 */
5585 clearColor: number[];
5586 /**
5587 * List of masks for the StencilSystem
5588 * @member {PIXI.Graphics[]} PIXI.systems.RenderTextureSystem#defaultMaskStack
5589 * @readonly
5590 */
5591 readonly defaultMaskStack: PIXI.Graphics[];
5592 /**
5593 * Render texture
5594 * @member {PIXI.RenderTexture} PIXI.systems.RenderTextureSystem#current
5595 * @readonly
5596 */
5597 readonly current: PIXI.RenderTexture;
5598 /**
5599 * Source frame
5600 * @member {PIXI.Rectangle} PIXI.systems.RenderTextureSystem#sourceFrame
5601 * @readonly
5602 */
5603 readonly sourceFrame: PIXI.Rectangle;
5604 /**
5605 * Destination frame
5606 * @member {PIXI.Rectangle} PIXI.systems.RenderTextureSystem#destinationFrame
5607 * @readonly
5608 */
5609 readonly destinationFrame: PIXI.Rectangle;
5610 /**
5611 * Bind the current render texture
5612 *
5613 * @param {PIXI.RenderTexture} [renderTexture] - RenderTexture to bind, by default its `null`, the screen
5614 * @param {PIXI.Rectangle} [sourceFrame] - part of screen that is mapped to the renderTexture
5615 * @param {PIXI.Rectangle} [destinationFrame] - part of renderTexture, by default it has the same size as sourceFrame
5616 */
5617 bind(renderTexture?: PIXI.RenderTexture, sourceFrame?: PIXI.Rectangle, destinationFrame?: PIXI.Rectangle): void;
5618 /**
5619 * Erases the render texture and fills the drawing area with a colour
5620 *
5621 * @param {number[]} [clearColor] - The color as rgba, default to use the renderer backgroundColor
5622 * @param {PIXI.BUFFER_BITS} [mask=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH] - Bitwise OR of masks
5623 * that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.
5624 * @return {PIXI.Renderer} Returns itself.
5625 */
5626 clear(clearColor?: number[], mask?: PIXI.BUFFER_BITS): PIXI.Renderer;
5627 /**
5628 * Resets renderTexture state
5629 */
5630 reset(): void;
5631 /**
5632 * The renderer this manager works for.
5633 *
5634 * @member {PIXI.Renderer} PIXI.System#renderer
5635 */
5636 renderer: PIXI.Renderer;
5637 /**
5638 * Generic destroy methods to be overridden by the subclass
5639 */
5640 destroy(): void;
5641 }
5642 /**
5643 * System plugin to the renderer to manage shaders.
5644 *
5645 * @class
5646 * @memberof PIXI.systems
5647 * @extends PIXI.System
5648 */
5649 class ShaderSystem extends PIXI.System {
5650 constructor(renderer: PIXI.Renderer);
5651 /**
5652 * The current WebGL rendering context
5653 *
5654 * @member {WebGLRenderingContext} PIXI.systems.ShaderSystem#gl
5655 */
5656 gl: WebGLRenderingContext;
5657 /**
5658 * Changes the current shader to the one given in parameter
5659 *
5660 * @param {PIXI.Shader} shader - the new shader
5661 * @param {boolean} [dontSync] - false if the shader should automatically sync its uniforms.
5662 * @returns {PIXI.GLProgram} the glProgram that belongs to the shader.
5663 */
5664 bind(shader: PIXI.Shader, dontSync?: boolean): PIXI.GLProgram;
5665 /**
5666 * Uploads the uniforms values to the currently bound shader.
5667 *
5668 * @param {object} uniforms - the uniforms values that be applied to the current shader
5669 */
5670 setUniforms(uniforms: any): void;
5671 /**
5672 *
5673 * syncs uniforms on the group
5674 * @param {*} group - the uniform group to sync
5675 * @param {*} [syncData] - this is data that is passed to the sync function and any nested sync functions
5676 */
5677 syncUniformGroup(group: any, syncData?: any): void;
5678 /**
5679 * Returns the underlying GLShade rof the currently bound shader.
5680 * This can be handy for when you to have a little more control over the setting of your uniforms.
5681 *
5682 * @return {PIXI.GLProgram} the glProgram for the currently bound Shader for this context
5683 */
5684 getglProgram(): PIXI.GLProgram;
5685 /**
5686 * Resets ShaderSystem state, does not affect WebGL state
5687 */
5688 reset(): void;
5689 /**
5690 * Destroys this System and removes all its textures
5691 */
5692 destroy(): void;
5693 /**
5694 * The renderer this manager works for.
5695 *
5696 * @member {PIXI.Renderer} PIXI.System#renderer
5697 */
5698 renderer: PIXI.Renderer;
5699 }
5700 /**
5701 * System plugin to the renderer to manage WebGL state machines.
5702 *
5703 * @class
5704 * @extends PIXI.System
5705 * @memberof PIXI.systems
5706 */
5707 class StateSystem extends PIXI.System {
5708 constructor(renderer: PIXI.Renderer);
5709 /**
5710 * GL context
5711 * @member {WebGLRenderingContext} PIXI.systems.StateSystem#gl
5712 * @readonly
5713 */
5714 readonly gl: WebGLRenderingContext;
5715 /**
5716 * State ID
5717 * @member {number} PIXI.systems.StateSystem#stateId
5718 * @readonly
5719 */
5720 readonly stateId: number;
5721 /**
5722 * Polygon offset
5723 * @member {number} PIXI.systems.StateSystem#polygonOffset
5724 * @readonly
5725 */
5726 readonly polygonOffset: number;
5727 /**
5728 * Blend mode
5729 * @member {number} PIXI.systems.StateSystem#blendMode
5730 * @default PIXI.BLEND_MODES.NONE
5731 * @readonly
5732 */
5733 readonly blendMode: number;
5734 /**
5735 * Whether current blend equation is different
5736 * @member {boolean} PIXI.systems.StateSystem#_blendEq
5737 * @protected
5738 */
5739 protected _blendEq: boolean;
5740 /**
5741 * Collection of calls
5742 * @member {function[]} PIXI.systems.StateSystem#map
5743 * @readonly
5744 */
5745 readonly map: ((...params: any[]) => any)[];
5746 /**
5747 * Collection of check calls
5748 * @member {function[]} PIXI.systems.StateSystem#checks
5749 * @readonly
5750 */
5751 readonly checks: ((...params: any[]) => any)[];
5752 /**
5753 * Default WebGL State
5754 * @member {PIXI.State} PIXI.systems.StateSystem#defaultState
5755 * @readonly
5756 */
5757 readonly defaultState: PIXI.State;
5758 /**
5759 * Sets the current state
5760 *
5761 * @param {*} state - The state to set.
5762 */
5763 set(state: any): void;
5764 /**
5765 * Sets the state, when previous state is unknown
5766 *
5767 * @param {*} state - The state to set
5768 */
5769 forceState(state: any): void;
5770 /**
5771 * Enables or disabled blending.
5772 *
5773 * @param {boolean} value - Turn on or off webgl blending.
5774 */
5775 setBlend(value: boolean): void;
5776 /**
5777 * Enables or disable polygon offset fill
5778 *
5779 * @param {boolean} value - Turn on or off webgl polygon offset testing.
5780 */
5781 setOffset(value: boolean): void;
5782 /**
5783 * Sets whether to enable or disable depth test.
5784 *
5785 * @param {boolean} value - Turn on or off webgl depth testing.
5786 */
5787 setDepthTest(value: boolean): void;
5788 /**
5789 * Sets whether to enable or disable cull face.
5790 *
5791 * @param {boolean} value - Turn on or off webgl cull face.
5792 */
5793 setCullFace(value: boolean): void;
5794 /**
5795 * Sets the gl front face.
5796 *
5797 * @param {boolean} value - true is clockwise and false is counter-clockwise
5798 */
5799 setFrontFace(value: boolean): void;
5800 /**
5801 * Sets the blend mode.
5802 *
5803 * @param {number} value - The blend mode to set to.
5804 */
5805 setBlendMode(value: number): void;
5806 /**
5807 * Sets the polygon offset.
5808 *
5809 * @param {number} value - the polygon offset
5810 * @param {number} scale - the polygon offset scale
5811 */
5812 setPolygonOffset(value: number, scale: number): void;
5813 /**
5814 * Resets all the logic and disables the vaos
5815 */
5816 reset(): void;
5817 /**
5818 * checks to see which updates should be checked based on which settings have been activated.
5819 * For example, if blend is enabled then we should check the blend modes each time the state is changed
5820 * or if polygon fill is activated then we need to check if the polygon offset changes.
5821 * The idea is that we only check what we have too.
5822 *
5823 * @param {Function} func - the checking function to add or remove
5824 * @param {boolean} value - should the check function be added or removed.
5825 */
5826 updateCheck(func: (...params: any[]) => any, value: boolean): void;
5827 /**
5828 * The renderer this manager works for.
5829 *
5830 * @member {PIXI.Renderer} PIXI.System#renderer
5831 */
5832 renderer: PIXI.Renderer;
5833 /**
5834 * Generic destroy methods to be overridden by the subclass
5835 */
5836 destroy(): void;
5837 }
5838 /**
5839 * System plugin to the renderer to manage texture garbage collection on the GPU,
5840 * ensuring that it does not get clogged up with textures that are no longer being used.
5841 *
5842 * @class
5843 * @memberof PIXI.systems
5844 * @extends PIXI.System
5845 */
5846 class TextureGCSystem extends PIXI.System {
5847 constructor(renderer: PIXI.Renderer);
5848 /**
5849 * Count
5850 * @member {number} PIXI.systems.TextureGCSystem#count
5851 * @readonly
5852 */
5853 readonly count: number;
5854 /**
5855 * Check count
5856 * @member {number} PIXI.systems.TextureGCSystem#checkCount
5857 * @readonly
5858 */
5859 readonly checkCount: number;
5860 /**
5861 * Maximum idle time, in seconds
5862 * @member {number} PIXI.systems.TextureGCSystem#maxIdle
5863 * @see PIXI.settings.GC_MAX_IDLE
5864 */
5865 maxIdle: number;
5866 /**
5867 * Maximum number of item to check
5868 * @member {number} PIXI.systems.TextureGCSystem#checkCountMax
5869 * @see PIXI.settings.GC_MAX_CHECK_COUNT
5870 */
5871 checkCountMax: number;
5872 /**
5873 * Current garabage collection mode
5874 * @member {PIXI.GC_MODES} PIXI.systems.TextureGCSystem#mode
5875 * @see PIXI.settings.GC_MODE
5876 */
5877 mode: PIXI.GC_MODES;
5878 /**
5879 * Checks to see when the last time a texture was used
5880 * if the texture has not been used for a specified amount of time it will be removed from the GPU
5881 */
5882 postrender(): void;
5883 /**
5884 * Checks to see when the last time a texture was used
5885 * if the texture has not been used for a specified amount of time it will be removed from the GPU
5886 */
5887 run(): void;
5888 /**
5889 * Removes all the textures within the specified displayObject and its children from the GPU
5890 *
5891 * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.
5892 */
5893 unload(displayObject: PIXI.DisplayObject): void;
5894 /**
5895 * The renderer this manager works for.
5896 *
5897 * @member {PIXI.Renderer} PIXI.System#renderer
5898 */
5899 renderer: PIXI.Renderer;
5900 /**
5901 * Generic destroy methods to be overridden by the subclass
5902 */
5903 destroy(): void;
5904 }
5905 /**
5906 * System plugin to the renderer to manage textures.
5907 *
5908 * @class
5909 * @extends PIXI.System
5910 * @memberof PIXI.systems
5911 */
5912 class TextureSystem extends PIXI.System {
5913 constructor(renderer: PIXI.Renderer);
5914 /**
5915 * Bound textures
5916 * @member {PIXI.BaseTexture[]} PIXI.systems.TextureSystem#boundTextures
5917 * @readonly
5918 */
5919 readonly boundTextures: PIXI.BaseTexture[];
5920 /**
5921 * Current location
5922 * @member {number} PIXI.systems.TextureSystem#currentLocation
5923 * @readonly
5924 */
5925 readonly currentLocation: number;
5926 /**
5927 * List of managed textures
5928 * @member {PIXI.BaseTexture[]} PIXI.systems.TextureSystem#managedTextures
5929 * @readonly
5930 */
5931 readonly managedTextures: PIXI.BaseTexture[];
5932 /**
5933 * BaseTexture value that shows that we don't know what is bound
5934 * @member {PIXI.BaseTexture} PIXI.systems.TextureSystem#unknownTexture
5935 * @readonly
5936 */
5937 readonly unknownTexture: PIXI.BaseTexture;
5938 /**
5939 * Sets up the renderer context and necessary buffers.
5940 */
5941 contextChange(): void;
5942 /**
5943 * Bind a texture to a specific location
5944 *
5945 * If you want to unbind something, please use `unbind(texture)` instead of `bind(null, textureLocation)`
5946 *
5947 * @param {PIXI.Texture|PIXI.BaseTexture} texture_ - Texture to bind
5948 * @param {number} [location=0] - Location to bind at
5949 */
5950 bind(texture_: PIXI.Texture | PIXI.BaseTexture, location?: number): void;
5951 /**
5952 * Resets texture location and bound textures
5953 *
5954 * Actual `bind(null, i)` calls will be performed at next `unbind()` call
5955 */
5956 reset(): void;
5957 /**
5958 * Unbind a texture
5959 * @param {PIXI.BaseTexture} texture - Texture to bind
5960 */
5961 unbind(texture: PIXI.BaseTexture): void;
5962 /**
5963 * The renderer this manager works for.
5964 *
5965 * @member {PIXI.Renderer} PIXI.System#renderer
5966 */
5967 renderer: PIXI.Renderer;
5968 /**
5969 * Generic destroy methods to be overridden by the subclass
5970 */
5971 destroy(): void;
5972 }
5973 }
5974 /**
5975 * A Texture stores the information that represents an image.
5976 * All textures have a base texture, which contains information about the source.
5977 * Therefore you can have many textures all using a single BaseTexture
5978 *
5979 * @class
5980 * @extends PIXI.utils.EventEmitter
5981 * @memberof PIXI
5982 * @param {PIXI.resources.Resource|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} [resource=null]
5983 * The current resource to use, for things that aren't Resource objects, will be converted
5984 * into a Resource.
5985 * @param {Object} [options] - Collection of options
5986 * @param {PIXI.MIPMAP_MODES} [options.mipmap=PIXI.settings.MIPMAP_TEXTURES] - If mipmapping is enabled for texture
5987 * @param {number} [options.anisotropicLevel=PIXI.settings.ANISOTROPIC_LEVEL] - Anisotropic filtering level of texture
5988 * @param {PIXI.WRAP_MODES} [options.wrapMode=PIXI.settings.WRAP_MODE] - Wrap mode for textures
5989 * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.settings.SCALE_MODE] - Default scale mode, linear, nearest
5990 * @param {PIXI.FORMATS} [options.format=PIXI.FORMATS.RGBA] - GL format type
5991 * @param {PIXI.TYPES} [options.type=PIXI.TYPES.UNSIGNED_BYTE] - GL data type
5992 * @param {PIXI.TARGETS} [options.target=PIXI.TARGETS.TEXTURE_2D] - GL texture target
5993 * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.UNPACK] - Pre multiply the image alpha
5994 * @param {number} [options.width=0] - Width of the texture
5995 * @param {number} [options.height=0] - Height of the texture
5996 * @param {number} [options.resolution] - Resolution of the base texture
5997 * @param {object} [options.resourceOptions] - Optional resource options,
5998 * see {@link PIXI.resources.autoDetectResource autoDetectResource}
5999 */
6000 class BaseTexture extends PIXI.utils.EventEmitter {
6001 constructor(resource?: PIXI.resources.Resource | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, options?: {
6002 mipmap?: PIXI.MIPMAP_MODES;
6003 anisotropicLevel?: number;
6004 wrapMode?: PIXI.WRAP_MODES;
6005 scaleMode?: PIXI.SCALE_MODES;
6006 format?: PIXI.FORMATS;
6007 type?: PIXI.TYPES;
6008 target?: PIXI.TARGETS;
6009 alphaMode?: PIXI.ALPHA_MODES;
6010 width?: number;
6011 height?: number;
6012 resolution?: number;
6013 resourceOptions?: any;
6014 });
6015 /**
6016 * Get the drawable source, such as HTMLCanvasElement or HTMLImageElement suitable
6017 * for rendering with CanvasRenderer. Provided by **@pixi/canvas-renderer** package.
6018 * @method getDrawableSource
6019 * @memberof PIXI.BaseTexture#
6020 * @return {PIXI.ICanvasImageSource} Source to render with CanvasRenderer
6021 */
6022 getDrawableSource(): PIXI.ICanvasImageSource;
6023 /**
6024 * The width of the base texture set when the image has loaded
6025 *
6026 * @readonly
6027 * @member {number} PIXI.BaseTexture#width
6028 */
6029 readonly width: number;
6030 /**
6031 * The height of the base texture set when the image has loaded
6032 *
6033 * @readonly
6034 * @member {number} PIXI.BaseTexture#height
6035 */
6036 readonly height: number;
6037 /**
6038 * The resolution / device pixel ratio of the texture
6039 *
6040 * @member {number} PIXI.BaseTexture#resolution
6041 * @default PIXI.settings.RESOLUTION
6042 */
6043 resolution: number;
6044 /**
6045 * Mipmap mode of the texture, affects downscaled images
6046 *
6047 * @member {PIXI.MIPMAP_MODES} PIXI.BaseTexture#mipmap
6048 * @default PIXI.settings.MIPMAP_TEXTURES
6049 */
6050 mipmap: PIXI.MIPMAP_MODES;
6051 /**
6052 * Anisotropic filtering level of texture
6053 *
6054 * @member {number} PIXI.BaseTexture#anisotropicLevel
6055 * @default PIXI.settings.ANISOTROPIC_LEVEL
6056 */
6057 anisotropicLevel: number;
6058 /**
6059 * How the texture wraps
6060 * @member {number} PIXI.BaseTexture#wrapMode
6061 */
6062 wrapMode: number;
6063 /**
6064 * The scale mode to apply when scaling this texture
6065 *
6066 * @member {PIXI.SCALE_MODES} PIXI.BaseTexture#scaleMode
6067 * @default PIXI.settings.SCALE_MODE
6068 */
6069 scaleMode: PIXI.SCALE_MODES;
6070 /**
6071 * The pixel format of the texture
6072 *
6073 * @member {PIXI.FORMATS} PIXI.BaseTexture#format
6074 * @default PIXI.FORMATS.RGBA
6075 */
6076 format: PIXI.FORMATS;
6077 /**
6078 * The type of resource data
6079 *
6080 * @member {PIXI.TYPES} PIXI.BaseTexture#type
6081 * @default PIXI.TYPES.UNSIGNED_BYTE
6082 */
6083 type: PIXI.TYPES;
6084 /**
6085 * The target type
6086 *
6087 * @member {PIXI.TARGETS} PIXI.BaseTexture#target
6088 * @default PIXI.TARGETS.TEXTURE_2D
6089 */
6090 target: PIXI.TARGETS;
6091 /**
6092 * How to treat premultiplied alpha, see {@link PIXI.ALPHA_MODES}.
6093 *
6094 * @member {PIXI.ALPHA_MODES} PIXI.BaseTexture#alphaMode
6095 * @default PIXI.ALPHA_MODES.UNPACK
6096 */
6097 alphaMode: PIXI.ALPHA_MODES;
6098 /**
6099 * Global unique identifier for this BaseTexture
6100 *
6101 * @member {number} PIXI.BaseTexture#uid
6102 * @protected
6103 */
6104 protected uid: number;
6105 /**
6106 * Used by automatic texture Garbage Collection, stores last GC tick when it was bound
6107 *
6108 * @member {number} PIXI.BaseTexture#touched
6109 * @protected
6110 */
6111 protected touched: number;
6112 /**
6113 * Whether or not the texture is a power of two, try to use power of two textures as much
6114 * as you can
6115 *
6116 * @readonly
6117 * @member {boolean} PIXI.BaseTexture#isPowerOfTwo
6118 * @default false
6119 */
6120 readonly isPowerOfTwo: boolean;
6121 /**
6122 * Used by TextureSystem to only update texture to the GPU when needed.
6123 * Please call `update()` to increment it.
6124 *
6125 * @readonly
6126 * @member {number} PIXI.BaseTexture#dirtyId
6127 */
6128 readonly dirtyId: number;
6129 /**
6130 * Used by TextureSystem to only update texture style when needed.
6131 *
6132 * @protected
6133 * @member {number} PIXI.BaseTexture#dirtyStyleId
6134 */
6135 protected dirtyStyleId: number;
6136 /**
6137 * Currently default cache ID.
6138 *
6139 * @member {string} PIXI.BaseTexture#cacheId
6140 */
6141 cacheId: string;
6142 /**
6143 * Generally speaking means when resource is loaded.
6144 * @readonly
6145 * @member {boolean} PIXI.BaseTexture#valid
6146 */
6147 readonly valid: boolean;
6148 /**
6149 * The collection of alternative cache ids, since some BaseTextures
6150 * can have more than one ID, short name and longer full URL
6151 *
6152 * @member {Array<string>} PIXI.BaseTexture#textureCacheIds
6153 * @readonly
6154 */
6155 readonly textureCacheIds: string[];
6156 /**
6157 * Flag if BaseTexture has been destroyed.
6158 *
6159 * @member {boolean} PIXI.BaseTexture#destroyed
6160 * @readonly
6161 */
6162 readonly destroyed: boolean;
6163 /**
6164 * The resource used by this BaseTexture, there can only
6165 * be one resource per BaseTexture, but textures can share
6166 * resources.
6167 *
6168 * @member {PIXI.resources.Resource} PIXI.BaseTexture#resource
6169 * @readonly
6170 */
6171 readonly resource: PIXI.resources.Resource;
6172 /**
6173 * Number of the texture batch, used by multi-texture renderers
6174 *
6175 * @member {number} PIXI.BaseTexture#_batchEnabled
6176 */
6177 _batchEnabled: number;
6178 /**
6179 * Location inside texture batch, used by multi-texture renderers
6180 *
6181 * @member {number} PIXI.BaseTexture#_batchLocation
6182 */
6183 _batchLocation: number;
6184 /**
6185 * Whether its a part of another texture, handled by ArrayResource or CubeResource
6186 *
6187 * @member {PIXI.BaseTexture} PIXI.BaseTexture#parentTextureArray
6188 */
6189 parentTextureArray: PIXI.BaseTexture;
6190 /**
6191 * Pixel width of the source of this texture
6192 *
6193 * @readonly
6194 * @member {number}
6195 */
6196 readonly realWidth: number;
6197 /**
6198 * Pixel height of the source of this texture
6199 *
6200 * @readonly
6201 * @member {number}
6202 */
6203 readonly realHeight: number;
6204 /**
6205 * Changes style options of BaseTexture
6206 *
6207 * @param {PIXI.SCALE_MODES} [scaleMode] - Pixi scalemode
6208 * @param {PIXI.MIPMAP_MODES} [mipmap] - enable mipmaps
6209 * @returns {PIXI.BaseTexture} this
6210 */
6211 setStyle(scaleMode?: PIXI.SCALE_MODES, mipmap?: PIXI.MIPMAP_MODES): PIXI.BaseTexture;
6212 /**
6213 * Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.
6214 *
6215 * @param {number} width - Visual width
6216 * @param {number} height - Visual height
6217 * @param {number} [resolution] - Optionally set resolution
6218 * @returns {PIXI.BaseTexture} this
6219 */
6220 setSize(width: number, height: number, resolution?: number): PIXI.BaseTexture;
6221 /**
6222 * Sets real size of baseTexture, preserves current resolution.
6223 *
6224 * @param {number} realWidth - Full rendered width
6225 * @param {number} realHeight - Full rendered height
6226 * @param {number} [resolution] - Optionally set resolution
6227 * @returns {PIXI.BaseTexture} this
6228 */
6229 setRealSize(realWidth: number, realHeight: number, resolution?: number): PIXI.BaseTexture;
6230 /**
6231 * Changes resolution
6232 *
6233 * @param {number} resolution - res
6234 * @returns {PIXI.BaseTexture} this
6235 */
6236 setResolution(resolution: number): PIXI.BaseTexture;
6237 /**
6238 * Sets the resource if it wasn't set. Throws error if resource already present
6239 *
6240 * @param {PIXI.resources.Resource} resource - that is managing this BaseTexture
6241 * @returns {PIXI.BaseTexture} this
6242 */
6243 setResource(resource: PIXI.resources.Resource): PIXI.BaseTexture;
6244 /**
6245 * Invalidates the object. Texture becomes valid if width and height are greater than zero.
6246 */
6247 update(): void;
6248 /**
6249 * Destroys this base texture.
6250 * The method stops if resource doesn't want this texture to be destroyed.
6251 * Removes texture from all caches.
6252 */
6253 destroy(): void;
6254 /**
6255 * Frees the texture from WebGL memory without destroying this texture object.
6256 * This means you can still use the texture later which will upload it to GPU
6257 * memory again.
6258 *
6259 * @fires PIXI.BaseTexture#dispose
6260 */
6261 dispose(): void;
6262 /**
6263 * Utility function for BaseTexture|Texture cast
6264 */
6265 castToBaseTexture(): void;
6266 /**
6267 * Helper function that creates a base texture based on the source you provide.
6268 * The source can be - image url, image element, canvas element. If the
6269 * source is an image url or an image element and not in the base texture
6270 * cache, it will be created and loaded.
6271 *
6272 * @static
6273 * @param {string|HTMLImageElement|HTMLCanvasElement|SVGElement|HTMLVideoElement} source - The
6274 * source to create base texture from.
6275 * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options.
6276 * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}.
6277 * @returns {PIXI.BaseTexture} The new base texture.
6278 */
6279 static from(source: string | HTMLImageElement | HTMLCanvasElement | SVGElement | HTMLVideoElement, options?: any, strict?: boolean): PIXI.BaseTexture;
6280 /**
6281 * Create a new BaseTexture with a BufferResource from a Float32Array.
6282 * RGBA values are floats from 0 to 1.
6283 * @static
6284 * @param {Float32Array|Uint8Array} buffer - The optional array to use, if no data
6285 * is provided, a new Float32Array is created.
6286 * @param {number} width - Width of the resource
6287 * @param {number} height - Height of the resource
6288 * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options.
6289 * @return {PIXI.BaseTexture} The resulting new BaseTexture
6290 */
6291 static fromBuffer(buffer: Float32Array | Uint8Array, width: number, height: number, options?: any): PIXI.BaseTexture;
6292 /**
6293 * Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.
6294 *
6295 * @static
6296 * @param {PIXI.BaseTexture} baseTexture - The BaseTexture to add to the cache.
6297 * @param {string} id - The id that the BaseTexture will be stored against.
6298 */
6299 static addToCache(baseTexture: PIXI.BaseTexture, id: string): void;
6300 /**
6301 * Remove a BaseTexture from the global BaseTextureCache.
6302 *
6303 * @static
6304 * @param {string|PIXI.BaseTexture} baseTexture - id of a BaseTexture to be removed, or a BaseTexture instance itself.
6305 * @return {PIXI.BaseTexture|null} The BaseTexture that was removed.
6306 */
6307 static removeFromCache(baseTexture: string | PIXI.BaseTexture): PIXI.BaseTexture | null;
6308 /**
6309 * Global number of the texture batch, used by multi-texture renderers
6310 *
6311 * @static
6312 * @member {number}
6313 */
6314 static _globalBatch: number;
6315 }
6316 /**
6317 * Internal texture for WebGL context
6318 * @class
6319 * @memberof PIXI
6320 */
6321 class GLTexture {
6322 constructor();
6323 /**
6324 * The WebGL texture
6325 * @member {WebGLTexture} PIXI.GLTexture#texture
6326 */
6327 texture: WebGLTexture;
6328 /**
6329 * Width of texture that was used in texImage2D
6330 * @member {number} PIXI.GLTexture#width
6331 */
6332 width: number;
6333 /**
6334 * Height of texture that was used in texImage2D
6335 * @member {number} PIXI.GLTexture#height
6336 */
6337 height: number;
6338 /**
6339 * Texture contents dirty flag
6340 * @member {number} PIXI.GLTexture#dirtyId
6341 */
6342 dirtyId: number;
6343 /**
6344 * Texture style dirty flag
6345 * @member {number} PIXI.GLTexture#dirtyStyleId
6346 */
6347 dirtyStyleId: number;
6348 /**
6349 * Whether mip levels has to be generated
6350 * @member {boolean} PIXI.GLTexture#mipmap
6351 */
6352 mipmap: boolean;
6353 /**
6354 * WrapMode copied from baseTexture
6355 * @member {number} PIXI.GLTexture#wrapMode
6356 */
6357 wrapMode: number;
6358 /**
6359 * Type copied from baseTexture
6360 * @member {number} PIXI.GLTexture#type
6361 */
6362 type: number;
6363 /**
6364 * Type copied from baseTexture
6365 * @member {number} PIXI.GLTexture#internalFormat
6366 */
6367 internalFormat: number;
6368 }
6369 /**
6370 * A texture stores the information that represents an image or part of an image.
6371 *
6372 * It cannot be added to the display list directly; instead use it as the texture for a Sprite.
6373 * If no frame is provided for a texture, then the whole image is used.
6374 *
6375 * You can directly create a texture from an image and then reuse it multiple times like this :
6376 *
6377 * ```js
6378 * let texture = PIXI.Texture.from('assets/image.png');
6379 * let sprite1 = new PIXI.Sprite(texture);
6380 * let sprite2 = new PIXI.Sprite(texture);
6381 * ```
6382 *
6383 * If you didnt pass the texture frame to constructor, it enables `noFrame` mode:
6384 * it subscribes on baseTexture events, it automatically resizes at the same time as baseTexture.
6385 *
6386 * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing.
6387 * You can check for this by checking the sprite's _textureID property.
6388 * ```js
6389 * var texture = PIXI.Texture.from('assets/image.svg');
6390 * var sprite1 = new PIXI.Sprite(texture);
6391 * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file
6392 * ```
6393 * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068.
6394 *
6395 * @class
6396 * @extends PIXI.utils.EventEmitter
6397 * @memberof PIXI
6398 */
6399 class Texture extends PIXI.utils.EventEmitter {
6400 constructor(baseTexture: PIXI.BaseTexture, frame?: PIXI.Rectangle, orig?: PIXI.Rectangle, trim?: PIXI.Rectangle, rotate?: number, anchor?: PIXI.IPointData);
6401 /**
6402 * Does this Texture have any frame data assigned to it?
6403 *
6404 * This mode is enabled automatically if no frame was passed inside constructor.
6405 *
6406 * In this mode texture is subscribed to baseTexture events, and fires `update` on any change.
6407 *
6408 * Beware, after loading or resize of baseTexture event can fired two times!
6409 * If you want more control, subscribe on baseTexture itself.
6410 *
6411 * ```js
6412 * texture.on('update', () => {});
6413 * ```
6414 *
6415 * Any assignment of `frame` switches off `noFrame` mode.
6416 *
6417 * @member {boolean} PIXI.Texture#noFrame
6418 */
6419 noFrame: boolean;
6420 /**
6421 * The base texture that this texture uses.
6422 *
6423 * @member {PIXI.BaseTexture} PIXI.Texture#baseTexture
6424 */
6425 baseTexture: PIXI.BaseTexture;
6426 /**
6427 * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
6428 * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
6429 *
6430 * @member {PIXI.Rectangle} PIXI.Texture#_frame
6431 */
6432 _frame: PIXI.Rectangle;
6433 /**
6434 * This is the trimmed area of original texture, before it was put in atlas
6435 * Please call `updateUvs()` after you change coordinates of `trim` manually.
6436 *
6437 * @member {PIXI.Rectangle} PIXI.Texture#trim
6438 */
6439 trim: PIXI.Rectangle;
6440 /**
6441 * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
6442 *
6443 * @member {boolean} PIXI.Texture#valid
6444 */
6445 valid: boolean;
6446 /**
6447 * The WebGL UV data cache. Can be used as quad UV
6448 *
6449 * @member {PIXI.TextureUvs} PIXI.Texture#_uvs
6450 * @protected
6451 */
6452 protected _uvs: PIXI.TextureUvs;
6453 /**
6454 * Default TextureMatrix instance for this texture
6455 * By default that object is not created because its heavy
6456 *
6457 * @member {PIXI.TextureMatrix} PIXI.Texture#uvMatrix
6458 */
6459 uvMatrix: PIXI.TextureMatrix;
6460 /**
6461 * This is the area of original texture, before it was put in atlas
6462 *
6463 * @member {PIXI.Rectangle} PIXI.Texture#orig
6464 */
6465 orig: PIXI.Rectangle;
6466 /**
6467 * Anchor point that is used as default if sprite is created with this texture.
6468 * Changing the `defaultAnchor` at a later point of time will not update Sprite's anchor point.
6469 * @member {PIXI.Point} PIXI.Texture#defaultAnchor
6470 * @default {0,0}
6471 */
6472 defaultAnchor: PIXI.Point;
6473 /**
6474 * Update ID is observed by sprites and TextureMatrix instances.
6475 * Call updateUvs() to increment it.
6476 *
6477 * @member {number} PIXI.Texture#_updateID
6478 * @protected
6479 */
6480 protected _updateID: number;
6481 /**
6482 * The ids under which this Texture has been added to the texture cache. This is
6483 * automatically set as long as Texture.addToCache is used, but may not be set if a
6484 * Texture is added directly to the TextureCache array.
6485 *
6486 * @member {string[]} PIXI.Texture#textureCacheIds
6487 */
6488 textureCacheIds: string[];
6489 /**
6490 * Updates this texture on the gpu.
6491 *
6492 * Calls the TextureResource update.
6493 *
6494 * If you adjusted `frame` manually, please call `updateUvs()` instead.
6495 *
6496 */
6497 update(): void;
6498 /**
6499 * Called when the base texture is updated
6500 *
6501 * @protected
6502 * @param {PIXI.BaseTexture} baseTexture - The base texture.
6503 */
6504 protected onBaseTextureUpdated(baseTexture: PIXI.BaseTexture): void;
6505 /**
6506 * Destroys this texture
6507 *
6508 * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well
6509 */
6510 destroy(destroyBase?: boolean): void;
6511 /**
6512 * Creates a new texture object that acts the same as this one.
6513 *
6514 * @return {PIXI.Texture} The new texture
6515 */
6516 clone(): PIXI.Texture;
6517 /**
6518 * Updates the internal WebGL UV cache. Use it after you change `frame` or `trim` of the texture.
6519 * Call it after changing the frame
6520 */
6521 updateUvs(): void;
6522 /**
6523 * Helper function that creates a new Texture based on the source you provide.
6524 * The source can be - frame id, image url, video url, canvas element, video element, base texture
6525 *
6526 * @static
6527 * @param {string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} source
6528 * Source to create texture from
6529 * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options.
6530 * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}.
6531 * @return {PIXI.Texture} The newly created texture
6532 */
6533 static from(source: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | PIXI.BaseTexture, options?: any, strict?: boolean): PIXI.Texture;
6534 /**
6535 * Useful for loading textures via URLs. Use instead of `Texture.from` because
6536 * it does a better job of handling failed URLs more effectively. This also ignores
6537 * `PIXI.settings.STRICT_TEXTURE_CACHE`. Works for Videos, SVGs, Images.
6538 * @param {string} url The remote URL to load.
6539 * @param {object} [options] Optional options to include
6540 * @return {Promise<PIXI.Texture>} A Promise that resolves to a Texture.
6541 */
6542 static fromURL(url: string, options?: any): Promise<PIXI.Texture>;
6543 /**
6544 * Create a new Texture with a BufferResource from a Float32Array.
6545 * RGBA values are floats from 0 to 1.
6546 * @static
6547 * @param {Float32Array|Uint8Array} buffer - The optional array to use, if no data
6548 * is provided, a new Float32Array is created.
6549 * @param {number} width - Width of the resource
6550 * @param {number} height - Height of the resource
6551 * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options.
6552 * @return {PIXI.Texture} The resulting new BaseTexture
6553 */
6554 static fromBuffer(buffer: Float32Array | Uint8Array, width: number, height: number, options?: any): PIXI.Texture;
6555 /**
6556 * Create a texture from a source and add to the cache.
6557 *
6558 * @static
6559 * @param {HTMLImageElement|HTMLCanvasElement} source - The input source.
6560 * @param {String} imageUrl - File name of texture, for cache and resolving resolution.
6561 * @param {String} [name] - Human readable name for the texture cache. If no name is
6562 * specified, only `imageUrl` will be used as the cache ID.
6563 * @return {PIXI.Texture} Output texture
6564 */
6565 static fromLoader(source: HTMLImageElement | HTMLCanvasElement, imageUrl: string, name?: string): PIXI.Texture;
6566 /**
6567 * Adds a Texture to the global TextureCache. This cache is shared across the whole PIXI object.
6568 *
6569 * @static
6570 * @param {PIXI.Texture} texture - The Texture to add to the cache.
6571 * @param {string} id - The id that the Texture will be stored against.
6572 */
6573 static addToCache(texture: PIXI.Texture, id: string): void;
6574 /**
6575 * Remove a Texture from the global TextureCache.
6576 *
6577 * @static
6578 * @param {string|PIXI.Texture} texture - id of a Texture to be removed, or a Texture instance itself
6579 * @return {PIXI.Texture|null} The Texture that was removed
6580 */
6581 static removeFromCache(texture: string | PIXI.Texture): PIXI.Texture | null;
6582 /**
6583 * Returns resolution of baseTexture
6584 *
6585 * @member {number}
6586 * @readonly
6587 */
6588 readonly resolution: number;
6589 /**
6590 * The frame specifies the region of the base texture that this texture uses.
6591 * Please call `updateUvs()` after you change coordinates of `frame` manually.
6592 *
6593 * @member {PIXI.Rectangle}
6594 */
6595 frame: PIXI.Rectangle;
6596 /**
6597 * Indicates whether the texture is rotated inside the atlas
6598 * set to 2 to compensate for texture packer rotation
6599 * set to 6 to compensate for spine packer rotation
6600 * can be used to rotate or mirror sprites
6601 * See {@link PIXI.groupD8} for explanation
6602 *
6603 * @member {number}
6604 */
6605 rotate: number;
6606 /**
6607 * The width of the Texture in pixels.
6608 *
6609 * @member {number}
6610 */
6611 width: number;
6612 /**
6613 * The height of the Texture in pixels.
6614 *
6615 * @member {number}
6616 */
6617 height: number;
6618 /**
6619 * Utility function for BaseTexture|Texture cast
6620 */
6621 castToBaseTexture(): void;
6622 /**
6623 * An empty texture, used often to not have to create multiple empty textures.
6624 * Can not be destroyed.
6625 *
6626 * @static
6627 * @constant
6628 * @member {PIXI.Texture}
6629 */
6630 static EMPTY: PIXI.Texture;
6631 /**
6632 * A white texture of 16x16 size, used for graphics and other things
6633 * Can not be destroyed.
6634 *
6635 * @static
6636 * @constant
6637 * @member {PIXI.Texture}
6638 */
6639 static WHITE: PIXI.Texture;
6640 }
6641 /**
6642 * Class controls uv mapping from Texture normal space to BaseTexture normal space.
6643 *
6644 * Takes `trim` and `rotate` into account. May contain clamp settings for Meshes and TilingSprite.
6645 *
6646 * Can be used in Texture `uvMatrix` field, or separately, you can use different clamp settings on the same texture.
6647 * If you want to add support for texture region of certain feature or filter, that's what you're looking for.
6648 *
6649 * Takes track of Texture changes through `_lastTextureID` private field.
6650 * Use `update()` method call to track it from outside.
6651 *
6652 * @see PIXI.Texture
6653 * @see PIXI.Mesh
6654 * @see PIXI.TilingSprite
6655 * @class
6656 * @memberof PIXI
6657 */
6658 class TextureMatrix {
6659 constructor(texture: PIXI.Texture, clampMargin?: number);
6660 /**
6661 * Matrix operation that converts texture region coords to texture coords
6662 * @member {PIXI.Matrix} PIXI.TextureMatrix#mapCoord
6663 * @readonly
6664 */
6665 readonly mapCoord: PIXI.Matrix;
6666 /**
6667 * Clamp region for normalized coords, left-top pixel center in xy , bottom-right in zw.
6668 * Calculated based on clampOffset.
6669 * @member {Float32Array} PIXI.TextureMatrix#uClampFrame
6670 * @readonly
6671 */
6672 readonly uClampFrame: Float32Array;
6673 /**
6674 * Normalized clamp offset.
6675 * Calculated based on clampOffset.
6676 * @member {Float32Array} PIXI.TextureMatrix#uClampOffset
6677 * @readonly
6678 */
6679 readonly uClampOffset: Float32Array;
6680 /**
6681 * Tracks Texture frame changes
6682 * @member {number} PIXI.TextureMatrix#_textureID
6683 * @protected
6684 */
6685 protected _textureID: number;
6686 /**
6687 * Tracks Texture frame changes
6688 * @member {number} PIXI.TextureMatrix#_updateID
6689 * @protected
6690 */
6691 protected _updateID: number;
6692 /**
6693 * Changes frame clamping
6694 * Works with TilingSprite and Mesh
6695 * Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders
6696 *
6697 * @default 0
6698 * @member {number} PIXI.TextureMatrix#clampOffset
6699 */
6700 clampOffset: number;
6701 /**
6702 * Changes frame clamping
6703 * Works with TilingSprite and Mesh
6704 * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas
6705 *
6706 * @default 0.5
6707 * @member {number} PIXI.TextureMatrix#clampMargin
6708 */
6709 clampMargin: number;
6710 /**
6711 * If texture size is the same as baseTexture
6712 * @member {boolean} PIXI.TextureMatrix#isSimple
6713 * @default false
6714 * @readonly
6715 */
6716 readonly isSimple: boolean;
6717 /**
6718 * texture property
6719 * @member {PIXI.Texture}
6720 */
6721 texture: PIXI.Texture;
6722 /**
6723 * Multiplies uvs array to transform
6724 * @param {Float32Array} uvs - mesh uvs
6725 * @param {Float32Array} [out=uvs] output
6726 * @returns {Float32Array} output
6727 */
6728 multiplyUvs(uvs: Float32Array, out?: Float32Array): Float32Array;
6729 /**
6730 * updates matrices if texture was changed
6731 * @param {boolean} [forceUpdate=false] - if true, matrices will be updated any case
6732 * @returns {boolean} whether or not it was updated
6733 */
6734 update(forceUpdate?: boolean): boolean;
6735 }
6736 /**
6737 * Stores a texture's frame in UV coordinates, in
6738 * which everything lies in the rectangle `[(0,0), (1,0),
6739 * (1,1), (0,1)]`.
6740 *
6741 * | Corner | Coordinates |
6742 * |--------------|-------------|
6743 * | Top-Left | `(x0,y0)` |
6744 * | Top-Right | `(x1,y1)` |
6745 * | Bottom-Right | `(x2,y2)` |
6746 * | Bottom-Left | `(x3,y3)` |
6747 *
6748 * @class
6749 * @protected
6750 * @memberof PIXI
6751 */
6752 class TextureUvs {
6753 constructor();
6754 /**
6755 * X-component of top-left corner `(x0,y0)`.
6756 *
6757 * @member {number} PIXI.TextureUvs#x0
6758 */
6759 x0: number;
6760 /**
6761 * Y-component of top-left corner `(x0,y0)`.
6762 *
6763 * @member {number} PIXI.TextureUvs#y0
6764 */
6765 y0: number;
6766 /**
6767 * X-component of top-right corner `(x1,y1)`.
6768 *
6769 * @member {number} PIXI.TextureUvs#x1
6770 */
6771 x1: number;
6772 /**
6773 * Y-component of top-right corner `(x1,y1)`.
6774 *
6775 * @member {number} PIXI.TextureUvs#y1
6776 */
6777 y1: number;
6778 /**
6779 * X-component of bottom-right corner `(x2,y2)`.
6780 *
6781 * @member {number} PIXI.TextureUvs#x2
6782 */
6783 x2: number;
6784 /**
6785 * Y-component of bottom-right corner `(x2,y2)`.
6786 *
6787 * @member {number} PIXI.TextureUvs#y2
6788 */
6789 y2: number;
6790 /**
6791 * X-component of bottom-left corner `(x3,y3)`.
6792 *
6793 * @member {number} PIXI.TextureUvs#x3
6794 */
6795 x3: number;
6796 /**
6797 * Y-component of bottom-right corner `(x3,y3)`.
6798 *
6799 * @member {number} PIXI.TextureUvs#y3
6800 */
6801 y3: number;
6802 /**
6803 * Sets the texture Uvs based on the given frame information.
6804 *
6805 * @protected
6806 * @param {PIXI.Rectangle} frame - The frame of the texture
6807 * @param {PIXI.Rectangle} baseFrame - The base frame of the texture
6808 * @param {number} rotate - Rotation of frame, see {@link PIXI.groupD8}
6809 */
6810 protected set(frame: PIXI.Rectangle, baseFrame: PIXI.Rectangle, rotate: number): void;
6811 }
6812 /**
6813 * Collection of base resource types supported by PixiJS.
6814 *
6815 * Resources are used by {@link PIXI.BaseTexture} to handle different media types
6816 * such as images, video, SVG graphics, etc. In most use-cases, you should not
6817 * instantiate the resources directly. The easy thing is to use
6818 * {@link PIXI.BaseTexture.from}.
6819 * @example
6820 * const baseTexture = PIXI.BaseTexture.from('path/to/image.jpg');
6821 * @namespace PIXI.resources
6822 */
6823 namespace resources {
6824 /**
6825 * Resource that can manage several resource (items) inside.
6826 * All resources need to have the same pixel size.
6827 * Parent class for CubeResource and ArrayResource
6828 *
6829 * @class
6830 * @extends PIXI.resources.Resource
6831 * @memberof PIXI.resources
6832 * @param {object} [options] Options to for Resource constructor
6833 * @param {number} [options.width] - Width of the resource
6834 * @param {number} [options.height] - Height of the resource
6835 */
6836 class AbstractMultiResource extends PIXI.resources.Resource {
6837 constructor(options?: {
6838 width?: number;
6839 height?: number;
6840 });
6841 /**
6842 * Collection of partial baseTextures that correspond to resources
6843 * @member {Array<PIXI.BaseTexture>} PIXI.resources.AbstractMultiResource#items
6844 * @readonly
6845 */
6846 readonly items: PIXI.BaseTexture[];
6847 /**
6848 * Dirty IDs for each part
6849 * @member {Array<number>} PIXI.resources.AbstractMultiResource#itemDirtyIds
6850 * @readonly
6851 */
6852 readonly itemDirtyIds: number[];
6853 /**
6854 * Number of elements in array
6855 *
6856 * @member {number} PIXI.resources.AbstractMultiResource#length
6857 * @readonly
6858 */
6859 readonly length: number;
6860 /**
6861 * Bound baseTexture, there can only be one
6862 * @member {PIXI.BaseTexture} PIXI.resources.AbstractMultiResource#baseTexture
6863 */
6864 baseTexture: PIXI.BaseTexture;
6865 /**
6866 * used from ArrayResource and CubeResource constructors
6867 * @param {Array<*>} resources - Can be resources, image elements, canvas, etc. ,
6868 * length should be same as constructor length
6869 * @param {object} [options] - detect options for resources
6870 * @protected
6871 */
6872 protected initFromArray(resources: any[], options?: any): void;
6873 /**
6874 * Set a resource by ID
6875 *
6876 * @param {PIXI.resources.Resource} resource
6877 * @param {number} index - Zero-based index of resource to set
6878 * @return {PIXI.resources.ArrayResource} Instance for chaining
6879 */
6880 addResourceAt(resource: PIXI.resources.Resource, index: number): PIXI.resources.ArrayResource;
6881 /**
6882 * Internal width of the resource
6883 * @member {number} PIXI.resources.Resource#_width
6884 * @protected
6885 */
6886 protected _width: number;
6887 /**
6888 * Internal height of the resource
6889 * @member {number} PIXI.resources.Resource#_height
6890 * @protected
6891 */
6892 protected _height: number;
6893 /**
6894 * If resource has been destroyed
6895 * @member {boolean} PIXI.resources.Resource#destroyed
6896 * @readonly
6897 * @default false
6898 */
6899 readonly destroyed: boolean;
6900 /**
6901 * `true` if resource is created by BaseTexture
6902 * useful for doing cleanup with BaseTexture destroy
6903 * and not cleaning up resources that were created
6904 * externally.
6905 * @member {boolean} PIXI.resources.Resource#internal
6906 * @protected
6907 */
6908 protected internal: boolean;
6909 /**
6910 * Bind to a parent BaseTexture
6911 *
6912 * @param {PIXI.BaseTexture} baseTexture - Parent texture
6913 */
6914 bind(baseTexture: PIXI.BaseTexture): void;
6915 /**
6916 * Unbind to a parent BaseTexture
6917 *
6918 * @param {PIXI.BaseTexture} baseTexture - Parent texture
6919 */
6920 unbind(baseTexture: PIXI.BaseTexture): void;
6921 /**
6922 * Trigger a resize event
6923 * @param {number} width - X dimension
6924 * @param {number} height - Y dimension
6925 */
6926 resize(width: number, height: number): void;
6927 /**
6928 * Has been validated
6929 * @readonly
6930 * @member {boolean}
6931 */
6932 readonly valid: boolean;
6933 /**
6934 * Has been updated trigger event
6935 */
6936 update(): void;
6937 /**
6938 * This can be overridden to start preloading a resource
6939 * or do any other prepare step.
6940 * @protected
6941 * @return {Promise<void>} Handle the validate event
6942 */
6943 protected load(): Promise<void>;
6944 /**
6945 * The width of the resource.
6946 *
6947 * @member {number}
6948 * @readonly
6949 */
6950 readonly width: number;
6951 /**
6952 * The height of the resource.
6953 *
6954 * @member {number}
6955 * @readonly
6956 */
6957 readonly height: number;
6958 /**
6959 * Set the style, optional to override
6960 *
6961 * @param {PIXI.Renderer} renderer - yeah, renderer!
6962 * @param {PIXI.BaseTexture} baseTexture - the texture
6963 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
6964 * @returns {boolean} `true` is success
6965 */
6966 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
6967 /**
6968 * Clean up anything, this happens when destroying is ready.
6969 *
6970 * @protected
6971 */
6972 protected dispose(): void;
6973 /**
6974 * Call when destroying resource, unbind any BaseTexture object
6975 * before calling this method, as reference counts are maintained
6976 * internally.
6977 */
6978 destroy(): void;
6979 }
6980 /**
6981 * A resource that contains a number of sources.
6982 *
6983 * @class
6984 * @extends PIXI.resources.Resource
6985 * @memberof PIXI.resources
6986 * @param {number|Array<*>} source - Number of items in array or the collection
6987 * of image URLs to use. Can also be resources, image elements, canvas, etc.
6988 * @param {object} [options] - Options to apply to {@link PIXI.resources.autoDetectResource}
6989 * @param {number} [options.width] - Width of the resource
6990 * @param {number} [options.height] - Height of the resource
6991 */
6992 class ArrayResource extends PIXI.resources.Resource {
6993 constructor(source: number | any[], options?: {
6994 width?: number;
6995 height?: number;
6996 });
6997 /**
6998 * Set a baseTexture by ID,
6999 * ArrayResource just takes resource from it, nothing more
7000 *
7001 * @param {PIXI.BaseTexture} baseTexture
7002 * @param {number} index - Zero-based index of resource to set
7003 * @return {PIXI.resources.ArrayResource} Instance for chaining
7004 */
7005 addBaseTextureAt(baseTexture: PIXI.BaseTexture, index: number): PIXI.resources.ArrayResource;
7006 /**
7007 * Upload the resources to the GPU.
7008 * @param {PIXI.Renderer} renderer
7009 * @param {PIXI.BaseTexture} texture
7010 * @param {PIXI.GLTexture} glTexture
7011 * @returns {boolean} whether texture was uploaded
7012 */
7013 upload(renderer: PIXI.Renderer, texture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7014 /**
7015 * Internal width of the resource
7016 * @member {number} PIXI.resources.Resource#_width
7017 * @protected
7018 */
7019 protected _width: number;
7020 /**
7021 * Internal height of the resource
7022 * @member {number} PIXI.resources.Resource#_height
7023 * @protected
7024 */
7025 protected _height: number;
7026 /**
7027 * If resource has been destroyed
7028 * @member {boolean} PIXI.resources.Resource#destroyed
7029 * @readonly
7030 * @default false
7031 */
7032 readonly destroyed: boolean;
7033 /**
7034 * `true` if resource is created by BaseTexture
7035 * useful for doing cleanup with BaseTexture destroy
7036 * and not cleaning up resources that were created
7037 * externally.
7038 * @member {boolean} PIXI.resources.Resource#internal
7039 * @protected
7040 */
7041 protected internal: boolean;
7042 /**
7043 * Bind to a parent BaseTexture
7044 *
7045 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7046 */
7047 bind(baseTexture: PIXI.BaseTexture): void;
7048 /**
7049 * Unbind to a parent BaseTexture
7050 *
7051 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7052 */
7053 unbind(baseTexture: PIXI.BaseTexture): void;
7054 /**
7055 * Trigger a resize event
7056 * @param {number} width - X dimension
7057 * @param {number} height - Y dimension
7058 */
7059 resize(width: number, height: number): void;
7060 /**
7061 * Has been validated
7062 * @readonly
7063 * @member {boolean}
7064 */
7065 readonly valid: boolean;
7066 /**
7067 * Has been updated trigger event
7068 */
7069 update(): void;
7070 /**
7071 * This can be overridden to start preloading a resource
7072 * or do any other prepare step.
7073 * @protected
7074 * @return {Promise<void>} Handle the validate event
7075 */
7076 protected load(): Promise<void>;
7077 /**
7078 * The width of the resource.
7079 *
7080 * @member {number}
7081 * @readonly
7082 */
7083 readonly width: number;
7084 /**
7085 * The height of the resource.
7086 *
7087 * @member {number}
7088 * @readonly
7089 */
7090 readonly height: number;
7091 /**
7092 * Set the style, optional to override
7093 *
7094 * @param {PIXI.Renderer} renderer - yeah, renderer!
7095 * @param {PIXI.BaseTexture} baseTexture - the texture
7096 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
7097 * @returns {boolean} `true` is success
7098 */
7099 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7100 /**
7101 * Clean up anything, this happens when destroying is ready.
7102 *
7103 * @protected
7104 */
7105 protected dispose(): void;
7106 /**
7107 * Call when destroying resource, unbind any BaseTexture object
7108 * before calling this method, as reference counts are maintained
7109 * internally.
7110 */
7111 destroy(): void;
7112 }
7113 /**
7114 * Base for all the image/canvas resources
7115 * @class
7116 * @extends PIXI.resources.Resource
7117 * @memberof PIXI.resources
7118 */
7119 class BaseImageResource extends PIXI.resources.Resource {
7120 constructor(source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement);
7121 /**
7122 * The source element
7123 * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
7124 * @readonly
7125 */
7126 readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
7127 /**
7128 * Set cross origin based detecting the url and the crossorigin
7129 * @protected
7130 * @param {HTMLElement} element - Element to apply crossOrigin
7131 * @param {string} url - URL to check
7132 * @param {boolean|string} [crossorigin=true] - Cross origin value to use
7133 */
7134 protected static crossOrigin(element: HTMLElement, url: string, crossorigin?: boolean | string): void;
7135 /**
7136 * Upload the texture to the GPU.
7137 * @param {PIXI.Renderer} renderer - Upload to the renderer
7138 * @param {PIXI.BaseTexture} baseTexture - Reference to parent texture
7139 * @param {PIXI.GLTexture} glTexture
7140 * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
7141 * @returns {boolean} true is success
7142 */
7143 upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
7144 /**
7145 * Checks if source width/height was changed, resize can cause extra baseTexture update.
7146 * Triggers one update in any case.
7147 */
7148 update(): void;
7149 /**
7150 * Internal width of the resource
7151 * @member {number} PIXI.resources.Resource#_width
7152 * @protected
7153 */
7154 protected _width: number;
7155 /**
7156 * Internal height of the resource
7157 * @member {number} PIXI.resources.Resource#_height
7158 * @protected
7159 */
7160 protected _height: number;
7161 /**
7162 * If resource has been destroyed
7163 * @member {boolean} PIXI.resources.Resource#destroyed
7164 * @readonly
7165 * @default false
7166 */
7167 readonly destroyed: boolean;
7168 /**
7169 * `true` if resource is created by BaseTexture
7170 * useful for doing cleanup with BaseTexture destroy
7171 * and not cleaning up resources that were created
7172 * externally.
7173 * @member {boolean} PIXI.resources.Resource#internal
7174 * @protected
7175 */
7176 protected internal: boolean;
7177 /**
7178 * Bind to a parent BaseTexture
7179 *
7180 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7181 */
7182 bind(baseTexture: PIXI.BaseTexture): void;
7183 /**
7184 * Unbind to a parent BaseTexture
7185 *
7186 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7187 */
7188 unbind(baseTexture: PIXI.BaseTexture): void;
7189 /**
7190 * Trigger a resize event
7191 * @param {number} width - X dimension
7192 * @param {number} height - Y dimension
7193 */
7194 resize(width: number, height: number): void;
7195 /**
7196 * Has been validated
7197 * @readonly
7198 * @member {boolean}
7199 */
7200 readonly valid: boolean;
7201 /**
7202 * This can be overridden to start preloading a resource
7203 * or do any other prepare step.
7204 * @protected
7205 * @return {Promise<void>} Handle the validate event
7206 */
7207 protected load(): Promise<void>;
7208 /**
7209 * The width of the resource.
7210 *
7211 * @member {number}
7212 * @readonly
7213 */
7214 readonly width: number;
7215 /**
7216 * The height of the resource.
7217 *
7218 * @member {number}
7219 * @readonly
7220 */
7221 readonly height: number;
7222 /**
7223 * Set the style, optional to override
7224 *
7225 * @param {PIXI.Renderer} renderer - yeah, renderer!
7226 * @param {PIXI.BaseTexture} baseTexture - the texture
7227 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
7228 * @returns {boolean} `true` is success
7229 */
7230 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7231 /**
7232 * Clean up anything, this happens when destroying is ready.
7233 *
7234 * @protected
7235 */
7236 protected dispose(): void;
7237 /**
7238 * Call when destroying resource, unbind any BaseTexture object
7239 * before calling this method, as reference counts are maintained
7240 * internally.
7241 */
7242 destroy(): void;
7243 }
7244 /**
7245 * Buffer resource with data of typed array.
7246 * @class
7247 * @extends PIXI.resources.Resource
7248 * @memberof PIXI.resources
7249 */
7250 class BufferResource extends PIXI.resources.Resource {
7251 constructor(source: Float32Array | Uint8Array | Uint32Array, options: {
7252 width: number;
7253 height: number;
7254 });
7255 /**
7256 * Source array
7257 * Cannot be ClampedUint8Array because it cant be uploaded to WebGL
7258 *
7259 * @member {Float32Array|Uint8Array|Uint32Array} PIXI.resources.BufferResource#data
7260 */
7261 data: Float32Array | Uint8Array | Uint32Array;
7262 /**
7263 * Upload the texture to the GPU.
7264 * @param {PIXI.Renderer} renderer - Upload to the renderer
7265 * @param {PIXI.BaseTexture} baseTexture - Reference to parent texture
7266 * @param {PIXI.GLTexture} glTexture - glTexture
7267 * @returns {boolean} true is success
7268 */
7269 upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7270 /**
7271 * Used to auto-detect the type of resource.
7272 *
7273 * @static
7274 * @param {*} source - The source object
7275 * @return {boolean} `true` if <canvas>
7276 */
7277 static test(source: any): boolean;
7278 /**
7279 * Internal width of the resource
7280 * @member {number} PIXI.resources.Resource#_width
7281 * @protected
7282 */
7283 protected _width: number;
7284 /**
7285 * Internal height of the resource
7286 * @member {number} PIXI.resources.Resource#_height
7287 * @protected
7288 */
7289 protected _height: number;
7290 /**
7291 * If resource has been destroyed
7292 * @member {boolean} PIXI.resources.Resource#destroyed
7293 * @readonly
7294 * @default false
7295 */
7296 readonly destroyed: boolean;
7297 /**
7298 * `true` if resource is created by BaseTexture
7299 * useful for doing cleanup with BaseTexture destroy
7300 * and not cleaning up resources that were created
7301 * externally.
7302 * @member {boolean} PIXI.resources.Resource#internal
7303 * @protected
7304 */
7305 protected internal: boolean;
7306 /**
7307 * Bind to a parent BaseTexture
7308 *
7309 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7310 */
7311 bind(baseTexture: PIXI.BaseTexture): void;
7312 /**
7313 * Unbind to a parent BaseTexture
7314 *
7315 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7316 */
7317 unbind(baseTexture: PIXI.BaseTexture): void;
7318 /**
7319 * Trigger a resize event
7320 * @param {number} width - X dimension
7321 * @param {number} height - Y dimension
7322 */
7323 resize(width: number, height: number): void;
7324 /**
7325 * Has been validated
7326 * @readonly
7327 * @member {boolean}
7328 */
7329 readonly valid: boolean;
7330 /**
7331 * Has been updated trigger event
7332 */
7333 update(): void;
7334 /**
7335 * This can be overridden to start preloading a resource
7336 * or do any other prepare step.
7337 * @protected
7338 * @return {Promise<void>} Handle the validate event
7339 */
7340 protected load(): Promise<void>;
7341 /**
7342 * The width of the resource.
7343 *
7344 * @member {number}
7345 * @readonly
7346 */
7347 readonly width: number;
7348 /**
7349 * The height of the resource.
7350 *
7351 * @member {number}
7352 * @readonly
7353 */
7354 readonly height: number;
7355 /**
7356 * Set the style, optional to override
7357 *
7358 * @param {PIXI.Renderer} renderer - yeah, renderer!
7359 * @param {PIXI.BaseTexture} baseTexture - the texture
7360 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
7361 * @returns {boolean} `true` is success
7362 */
7363 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7364 /**
7365 * Clean up anything, this happens when destroying is ready.
7366 *
7367 * @protected
7368 */
7369 protected dispose(): void;
7370 /**
7371 * Call when destroying resource, unbind any BaseTexture object
7372 * before calling this method, as reference counts are maintained
7373 * internally.
7374 */
7375 destroy(): void;
7376 }
7377 /**
7378 * Resource type for HTMLCanvasElement.
7379 * @class
7380 * @extends PIXI.resources.BaseImageResource
7381 * @memberof PIXI.resources
7382 * @param {HTMLCanvasElement} source - Canvas element to use
7383 */
7384 class CanvasResource extends PIXI.resources.BaseImageResource {
7385 constructor(source: HTMLCanvasElement);
7386 /**
7387 * Used to auto-detect the type of resource.
7388 *
7389 * @static
7390 * @param {HTMLCanvasElement|OffscreenCanvas} source - The source object
7391 * @return {boolean} `true` if source is HTMLCanvasElement or OffscreenCanvas
7392 */
7393 static test(source: HTMLCanvasElement | OffscreenCanvas): boolean;
7394 /**
7395 * The source element
7396 * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
7397 * @readonly
7398 */
7399 readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
7400 /**
7401 * Upload the texture to the GPU.
7402 * @param {PIXI.Renderer} renderer - Upload to the renderer
7403 * @param {PIXI.BaseTexture} baseTexture - Reference to parent texture
7404 * @param {PIXI.GLTexture} glTexture
7405 * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
7406 * @returns {boolean} true is success
7407 */
7408 upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
7409 /**
7410 * Checks if source width/height was changed, resize can cause extra baseTexture update.
7411 * Triggers one update in any case.
7412 */
7413 update(): void;
7414 /**
7415 * Clean up anything, this happens when destroying is ready.
7416 *
7417 * @protected
7418 */
7419 protected dispose(): void;
7420 /**
7421 * Internal width of the resource
7422 * @member {number} PIXI.resources.Resource#_width
7423 * @protected
7424 */
7425 protected _width: number;
7426 /**
7427 * Internal height of the resource
7428 * @member {number} PIXI.resources.Resource#_height
7429 * @protected
7430 */
7431 protected _height: number;
7432 /**
7433 * If resource has been destroyed
7434 * @member {boolean} PIXI.resources.Resource#destroyed
7435 * @readonly
7436 * @default false
7437 */
7438 readonly destroyed: boolean;
7439 /**
7440 * `true` if resource is created by BaseTexture
7441 * useful for doing cleanup with BaseTexture destroy
7442 * and not cleaning up resources that were created
7443 * externally.
7444 * @member {boolean} PIXI.resources.Resource#internal
7445 * @protected
7446 */
7447 protected internal: boolean;
7448 /**
7449 * Bind to a parent BaseTexture
7450 *
7451 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7452 */
7453 bind(baseTexture: PIXI.BaseTexture): void;
7454 /**
7455 * Unbind to a parent BaseTexture
7456 *
7457 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7458 */
7459 unbind(baseTexture: PIXI.BaseTexture): void;
7460 /**
7461 * Trigger a resize event
7462 * @param {number} width - X dimension
7463 * @param {number} height - Y dimension
7464 */
7465 resize(width: number, height: number): void;
7466 /**
7467 * Has been validated
7468 * @readonly
7469 * @member {boolean}
7470 */
7471 readonly valid: boolean;
7472 /**
7473 * This can be overridden to start preloading a resource
7474 * or do any other prepare step.
7475 * @protected
7476 * @return {Promise<void>} Handle the validate event
7477 */
7478 protected load(): Promise<void>;
7479 /**
7480 * The width of the resource.
7481 *
7482 * @member {number}
7483 * @readonly
7484 */
7485 readonly width: number;
7486 /**
7487 * The height of the resource.
7488 *
7489 * @member {number}
7490 * @readonly
7491 */
7492 readonly height: number;
7493 /**
7494 * Set the style, optional to override
7495 *
7496 * @param {PIXI.Renderer} renderer - yeah, renderer!
7497 * @param {PIXI.BaseTexture} baseTexture - the texture
7498 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
7499 * @returns {boolean} `true` is success
7500 */
7501 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7502 /**
7503 * Call when destroying resource, unbind any BaseTexture object
7504 * before calling this method, as reference counts are maintained
7505 * internally.
7506 */
7507 destroy(): void;
7508 }
7509 /**
7510 * Resource for a CubeTexture which contains six resources.
7511 *
7512 * @class
7513 * @extends PIXI.resources.ArrayResource
7514 * @memberof PIXI.resources
7515 * @param {Array<string|PIXI.resources.Resource>} [source] - Collection of URLs or resources
7516 * to use as the sides of the cube.
7517 * @param {object} [options] - ImageResource options
7518 * @param {number} [options.width] - Width of resource
7519 * @param {number} [options.height] - Height of resource
7520 * @param {number} [options.autoLoad=true] - Whether to auto-load resources
7521 * @param {number} [options.linkBaseTexture=true] - In case BaseTextures are supplied,
7522 * whether to copy them or use
7523 */
7524 class CubeResource extends PIXI.resources.ArrayResource {
7525 constructor(source?: (string | PIXI.resources.Resource)[], options?: {
7526 width?: number;
7527 height?: number;
7528 autoLoad?: number;
7529 linkBaseTexture?: number;
7530 });
7531 /**
7532 * In case BaseTextures are supplied, whether to use same resource or bind baseTexture itself
7533 * @member {boolean} PIXI.resources.CubeResource#linkBaseTexture
7534 * @protected
7535 */
7536 protected linkBaseTexture: boolean;
7537 /**
7538 * Upload the resource
7539 *
7540 * @returns {boolean} true is success
7541 */
7542 upload(): boolean;
7543 /**
7544 * Used to auto-detect the type of resource.
7545 *
7546 * @static
7547 * @param {object} source - The source object
7548 * @return {boolean} `true` if source is an array of 6 elements
7549 */
7550 static test(source: any): boolean;
7551 /**
7552 * Number of texture sides to store for CubeResources
7553 *
7554 * @name PIXI.resources.CubeResource.SIDES
7555 * @static
7556 * @member {number}
7557 * @default 6
7558 */
7559 static SIDES: number;
7560 /**
7561 * Set a baseTexture by ID,
7562 * ArrayResource just takes resource from it, nothing more
7563 *
7564 * @param {PIXI.BaseTexture} baseTexture
7565 * @param {number} index - Zero-based index of resource to set
7566 * @return {PIXI.resources.ArrayResource} Instance for chaining
7567 */
7568 addBaseTextureAt(baseTexture: PIXI.BaseTexture, index: number): PIXI.resources.ArrayResource;
7569 /**
7570 * Bind to a parent BaseTexture
7571 *
7572 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7573 */
7574 bind(baseTexture: PIXI.BaseTexture): void;
7575 /**
7576 * Internal width of the resource
7577 * @member {number} PIXI.resources.Resource#_width
7578 * @protected
7579 */
7580 protected _width: number;
7581 /**
7582 * Internal height of the resource
7583 * @member {number} PIXI.resources.Resource#_height
7584 * @protected
7585 */
7586 protected _height: number;
7587 /**
7588 * If resource has been destroyed
7589 * @member {boolean} PIXI.resources.Resource#destroyed
7590 * @readonly
7591 * @default false
7592 */
7593 readonly destroyed: boolean;
7594 /**
7595 * `true` if resource is created by BaseTexture
7596 * useful for doing cleanup with BaseTexture destroy
7597 * and not cleaning up resources that were created
7598 * externally.
7599 * @member {boolean} PIXI.resources.Resource#internal
7600 * @protected
7601 */
7602 protected internal: boolean;
7603 /**
7604 * Unbind to a parent BaseTexture
7605 *
7606 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7607 */
7608 unbind(baseTexture: PIXI.BaseTexture): void;
7609 /**
7610 * Trigger a resize event
7611 * @param {number} width - X dimension
7612 * @param {number} height - Y dimension
7613 */
7614 resize(width: number, height: number): void;
7615 /**
7616 * Has been validated
7617 * @readonly
7618 * @member {boolean}
7619 */
7620 readonly valid: boolean;
7621 /**
7622 * Has been updated trigger event
7623 */
7624 update(): void;
7625 /**
7626 * This can be overridden to start preloading a resource
7627 * or do any other prepare step.
7628 * @protected
7629 * @return {Promise<void>} Handle the validate event
7630 */
7631 protected load(): Promise<void>;
7632 /**
7633 * The width of the resource.
7634 *
7635 * @member {number}
7636 * @readonly
7637 */
7638 readonly width: number;
7639 /**
7640 * The height of the resource.
7641 *
7642 * @member {number}
7643 * @readonly
7644 */
7645 readonly height: number;
7646 /**
7647 * Set the style, optional to override
7648 *
7649 * @param {PIXI.Renderer} renderer - yeah, renderer!
7650 * @param {PIXI.BaseTexture} baseTexture - the texture
7651 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
7652 * @returns {boolean} `true` is success
7653 */
7654 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7655 /**
7656 * Clean up anything, this happens when destroying is ready.
7657 *
7658 * @protected
7659 */
7660 protected dispose(): void;
7661 /**
7662 * Call when destroying resource, unbind any BaseTexture object
7663 * before calling this method, as reference counts are maintained
7664 * internally.
7665 */
7666 destroy(): void;
7667 }
7668 /**
7669 * Resource type for DepthTexture.
7670 * @class
7671 * @extends PIXI.resources.BufferResource
7672 * @memberof PIXI.resources
7673 */
7674 class DepthResource extends PIXI.resources.BufferResource {
7675 /**
7676 * Upload the texture to the GPU.
7677 * @param {PIXI.Renderer} renderer - Upload to the renderer
7678 * @param {PIXI.BaseTexture} baseTexture - Reference to parent texture
7679 * @param {PIXI.GLTexture} glTexture - glTexture
7680 * @returns {boolean} true is success
7681 */
7682 upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7683 /**
7684 * Source array
7685 * Cannot be ClampedUint8Array because it cant be uploaded to WebGL
7686 *
7687 * @member {Float32Array|Uint8Array|Uint32Array} PIXI.resources.BufferResource#data
7688 */
7689 data: Float32Array | Uint8Array | Uint32Array;
7690 /**
7691 * Clean up anything, this happens when destroying is ready.
7692 *
7693 * @protected
7694 */
7695 protected dispose(): void;
7696 /**
7697 * Internal width of the resource
7698 * @member {number} PIXI.resources.Resource#_width
7699 * @protected
7700 */
7701 protected _width: number;
7702 /**
7703 * Internal height of the resource
7704 * @member {number} PIXI.resources.Resource#_height
7705 * @protected
7706 */
7707 protected _height: number;
7708 /**
7709 * If resource has been destroyed
7710 * @member {boolean} PIXI.resources.Resource#destroyed
7711 * @readonly
7712 * @default false
7713 */
7714 readonly destroyed: boolean;
7715 /**
7716 * `true` if resource is created by BaseTexture
7717 * useful for doing cleanup with BaseTexture destroy
7718 * and not cleaning up resources that were created
7719 * externally.
7720 * @member {boolean} PIXI.resources.Resource#internal
7721 * @protected
7722 */
7723 protected internal: boolean;
7724 /**
7725 * Bind to a parent BaseTexture
7726 *
7727 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7728 */
7729 bind(baseTexture: PIXI.BaseTexture): void;
7730 /**
7731 * Unbind to a parent BaseTexture
7732 *
7733 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7734 */
7735 unbind(baseTexture: PIXI.BaseTexture): void;
7736 /**
7737 * Trigger a resize event
7738 * @param {number} width - X dimension
7739 * @param {number} height - Y dimension
7740 */
7741 resize(width: number, height: number): void;
7742 /**
7743 * Has been validated
7744 * @readonly
7745 * @member {boolean}
7746 */
7747 readonly valid: boolean;
7748 /**
7749 * Has been updated trigger event
7750 */
7751 update(): void;
7752 /**
7753 * This can be overridden to start preloading a resource
7754 * or do any other prepare step.
7755 * @protected
7756 * @return {Promise<void>} Handle the validate event
7757 */
7758 protected load(): Promise<void>;
7759 /**
7760 * The width of the resource.
7761 *
7762 * @member {number}
7763 * @readonly
7764 */
7765 readonly width: number;
7766 /**
7767 * The height of the resource.
7768 *
7769 * @member {number}
7770 * @readonly
7771 */
7772 readonly height: number;
7773 /**
7774 * Set the style, optional to override
7775 *
7776 * @param {PIXI.Renderer} renderer - yeah, renderer!
7777 * @param {PIXI.BaseTexture} baseTexture - the texture
7778 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
7779 * @returns {boolean} `true` is success
7780 */
7781 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7782 /**
7783 * Call when destroying resource, unbind any BaseTexture object
7784 * before calling this method, as reference counts are maintained
7785 * internally.
7786 */
7787 destroy(): void;
7788 }
7789 /**
7790 * Resource type for ImageBitmap.
7791 * @class
7792 * @extends PIXI.resources.BaseImageResource
7793 * @memberof PIXI.resources
7794 * @param {ImageBitmap} source - Image element to use
7795 */
7796 class ImageBitmapResource extends PIXI.resources.BaseImageResource {
7797 constructor(source: ImageBitmap);
7798 /**
7799 * Used to auto-detect the type of resource.
7800 *
7801 * @static
7802 * @param {ImageBitmap} source - The source object
7803 * @return {boolean} `true` if source is an ImageBitmap
7804 */
7805 static test(source: ImageBitmap): boolean;
7806 /**
7807 * The source element
7808 * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
7809 * @readonly
7810 */
7811 readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
7812 /**
7813 * Upload the texture to the GPU.
7814 * @param {PIXI.Renderer} renderer - Upload to the renderer
7815 * @param {PIXI.BaseTexture} baseTexture - Reference to parent texture
7816 * @param {PIXI.GLTexture} glTexture
7817 * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
7818 * @returns {boolean} true is success
7819 */
7820 upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
7821 /**
7822 * Checks if source width/height was changed, resize can cause extra baseTexture update.
7823 * Triggers one update in any case.
7824 */
7825 update(): void;
7826 /**
7827 * Clean up anything, this happens when destroying is ready.
7828 *
7829 * @protected
7830 */
7831 protected dispose(): void;
7832 /**
7833 * Internal width of the resource
7834 * @member {number} PIXI.resources.Resource#_width
7835 * @protected
7836 */
7837 protected _width: number;
7838 /**
7839 * Internal height of the resource
7840 * @member {number} PIXI.resources.Resource#_height
7841 * @protected
7842 */
7843 protected _height: number;
7844 /**
7845 * If resource has been destroyed
7846 * @member {boolean} PIXI.resources.Resource#destroyed
7847 * @readonly
7848 * @default false
7849 */
7850 readonly destroyed: boolean;
7851 /**
7852 * `true` if resource is created by BaseTexture
7853 * useful for doing cleanup with BaseTexture destroy
7854 * and not cleaning up resources that were created
7855 * externally.
7856 * @member {boolean} PIXI.resources.Resource#internal
7857 * @protected
7858 */
7859 protected internal: boolean;
7860 /**
7861 * Bind to a parent BaseTexture
7862 *
7863 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7864 */
7865 bind(baseTexture: PIXI.BaseTexture): void;
7866 /**
7867 * Unbind to a parent BaseTexture
7868 *
7869 * @param {PIXI.BaseTexture} baseTexture - Parent texture
7870 */
7871 unbind(baseTexture: PIXI.BaseTexture): void;
7872 /**
7873 * Trigger a resize event
7874 * @param {number} width - X dimension
7875 * @param {number} height - Y dimension
7876 */
7877 resize(width: number, height: number): void;
7878 /**
7879 * Has been validated
7880 * @readonly
7881 * @member {boolean}
7882 */
7883 readonly valid: boolean;
7884 /**
7885 * This can be overridden to start preloading a resource
7886 * or do any other prepare step.
7887 * @protected
7888 * @return {Promise<void>} Handle the validate event
7889 */
7890 protected load(): Promise<void>;
7891 /**
7892 * The width of the resource.
7893 *
7894 * @member {number}
7895 * @readonly
7896 */
7897 readonly width: number;
7898 /**
7899 * The height of the resource.
7900 *
7901 * @member {number}
7902 * @readonly
7903 */
7904 readonly height: number;
7905 /**
7906 * Set the style, optional to override
7907 *
7908 * @param {PIXI.Renderer} renderer - yeah, renderer!
7909 * @param {PIXI.BaseTexture} baseTexture - the texture
7910 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
7911 * @returns {boolean} `true` is success
7912 */
7913 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7914 /**
7915 * Call when destroying resource, unbind any BaseTexture object
7916 * before calling this method, as reference counts are maintained
7917 * internally.
7918 */
7919 destroy(): void;
7920 }
7921 /**
7922 * Resource type for HTMLImageElement.
7923 * @class
7924 * @extends PIXI.resources.BaseImageResource
7925 * @memberof PIXI.resources
7926 */
7927 class ImageResource extends PIXI.resources.BaseImageResource {
7928 constructor(source: HTMLImageElement | string, options?: {
7929 autoLoad?: boolean;
7930 createBitmap?: boolean;
7931 crossorigin?: boolean;
7932 alphaMode?: PIXI.ALPHA_MODES;
7933 });
7934 /**
7935 * URL of the image source
7936 * @member {string} PIXI.resources.ImageResource#url
7937 */
7938 url: string;
7939 /**
7940 * If the image should be disposed after upload
7941 * @member {boolean} PIXI.resources.ImageResource#preserveBitmap
7942 * @default false
7943 */
7944 preserveBitmap: boolean;
7945 /**
7946 * If capable, convert the image using createImageBitmap API
7947 * @member {boolean} PIXI.resources.ImageResource#createBitmap
7948 * @default PIXI.settings.CREATE_IMAGE_BITMAP
7949 */
7950 createBitmap: boolean;
7951 /**
7952 * Controls texture alphaMode field
7953 * Copies from options
7954 * Default is `null`, copies option from baseTexture
7955 *
7956 * @member {PIXI.ALPHA_MODES|null} PIXI.resources.ImageResource#alphaMode
7957 * @readonly
7958 */
7959 readonly alphaMode: PIXI.ALPHA_MODES | null;
7960 /**
7961 * The ImageBitmap element created for HTMLImageElement
7962 * @member {ImageBitmap} PIXI.resources.ImageResource#bitmap
7963 * @default null
7964 */
7965 bitmap: ImageBitmap;
7966 /**
7967 * returns a promise when image will be loaded and processed
7968 *
7969 * @param {boolean} [createBitmap] - whether process image into bitmap
7970 * @returns {Promise<void>}
7971 */
7972 load(createBitmap?: boolean): Promise<void>;
7973 /**
7974 * Called when we need to convert image into BitmapImage.
7975 * Can be called multiple times, real promise is cached inside.
7976 *
7977 * @returns {Promise<void>} cached promise to fill that bitmap
7978 */
7979 process(): Promise<void>;
7980 /**
7981 * Upload the image resource to GPU.
7982 *
7983 * @param {PIXI.Renderer} renderer - Renderer to upload to
7984 * @param {PIXI.BaseTexture} baseTexture - BaseTexture for this resource
7985 * @param {PIXI.GLTexture} glTexture - GLTexture to use
7986 * @returns {boolean} true is success
7987 */
7988 upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
7989 /**
7990 * Used to auto-detect the type of resource.
7991 *
7992 * @static
7993 * @param {string|HTMLImageElement} source - The source object
7994 * @return {boolean} `true` if source is string or HTMLImageElement
7995 */
7996 static test(source: string | HTMLImageElement): boolean;
7997 /**
7998 * The source element
7999 * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
8000 * @readonly
8001 */
8002 readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
8003 /**
8004 * Checks if source width/height was changed, resize can cause extra baseTexture update.
8005 * Triggers one update in any case.
8006 */
8007 update(): void;
8008 /**
8009 * Clean up anything, this happens when destroying is ready.
8010 *
8011 * @protected
8012 */
8013 protected dispose(): void;
8014 /**
8015 * Internal width of the resource
8016 * @member {number} PIXI.resources.Resource#_width
8017 * @protected
8018 */
8019 protected _width: number;
8020 /**
8021 * Internal height of the resource
8022 * @member {number} PIXI.resources.Resource#_height
8023 * @protected
8024 */
8025 protected _height: number;
8026 /**
8027 * If resource has been destroyed
8028 * @member {boolean} PIXI.resources.Resource#destroyed
8029 * @readonly
8030 * @default false
8031 */
8032 readonly destroyed: boolean;
8033 /**
8034 * `true` if resource is created by BaseTexture
8035 * useful for doing cleanup with BaseTexture destroy
8036 * and not cleaning up resources that were created
8037 * externally.
8038 * @member {boolean} PIXI.resources.Resource#internal
8039 * @protected
8040 */
8041 protected internal: boolean;
8042 /**
8043 * Bind to a parent BaseTexture
8044 *
8045 * @param {PIXI.BaseTexture} baseTexture - Parent texture
8046 */
8047 bind(baseTexture: PIXI.BaseTexture): void;
8048 /**
8049 * Unbind to a parent BaseTexture
8050 *
8051 * @param {PIXI.BaseTexture} baseTexture - Parent texture
8052 */
8053 unbind(baseTexture: PIXI.BaseTexture): void;
8054 /**
8055 * Trigger a resize event
8056 * @param {number} width - X dimension
8057 * @param {number} height - Y dimension
8058 */
8059 resize(width: number, height: number): void;
8060 /**
8061 * Has been validated
8062 * @readonly
8063 * @member {boolean}
8064 */
8065 readonly valid: boolean;
8066 /**
8067 * The width of the resource.
8068 *
8069 * @member {number}
8070 * @readonly
8071 */
8072 readonly width: number;
8073 /**
8074 * The height of the resource.
8075 *
8076 * @member {number}
8077 * @readonly
8078 */
8079 readonly height: number;
8080 /**
8081 * Set the style, optional to override
8082 *
8083 * @param {PIXI.Renderer} renderer - yeah, renderer!
8084 * @param {PIXI.BaseTexture} baseTexture - the texture
8085 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
8086 * @returns {boolean} `true` is success
8087 */
8088 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
8089 /**
8090 * Call when destroying resource, unbind any BaseTexture object
8091 * before calling this method, as reference counts are maintained
8092 * internally.
8093 */
8094 destroy(): void;
8095 }
8096 /**
8097 * Base resource class for textures that manages validation and uploading, depending on its type.
8098 *
8099 * Uploading of a base texture to the GPU is required.
8100 *
8101 * @class
8102 * @memberof PIXI.resources
8103 */
8104 class Resource {
8105 constructor(width?: number, height?: number);
8106 /**
8107 * Internal width of the resource
8108 * @member {number} PIXI.resources.Resource#_width
8109 * @protected
8110 */
8111 protected _width: number;
8112 /**
8113 * Internal height of the resource
8114 * @member {number} PIXI.resources.Resource#_height
8115 * @protected
8116 */
8117 protected _height: number;
8118 /**
8119 * If resource has been destroyed
8120 * @member {boolean} PIXI.resources.Resource#destroyed
8121 * @readonly
8122 * @default false
8123 */
8124 readonly destroyed: boolean;
8125 /**
8126 * `true` if resource is created by BaseTexture
8127 * useful for doing cleanup with BaseTexture destroy
8128 * and not cleaning up resources that were created
8129 * externally.
8130 * @member {boolean} PIXI.resources.Resource#internal
8131 * @protected
8132 */
8133 protected internal: boolean;
8134 /**
8135 * Bind to a parent BaseTexture
8136 *
8137 * @param {PIXI.BaseTexture} baseTexture - Parent texture
8138 */
8139 bind(baseTexture: PIXI.BaseTexture): void;
8140 /**
8141 * Unbind to a parent BaseTexture
8142 *
8143 * @param {PIXI.BaseTexture} baseTexture - Parent texture
8144 */
8145 unbind(baseTexture: PIXI.BaseTexture): void;
8146 /**
8147 * Trigger a resize event
8148 * @param {number} width - X dimension
8149 * @param {number} height - Y dimension
8150 */
8151 resize(width: number, height: number): void;
8152 /**
8153 * Has been validated
8154 * @readonly
8155 * @member {boolean}
8156 */
8157 readonly valid: boolean;
8158 /**
8159 * Has been updated trigger event
8160 */
8161 update(): void;
8162 /**
8163 * This can be overridden to start preloading a resource
8164 * or do any other prepare step.
8165 * @protected
8166 * @return {Promise<void>} Handle the validate event
8167 */
8168 protected load(): Promise<void>;
8169 /**
8170 * The width of the resource.
8171 *
8172 * @member {number}
8173 * @readonly
8174 */
8175 readonly width: number;
8176 /**
8177 * The height of the resource.
8178 *
8179 * @member {number}
8180 * @readonly
8181 */
8182 readonly height: number;
8183 /**
8184 * Set the style, optional to override
8185 *
8186 * @param {PIXI.Renderer} renderer - yeah, renderer!
8187 * @param {PIXI.BaseTexture} baseTexture - the texture
8188 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
8189 * @returns {boolean} `true` is success
8190 */
8191 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
8192 /**
8193 * Clean up anything, this happens when destroying is ready.
8194 *
8195 * @protected
8196 */
8197 protected dispose(): void;
8198 /**
8199 * Call when destroying resource, unbind any BaseTexture object
8200 * before calling this method, as reference counts are maintained
8201 * internally.
8202 */
8203 destroy(): void;
8204 /**
8205 * Abstract, used to auto-detect resource type
8206 *
8207 * @static
8208 * @param {*} source - The source object
8209 * @param {string} extension - The extension of source, if set
8210 */
8211 static test(source: any, extension: string): void;
8212 }
8213 /**
8214 * Resource type for SVG elements and graphics.
8215 * @class
8216 * @extends PIXI.resources.BaseImageResource
8217 * @memberof PIXI.resources
8218 * @param {string} source - Base64 encoded SVG element or URL for SVG file.
8219 * @param {object} [options] - Options to use
8220 * @param {number} [options.scale=1] - Scale to apply to SVG. Overridden by...
8221 * @param {number} [options.width] - Rasterize SVG this wide. Aspect ratio preserved if height not specified.
8222 * @param {number} [options.height] - Rasterize SVG this high. Aspect ratio preserved if width not specified.
8223 * @param {boolean} [options.autoLoad=true] - Start loading right away.
8224 */
8225 class SVGResource extends PIXI.resources.BaseImageResource {
8226 constructor(source: string, options?: {
8227 scale?: number;
8228 width?: number;
8229 height?: number;
8230 autoLoad?: boolean;
8231 });
8232 /**
8233 * Base64 encoded SVG element or URL for SVG file
8234 * @readonly
8235 * @member {string} PIXI.resources.SVGResource#svg
8236 */
8237 readonly svg: string;
8238 /**
8239 * The source scale to apply when rasterizing on load
8240 * @readonly
8241 * @member {number} PIXI.resources.SVGResource#scale
8242 */
8243 readonly scale: number;
8244 /**
8245 * A width override for rasterization on load
8246 * @readonly
8247 * @member {number} PIXI.resources.SVGResource#_overrideWidth
8248 */
8249 readonly _overrideWidth: number;
8250 /**
8251 * A height override for rasterization on load
8252 * @readonly
8253 * @member {number} PIXI.resources.SVGResource#_overrideHeight
8254 */
8255 readonly _overrideHeight: number;
8256 /**
8257 * Get size from an svg string using regexp.
8258 *
8259 * @method
8260 * @param {string} svgString - a serialized svg element
8261 * @return {PIXI.ISize} image extension
8262 */
8263 static getSize(svgString: string): PIXI.ISize;
8264 /**
8265 * Used to auto-detect the type of resource.
8266 *
8267 * @static
8268 * @param {*} source - The source object
8269 * @param {string} extension - The extension of source, if set
8270 */
8271 static test(source: any, extension: string): void;
8272 /**
8273 * RegExp for SVG size.
8274 *
8275 * @static
8276 * @constant {RegExp|string} SVG_SIZE
8277 * @memberof PIXI.resources.SVGResource
8278 * @example &lt;svg width="100" height="100"&gt;&lt;/svg&gt;
8279 */
8280 static readonly SVG_SIZE: RegExp | string;
8281 /**
8282 * The source element
8283 * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
8284 * @readonly
8285 */
8286 readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
8287 /**
8288 * Upload the texture to the GPU.
8289 * @param {PIXI.Renderer} renderer - Upload to the renderer
8290 * @param {PIXI.BaseTexture} baseTexture - Reference to parent texture
8291 * @param {PIXI.GLTexture} glTexture
8292 * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
8293 * @returns {boolean} true is success
8294 */
8295 upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
8296 /**
8297 * Checks if source width/height was changed, resize can cause extra baseTexture update.
8298 * Triggers one update in any case.
8299 */
8300 update(): void;
8301 /**
8302 * Clean up anything, this happens when destroying is ready.
8303 *
8304 * @protected
8305 */
8306 protected dispose(): void;
8307 /**
8308 * Internal width of the resource
8309 * @member {number} PIXI.resources.Resource#_width
8310 * @protected
8311 */
8312 protected _width: number;
8313 /**
8314 * Internal height of the resource
8315 * @member {number} PIXI.resources.Resource#_height
8316 * @protected
8317 */
8318 protected _height: number;
8319 /**
8320 * If resource has been destroyed
8321 * @member {boolean} PIXI.resources.Resource#destroyed
8322 * @readonly
8323 * @default false
8324 */
8325 readonly destroyed: boolean;
8326 /**
8327 * `true` if resource is created by BaseTexture
8328 * useful for doing cleanup with BaseTexture destroy
8329 * and not cleaning up resources that were created
8330 * externally.
8331 * @member {boolean} PIXI.resources.Resource#internal
8332 * @protected
8333 */
8334 protected internal: boolean;
8335 /**
8336 * Bind to a parent BaseTexture
8337 *
8338 * @param {PIXI.BaseTexture} baseTexture - Parent texture
8339 */
8340 bind(baseTexture: PIXI.BaseTexture): void;
8341 /**
8342 * Unbind to a parent BaseTexture
8343 *
8344 * @param {PIXI.BaseTexture} baseTexture - Parent texture
8345 */
8346 unbind(baseTexture: PIXI.BaseTexture): void;
8347 /**
8348 * Trigger a resize event
8349 * @param {number} width - X dimension
8350 * @param {number} height - Y dimension
8351 */
8352 resize(width: number, height: number): void;
8353 /**
8354 * Has been validated
8355 * @readonly
8356 * @member {boolean}
8357 */
8358 readonly valid: boolean;
8359 /**
8360 * This can be overridden to start preloading a resource
8361 * or do any other prepare step.
8362 * @protected
8363 * @return {Promise<void>} Handle the validate event
8364 */
8365 protected load(): Promise<void>;
8366 /**
8367 * The width of the resource.
8368 *
8369 * @member {number}
8370 * @readonly
8371 */
8372 readonly width: number;
8373 /**
8374 * The height of the resource.
8375 *
8376 * @member {number}
8377 * @readonly
8378 */
8379 readonly height: number;
8380 /**
8381 * Set the style, optional to override
8382 *
8383 * @param {PIXI.Renderer} renderer - yeah, renderer!
8384 * @param {PIXI.BaseTexture} baseTexture - the texture
8385 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
8386 * @returns {boolean} `true` is success
8387 */
8388 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
8389 /**
8390 * Call when destroying resource, unbind any BaseTexture object
8391 * before calling this method, as reference counts are maintained
8392 * internally.
8393 */
8394 destroy(): void;
8395 }
8396 /**
8397 * Resource type for HTMLVideoElement.
8398 * @class
8399 * @extends PIXI.resources.BaseImageResource
8400 * @memberof PIXI.resources
8401 * @param {HTMLVideoElement|object|string|Array<string|object>} source - Video element to use.
8402 * @param {object} [options] - Options to use
8403 * @param {boolean} [options.autoLoad=true] - Start loading the video immediately
8404 * @param {boolean} [options.autoPlay=true] - Start playing video immediately
8405 * @param {number} [options.updateFPS=0] - How many times a second to update the texture from the video.
8406 * Leave at 0 to update at every render.
8407 * @param {boolean} [options.crossorigin=true] - Load image using cross origin
8408 */
8409 class VideoResource extends PIXI.resources.BaseImageResource {
8410 constructor(source: HTMLVideoElement | any | string | (string | any)[], options?: {
8411 autoLoad?: boolean;
8412 autoPlay?: boolean;
8413 updateFPS?: number;
8414 crossorigin?: boolean;
8415 });
8416 /**
8417 * When set to true will automatically play videos used by this texture once
8418 * they are loaded. If false, it will not modify the playing state.
8419 *
8420 * @member {boolean} PIXI.resources.VideoResource#autoPlay
8421 * @default true
8422 */
8423 autoPlay: boolean;
8424 /**
8425 * Trigger updating of the texture
8426 *
8427 * @param {number} [deltaTime=0] - time delta since last tick
8428 */
8429 update(deltaTime?: number): void;
8430 /**
8431 * Start preloading the video resource.
8432 *
8433 * @protected
8434 * @return {Promise<void>} Handle the validate event
8435 */
8436 protected load(): Promise<void>;
8437 /**
8438 * Should the base texture automatically update itself, set to true by default
8439 *
8440 * @member {boolean}
8441 */
8442 autoUpdate: boolean;
8443 /**
8444 * How many times a second to update the texture from the video. Leave at 0 to update at every render.
8445 * A lower fps can help performance, as updating the texture at 60fps on a 30ps video may not be efficient.
8446 *
8447 * @member {number}
8448 */
8449 updateFPS: number;
8450 /**
8451 * Used to auto-detect the type of resource.
8452 *
8453 * @static
8454 * @param {*} source - The source object
8455 * @param {string} extension - The extension of source, if set
8456 * @return {boolean} `true` if video source
8457 */
8458 static test(source: any, extension: string): boolean;
8459 /**
8460 * List of common video file extensions supported by VideoResource.
8461 * @constant
8462 * @member {Array<string>}
8463 * @static
8464 * @readonly
8465 */
8466 static readonly TYPES: string[];
8467 /**
8468 * Map of video MIME types that can't be directly derived from file extensions.
8469 * @constant
8470 * @member {object}
8471 * @static
8472 * @readonly
8473 */
8474 static readonly MIME_TYPES: any;
8475 /**
8476 * The source element
8477 * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
8478 * @readonly
8479 */
8480 readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
8481 /**
8482 * Upload the texture to the GPU.
8483 * @param {PIXI.Renderer} renderer - Upload to the renderer
8484 * @param {PIXI.BaseTexture} baseTexture - Reference to parent texture
8485 * @param {PIXI.GLTexture} glTexture
8486 * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
8487 * @returns {boolean} true is success
8488 */
8489 upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
8490 /**
8491 * Clean up anything, this happens when destroying is ready.
8492 *
8493 * @protected
8494 */
8495 protected dispose(): void;
8496 /**
8497 * Internal width of the resource
8498 * @member {number} PIXI.resources.Resource#_width
8499 * @protected
8500 */
8501 protected _width: number;
8502 /**
8503 * Internal height of the resource
8504 * @member {number} PIXI.resources.Resource#_height
8505 * @protected
8506 */
8507 protected _height: number;
8508 /**
8509 * If resource has been destroyed
8510 * @member {boolean} PIXI.resources.Resource#destroyed
8511 * @readonly
8512 * @default false
8513 */
8514 readonly destroyed: boolean;
8515 /**
8516 * `true` if resource is created by BaseTexture
8517 * useful for doing cleanup with BaseTexture destroy
8518 * and not cleaning up resources that were created
8519 * externally.
8520 * @member {boolean} PIXI.resources.Resource#internal
8521 * @protected
8522 */
8523 protected internal: boolean;
8524 /**
8525 * Bind to a parent BaseTexture
8526 *
8527 * @param {PIXI.BaseTexture} baseTexture - Parent texture
8528 */
8529 bind(baseTexture: PIXI.BaseTexture): void;
8530 /**
8531 * Unbind to a parent BaseTexture
8532 *
8533 * @param {PIXI.BaseTexture} baseTexture - Parent texture
8534 */
8535 unbind(baseTexture: PIXI.BaseTexture): void;
8536 /**
8537 * Trigger a resize event
8538 * @param {number} width - X dimension
8539 * @param {number} height - Y dimension
8540 */
8541 resize(width: number, height: number): void;
8542 /**
8543 * Has been validated
8544 * @readonly
8545 * @member {boolean}
8546 */
8547 readonly valid: boolean;
8548 /**
8549 * The width of the resource.
8550 *
8551 * @member {number}
8552 * @readonly
8553 */
8554 readonly width: number;
8555 /**
8556 * The height of the resource.
8557 *
8558 * @member {number}
8559 * @readonly
8560 */
8561 readonly height: number;
8562 /**
8563 * Set the style, optional to override
8564 *
8565 * @param {PIXI.Renderer} renderer - yeah, renderer!
8566 * @param {PIXI.BaseTexture} baseTexture - the texture
8567 * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
8568 * @returns {boolean} `true` is success
8569 */
8570 style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
8571 /**
8572 * Call when destroying resource, unbind any BaseTexture object
8573 * before calling this method, as reference counts are maintained
8574 * internally.
8575 */
8576 destroy(): void;
8577 }
8578 /**
8579 * Collection of installed resource types, class must extend {@link PIXI.resources.Resource}.
8580 * @example
8581 * class CustomResource extends PIXI.resources.Resource {
8582 * // MUST have source, options constructor signature
8583 * // for auto-detected resources to be created.
8584 * constructor(source, options) {
8585 * super();
8586 * }
8587 * upload(renderer, baseTexture, glTexture) {
8588 * // upload with GL
8589 * return true;
8590 * }
8591 * // used to auto-detect resource
8592 * static test(source, extension) {
8593 * return extension === 'xyz'|| source instanceof SomeClass;
8594 * }
8595 * }
8596 * // Install the new resource type
8597 * PIXI.resources.INSTALLED.push(CustomResource);
8598 *
8599 * @name PIXI.resources.INSTALLED
8600 * @type {Array<*>}
8601 * @static
8602 * @readonly
8603 */
8604 var INSTALLED: any[];
8605 /**
8606 * Create a resource element from a single source element. This
8607 * auto-detects which type of resource to create. All resources that
8608 * are auto-detectable must have a static `test` method and a constructor
8609 * with the arguments `(source, options?)`. Currently, the supported
8610 * resources for auto-detection include:
8611 * - {@link PIXI.resources.ImageResource}
8612 * - {@link PIXI.resources.CanvasResource}
8613 * - {@link PIXI.resources.VideoResource}
8614 * - {@link PIXI.resources.SVGResource}
8615 * - {@link PIXI.resources.BufferResource}
8616 * @static
8617 * @function PIXI.resources.autoDetectResource
8618 * @param {string|*} source - Resource source, this can be the URL to the resource,
8619 * a typed-array (for BufferResource), HTMLVideoElement, SVG data-uri
8620 * or any other resource that can be auto-detected. If not resource is
8621 * detected, it's assumed to be an ImageResource.
8622 * @param {object} [options] - Pass-through options to use for Resource
8623 * @param {number} [options.width] - Width of BufferResource or SVG rasterization
8624 * @param {number} [options.height] - Height of BufferResource or SVG rasterization
8625 * @param {boolean} [options.autoLoad=true] - Image, SVG and Video flag to start loading
8626 * @param {number} [options.scale=1] - SVG source scale. Overridden by width, height
8627 * @param {boolean} [options.createBitmap=PIXI.settings.CREATE_IMAGE_BITMAP] - Image option to create Bitmap object
8628 * @param {boolean} [options.crossorigin=true] - Image and Video option to set crossOrigin
8629 * @param {boolean} [options.autoPlay=true] - Video option to start playing video immediately
8630 * @param {number} [options.updateFPS=0] - Video option to update how many times a second the
8631 * texture should be updated from the video. Leave at 0 to update at every render
8632 * @return {PIXI.resources.Resource} The created resource.
8633 */
8634 function autoDetectResource(source: string | any, options?: {
8635 width?: number;
8636 height?: number;
8637 autoLoad?: boolean;
8638 scale?: number;
8639 createBitmap?: boolean;
8640 crossorigin?: boolean;
8641 autoPlay?: boolean;
8642 updateFPS?: number;
8643 }): PIXI.resources.Resource;
8644 }
8645 /**
8646 * Helper class to create a quad
8647 *
8648 * @class
8649 * @memberof PIXI
8650 */
8651 class Quad {
8652 constructor();
8653 }
8654 /**
8655 * Helper class to create a quad with uvs like in v4
8656 *
8657 * @class
8658 * @memberof PIXI
8659 * @extends PIXI.Geometry
8660 */
8661 class QuadUv extends PIXI.Geometry {
8662 constructor();
8663 /**
8664 * An array of vertices
8665 *
8666 * @member {Float32Array} PIXI.QuadUv#vertices
8667 */
8668 vertices: Float32Array;
8669 /**
8670 * The Uvs of the quad
8671 *
8672 * @member {Float32Array} PIXI.QuadUv#uvs
8673 */
8674 uvs: Float32Array;
8675 /**
8676 * Maps two Rectangle to the quad.
8677 *
8678 * @param {PIXI.Rectangle} targetTextureFrame - the first rectangle
8679 * @param {PIXI.Rectangle} destinationFrame - the second rectangle
8680 * @return {PIXI.Quad} Returns itself.
8681 */
8682 map(targetTextureFrame: PIXI.Rectangle, destinationFrame: PIXI.Rectangle): PIXI.Quad;
8683 /**
8684 * legacy upload method, just marks buffers dirty
8685 * @returns {PIXI.QuadUv} Returns itself.
8686 */
8687 invalidate(): PIXI.QuadUv;
8688 /**
8689 * A map of renderer IDs to webgl VAOs
8690 *
8691 * @protected
8692 * @type {object}
8693 */
8694 protected glVertexArrayObjects: any;
8695 /**
8696 * Number of instances in this geometry, pass it to `GeometrySystem.draw()`
8697 * @member {number} PIXI.Geometry#instanceCount
8698 * @default 1
8699 */
8700 instanceCount: number;
8701 /**
8702 * Count of existing (not destroyed) meshes that reference this geometry
8703 * @member {number} PIXI.Geometry#refCount
8704 */
8705 refCount: number;
8706 /**
8707 *
8708 * Adds an attribute to the geometry
8709 * Note: `stride` and `start` should be `undefined` if you dont know them, not 0!
8710 *
8711 * @param {String} id - the name of the attribute (matching up to a shader)
8712 * @param {PIXI.Buffer|number[]} [buffer] - the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
8713 * @param {Number} [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
8714 * @param {Boolean} [normalized=false] - should the data be normalized.
8715 * @param {Number} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {PIXI.TYPES} to see the ones available
8716 * @param {Number} [stride] - How far apart (in floats) the start of each value is. (used for interleaving data)
8717 * @param {Number} [start] - How far into the array to start reading values (used for interleaving data)
8718 * @param {boolean} [instance=false] - Instancing flag
8719 *
8720 * @return {PIXI.Geometry} returns self, useful for chaining.
8721 */
8722 addAttribute(id: string, buffer?: PIXI.Buffer | number[], size?: number, normalized?: boolean, type?: number, stride?: number, start?: number, instance?: boolean): PIXI.Geometry;
8723 /**
8724 * returns the requested attribute
8725 *
8726 * @param {String} id - the name of the attribute required
8727 * @return {PIXI.Attribute} the attribute requested.
8728 */
8729 getAttribute(id: string): PIXI.Attribute;
8730 /**
8731 * returns the requested buffer
8732 *
8733 * @param {String} id - the name of the buffer required
8734 * @return {PIXI.Buffer} the buffer requested.
8735 */
8736 getBuffer(id: string): PIXI.Buffer;
8737 /**
8738 *
8739 * Adds an index buffer to the geometry
8740 * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
8741 *
8742 * @param {PIXI.Buffer|number[]} [buffer] - the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
8743 * @return {PIXI.Geometry} returns self, useful for chaining.
8744 */
8745 addIndex(buffer?: PIXI.Buffer | number[]): PIXI.Geometry;
8746 /**
8747 * returns the index buffer
8748 *
8749 * @return {PIXI.Buffer} the index buffer.
8750 */
8751 getIndex(): PIXI.Buffer;
8752 /**
8753 * this function modifies the structure so that all current attributes become interleaved into a single buffer
8754 * This can be useful if your model remains static as it offers a little performance boost
8755 *
8756 * @return {PIXI.Geometry} returns self, useful for chaining.
8757 */
8758 interleave(): PIXI.Geometry;
8759 /**
8760 * disposes WebGL resources that are connected to this geometry
8761 */
8762 dispose(): void;
8763 /**
8764 * Destroys the geometry.
8765 */
8766 destroy(): void;
8767 /**
8768 * returns a clone of the geometry
8769 *
8770 * @returns {PIXI.Geometry} a new clone of this geometry
8771 */
8772 clone(): PIXI.Geometry;
8773 }
8774 /**
8775 * 'Builder' pattern for bounds rectangles.
8776 *
8777 * This could be called an Axis-Aligned Bounding Box.
8778 * It is not an actual shape. It is a mutable thing; no 'EMPTY' or those kind of problems.
8779 *
8780 * @class
8781 * @memberof PIXI
8782 */
8783 class Bounds {
8784 constructor();
8785 /**
8786 * @member {number} PIXI.Bounds#minX
8787 * @default 0
8788 */
8789 minX: number;
8790 /**
8791 * @member {number} PIXI.Bounds#minY
8792 * @default 0
8793 */
8794 minY: number;
8795 /**
8796 * @member {number} PIXI.Bounds#maxX
8797 * @default 0
8798 */
8799 maxX: number;
8800 /**
8801 * @member {number} PIXI.Bounds#maxY
8802 * @default 0
8803 */
8804 maxY: number;
8805 /**
8806 * It is updated to _boundsID of corresponding object to keep bounds in sync with content.
8807 * Updated from outside, thus public modifier.
8808 *
8809 * @member {number} PIXI.Bounds#updateID
8810 * @public
8811 */
8812 public updateID: number;
8813 /**
8814 * Checks if bounds are empty.
8815 *
8816 * @return {boolean} True if empty.
8817 */
8818 isEmpty(): boolean;
8819 /**
8820 * Clears the bounds and resets.
8821 *
8822 */
8823 clear(): void;
8824 /**
8825 * Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle
8826 * It is not guaranteed that it will return tempRect
8827 *
8828 * @param {PIXI.Rectangle} rect - temporary object will be used if AABB is not empty
8829 * @returns {PIXI.Rectangle} A rectangle of the bounds
8830 */
8831 getRectangle(rect: PIXI.Rectangle): PIXI.Rectangle;
8832 /**
8833 * This function should be inlined when its possible.
8834 *
8835 * @param {PIXI.IPointData} point - The point to add.
8836 */
8837 addPoint(point: PIXI.IPointData): void;
8838 /**
8839 * Adds a quad, not transformed
8840 *
8841 * @param {Float32Array} vertices - The verts to add.
8842 */
8843 addQuad(vertices: Float32Array): void;
8844 /**
8845 * Adds sprite frame, transformed.
8846 *
8847 * @param {PIXI.Transform} transform - transform to apply
8848 * @param {number} x0 - left X of frame
8849 * @param {number} y0 - top Y of frame
8850 * @param {number} x1 - right X of frame
8851 * @param {number} y1 - bottom Y of frame
8852 */
8853 addFrame(transform: PIXI.Transform, x0: number, y0: number, x1: number, y1: number): void;
8854 /**
8855 * Adds sprite frame, multiplied by matrix
8856 *
8857 * @param {PIXI.Matrix} matrix - matrix to apply
8858 * @param {number} x0 - left X of frame
8859 * @param {number} y0 - top Y of frame
8860 * @param {number} x1 - right X of frame
8861 * @param {number} y1 - bottom Y of frame
8862 */
8863 addFrameMatrix(matrix: PIXI.Matrix, x0: number, y0: number, x1: number, y1: number): void;
8864 /**
8865 * Adds screen vertices from array
8866 *
8867 * @param {Float32Array} vertexData - calculated vertices
8868 * @param {number} beginOffset - begin offset
8869 * @param {number} endOffset - end offset, excluded
8870 */
8871 addVertexData(vertexData: Float32Array, beginOffset: number, endOffset: number): void;
8872 /**
8873 * Add an array of mesh vertices
8874 *
8875 * @param {PIXI.Transform} transform - mesh transform
8876 * @param {Float32Array} vertices - mesh coordinates in array
8877 * @param {number} beginOffset - begin offset
8878 * @param {number} endOffset - end offset, excluded
8879 */
8880 addVertices(transform: PIXI.Transform, vertices: Float32Array, beginOffset: number, endOffset: number): void;
8881 /**
8882 * Add an array of mesh vertices.
8883 *
8884 * @param {PIXI.Matrix} matrix - mesh matrix
8885 * @param {Float32Array} vertices - mesh coordinates in array
8886 * @param {number} beginOffset - begin offset
8887 * @param {number} endOffset - end offset, excluded
8888 * @param {number} [padX=0] - x padding
8889 * @param {number} [padY=0] - y padding
8890 */
8891 addVerticesMatrix(matrix: PIXI.Matrix, vertices: Float32Array, beginOffset: number, endOffset: number, padX?: number, padY?: number): void;
8892 /**
8893 * Adds other Bounds.
8894 *
8895 * @param {PIXI.Bounds} bounds - The Bounds to be added
8896 */
8897 addBounds(bounds: PIXI.Bounds): void;
8898 /**
8899 * Adds other Bounds, masked with Bounds.
8900 *
8901 * @param {PIXI.Bounds} bounds - The Bounds to be added.
8902 * @param {PIXI.Bounds} mask - TODO
8903 */
8904 addBoundsMask(bounds: PIXI.Bounds, mask: PIXI.Bounds): void;
8905 /**
8906 * Adds other Bounds, multiplied by matrix. Bounds shouldn't be empty.
8907 *
8908 * @param {PIXI.Bounds} bounds - other bounds
8909 * @param {PIXI.Matrix} matrix - multiplicator
8910 */
8911 addBoundsMatrix(bounds: PIXI.Bounds, matrix: PIXI.Matrix): void;
8912 /**
8913 * Adds other Bounds, masked with Rectangle.
8914 *
8915 * @param {PIXI.Bounds} bounds - TODO
8916 * @param {PIXI.Rectangle} area - TODO
8917 */
8918 addBoundsArea(bounds: PIXI.Bounds, area: PIXI.Rectangle): void;
8919 /**
8920 * Pads bounds object, making it grow in all directions.
8921 * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
8922 *
8923 * @param {number} [paddingX=0] - The horizontal padding amount.
8924 * @param {number} [paddingY=0] - The vertical padding amount.
8925 */
8926 pad(paddingX?: number, paddingY?: number): void;
8927 /**
8928 * Adds padded frame. (x0, y0) should be strictly less than (x1, y1)
8929 *
8930 * @param {number} x0 - left X of frame
8931 * @param {number} y0 - top Y of frame
8932 * @param {number} x1 - right X of frame
8933 * @param {number} y1 - bottom Y of frame
8934 * @param {number} padX - padding X
8935 * @param {number} padY - padding Y
8936 */
8937 addFramePad(x0: number, y0: number, x1: number, y1: number, padX: number, padY: number): void;
8938 }
8939 /**
8940 * A Container represents a collection of display objects.
8941 *
8942 * It is the base class of all display objects that act as a container for other objects (like Sprites).
8943 *
8944 *```js
8945 * let container = new PIXI.Container();
8946 * container.addChild(sprite);
8947 * ```
8948 *
8949 * @class
8950 * @extends PIXI.DisplayObject
8951 * @memberof PIXI
8952 */
8953 class Container extends PIXI.DisplayObject {
8954 constructor();
8955 /**
8956 * To be overridden by the subclass
8957 * @method _renderCanvas
8958 * @memberof PIXI.Container#
8959 * @protected
8960 * @param {PIXI.CanvasRenderer} renderer - The renderer
8961 */
8962 protected _renderCanvas(renderer: PIXI.CanvasRenderer): void;
8963 /**
8964 * Renders the object using the Canvas renderer
8965 * @method renderCanvas
8966 * @memberof PIXI.Container#
8967 * @param {PIXI.CanvasRenderer} renderer - The renderer
8968 */
8969 renderCanvas(renderer: PIXI.CanvasRenderer): void;
8970 /**
8971 * Renders the object using the Canvas renderer
8972 * @method renderCanvas
8973 * @memberof PIXI.Container#
8974 * @param {PIXI.CanvasRenderer} renderer - The renderer
8975 */
8976 renderCanvas(renderer: PIXI.CanvasRenderer): void;
8977 /**
8978 * The array of children of this container.
8979 *
8980 * @member {PIXI.DisplayObject[]} PIXI.Container#children
8981 * @readonly
8982 */
8983 readonly children: PIXI.DisplayObject[];
8984 /**
8985 * If set to true, the container will sort its children by zIndex value
8986 * when updateTransform() is called, or manually if sortChildren() is called.
8987 *
8988 * This actually changes the order of elements in the array, so should be treated
8989 * as a basic solution that is not performant compared to other solutions,
8990 * such as @link https://github.com/pixijs/pixi-display
8991 *
8992 * Also be aware of that this may not work nicely with the addChildAt() function,
8993 * as the zIndex sorting may cause the child to automatically sorted to another position.
8994 *
8995 * @see PIXI.settings.SORTABLE_CHILDREN
8996 *
8997 * @member {boolean} PIXI.Container#sortableChildren
8998 */
8999 sortableChildren: boolean;
9000 /**
9001 * Should children be sorted by zIndex at the next updateTransform call.
9002 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
9003 *
9004 * @member {boolean} PIXI.Container#sortDirty
9005 */
9006 sortDirty: boolean;
9007 /**
9008 * Overridable method that can be used by Container subclasses whenever the children array is modified
9009 *
9010 * @protected
9011 */
9012 protected onChildrenChange(): void;
9013 /**
9014 * Adds one or more children to the container.
9015 *
9016 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
9017 *
9018 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
9019 * @return {PIXI.DisplayObject} The first child that was added.
9020 */
9021 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
9022 /**
9023 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
9024 *
9025 * @param {PIXI.DisplayObject} child - The child to add
9026 * @param {number} index - The index to place the child in
9027 * @return {PIXI.DisplayObject} The child that was added.
9028 */
9029 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
9030 /**
9031 * Swaps the position of 2 Display Objects within this container.
9032 *
9033 * @param {PIXI.DisplayObject} child - First display object to swap
9034 * @param {PIXI.DisplayObject} child2 - Second display object to swap
9035 */
9036 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
9037 /**
9038 * Returns the index position of a child DisplayObject instance
9039 *
9040 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
9041 * @return {number} The index position of the child display object to identify
9042 */
9043 getChildIndex(child: PIXI.DisplayObject): number;
9044 /**
9045 * Changes the position of an existing child in the display object container
9046 *
9047 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
9048 * @param {number} index - The resulting index number for the child display object
9049 */
9050 setChildIndex(child: PIXI.DisplayObject, index: number): void;
9051 /**
9052 * Returns the child at the specified index
9053 *
9054 * @param {number} index - The index to get the child at
9055 * @return {PIXI.DisplayObject} The child at the given index, if any.
9056 */
9057 getChildAt(index: number): PIXI.DisplayObject;
9058 /**
9059 * Removes one or more children from the container.
9060 *
9061 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
9062 * @return {PIXI.DisplayObject} The first child that was removed.
9063 */
9064 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
9065 /**
9066 * Removes a child from the specified index position.
9067 *
9068 * @param {number} index - The index to get the child from
9069 * @return {PIXI.DisplayObject} The child that was removed.
9070 */
9071 removeChildAt(index: number): PIXI.DisplayObject;
9072 /**
9073 * Removes all children from this container that are within the begin and end indexes.
9074 *
9075 * @param {number} [beginIndex=0] - The beginning position.
9076 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
9077 * @returns {PIXI.DisplayObject[]} List of removed children
9078 */
9079 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
9080 /**
9081 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
9082 */
9083 sortChildren(): void;
9084 /**
9085 * Updates the transform on all children of this container for rendering
9086 */
9087 updateTransform(): void;
9088 /**
9089 * Recalculates the bounds of the container.
9090 *
9091 */
9092 calculateBounds(): void;
9093 /**
9094 * Retrieves the local bounds of the displayObject as a rectangle object.
9095 *
9096 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
9097 * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,
9098 * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
9099 * @return {PIXI.Rectangle} The rectangular bounding area.
9100 */
9101 getLocalBounds(rect?: PIXI.Rectangle, skipChildrenUpdate?: boolean): PIXI.Rectangle;
9102 /**
9103 * Recalculates the bounds of the object. Override this to
9104 * calculate the bounds of the specific object (not including children).
9105 *
9106 * @protected
9107 */
9108 protected _calculateBounds(): void;
9109 /**
9110 * Renders the object using the WebGL renderer
9111 *
9112 * @param {PIXI.Renderer} renderer - The renderer
9113 */
9114 render(renderer: PIXI.Renderer): void;
9115 /**
9116 * Render the object using the WebGL renderer and advanced features.
9117 *
9118 * @protected
9119 * @param {PIXI.Renderer} renderer - The renderer
9120 */
9121 protected renderAdvanced(renderer: PIXI.Renderer): void;
9122 /**
9123 * To be overridden by the subclasses.
9124 *
9125 * @protected
9126 * @param {PIXI.Renderer} renderer - The renderer
9127 */
9128 protected _render(renderer: PIXI.Renderer): void;
9129 /**
9130 * Removes all internal references and listeners as well as removes children from the display list.
9131 * Do not use a Container after calling `destroy`.
9132 *
9133 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
9134 * have been set to that value
9135 * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy
9136 * method called as well. 'options' will be passed on to those calls.
9137 * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
9138 * Should it destroy the texture of the child sprite
9139 * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
9140 * Should it destroy the base texture of the child sprite
9141 */
9142 destroy(options?: {
9143 children?: boolean;
9144 texture?: boolean;
9145 baseTexture?: boolean;
9146 }): void;
9147 /**
9148 * The width of the Container, setting this will actually modify the scale to achieve the value set
9149 *
9150 * @member {number}
9151 */
9152 width: number;
9153 /**
9154 * The height of the Container, setting this will actually modify the scale to achieve the value set
9155 *
9156 * @member {number}
9157 */
9158 height: number;
9159 /**
9160 * Container default updateTransform, does update children of container.
9161 * Will crash if there's no parent element.
9162 *
9163 * @memberof PIXI.Container#
9164 * @function containerUpdateTransform
9165 */
9166 containerUpdateTransform(): void;
9167 /**
9168 * Determines if the children to the displayObject can be clicked/touched
9169 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
9170 *
9171 * @member {boolean}
9172 * @memberof PIXI.Container#
9173 */
9174 interactiveChildren: boolean;
9175 /**
9176 * Returns the display object in the container.
9177 *
9178 * Recursive searches are done in a preorder traversal.
9179 *
9180 * @method getChildByName
9181 * @memberof PIXI.Container#
9182 * @param {string} name - Instance name.
9183 * @param {boolean}[deep=false] - Whether to search recursively
9184 * @return {PIXI.DisplayObject} The child with the specified name.
9185 */
9186 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
9187 /**
9188 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
9189 * shadow div with attributes set
9190 *
9191 * @member {boolean}
9192 * @memberof PIXI.DisplayObject#
9193 */
9194 accessible: boolean;
9195 /**
9196 * Sets the title attribute of the shadow div
9197 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
9198 *
9199 * @member {?string}
9200 * @memberof PIXI.DisplayObject#
9201 */
9202 accessibleTitle: string;
9203 /**
9204 * Sets the aria-label attribute of the shadow div
9205 *
9206 * @member {string}
9207 * @memberof PIXI.DisplayObject#
9208 */
9209 accessibleHint: string;
9210 /**
9211 * @member {boolean}
9212 * @memberof PIXI.DisplayObject#
9213 * @todo Needs docs.
9214 */
9215 _accessibleActive: boolean;
9216 /**
9217 * @member {boolean}
9218 * @memberof PIXI.DisplayObject#
9219 * @todo Needs docs.
9220 */
9221 _accessibleDiv: boolean;
9222 /**
9223 * Specify the type of div the accessible layer is. Screen readers treat the element differently
9224 * depending on this type. Defaults to button.
9225 *
9226 * @member {string}
9227 * @memberof PIXI.DisplayObject#
9228 * @default 'button'
9229 */
9230 accessibleType: string;
9231 /**
9232 * Specify the pointer-events the accessible div will use
9233 * Defaults to auto.
9234 *
9235 * @member {string}
9236 * @memberof PIXI.DisplayObject#
9237 * @default 'auto'
9238 */
9239 accessiblePointerEvents: string;
9240 /**
9241 * Setting to false will prevent any children inside this container to
9242 * be accessible. Defaults to true.
9243 *
9244 * @member {boolean}
9245 * @memberof PIXI.DisplayObject#
9246 * @default true
9247 */
9248 accessibleChildren: boolean;
9249 /**
9250 * World transform and local transform of this object.
9251 * This will become read-only later, please do not assign anything there unless you know what are you doing.
9252 *
9253 * @member {PIXI.Transform} PIXI.DisplayObject#transform
9254 */
9255 transform: PIXI.Transform;
9256 /**
9257 * The opacity of the object.
9258 *
9259 * @member {number} PIXI.DisplayObject#alpha
9260 */
9261 alpha: number;
9262 /**
9263 * The visibility of the object. If false the object will not be drawn, and
9264 * the updateTransform function will not be called.
9265 *
9266 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
9267 *
9268 * @member {boolean} PIXI.DisplayObject#visible
9269 */
9270 visible: boolean;
9271 /**
9272 * Can this object be rendered, if false the object will not be drawn but the updateTransform
9273 * methods will still be called.
9274 *
9275 * Only affects recursive calls from parent. You can ask for bounds manually.
9276 *
9277 * @member {boolean} PIXI.DisplayObject#renderable
9278 */
9279 renderable: boolean;
9280 /**
9281 * The display object container that contains this display object.
9282 *
9283 * @member {PIXI.Container} PIXI.DisplayObject#parent
9284 */
9285 parent: PIXI.Container;
9286 /**
9287 * The multiplied alpha of the displayObject.
9288 *
9289 * @member {number} PIXI.DisplayObject#worldAlpha
9290 * @readonly
9291 */
9292 readonly worldAlpha: number;
9293 /**
9294 * Which index in the children array the display component was before the previous zIndex sort.
9295 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
9296 *
9297 * @member {number} PIXI.DisplayObject#_lastSortedIndex
9298 * @protected
9299 */
9300 protected _lastSortedIndex: number;
9301 /**
9302 * The zIndex of the displayObject.
9303 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
9304 *
9305 * @member {number} PIXI.DisplayObject#_zIndex
9306 * @protected
9307 */
9308 protected _zIndex: number;
9309 /**
9310 * The area the filter is applied to. This is used as more of an optimization
9311 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
9312 *
9313 * Also works as an interaction mask.
9314 *
9315 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
9316 */
9317 filterArea: PIXI.Rectangle;
9318 /**
9319 * Sets the filters for the displayObject.
9320 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
9321 * To remove filters simply set this property to `'null'`.
9322 *
9323 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
9324 */
9325 filters: PIXI.Filter[];
9326 /**
9327 * Currently enabled filters
9328 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
9329 * @protected
9330 */
9331 protected _enabledFilters: PIXI.Filter[];
9332 /**
9333 * The bounds object, this is used to calculate and store the bounds of the displayObject.
9334 *
9335 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
9336 */
9337 _bounds: PIXI.Bounds;
9338 /**
9339 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
9340 *
9341 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
9342 */
9343 _localBounds: PIXI.Bounds;
9344 /**
9345 * Flags the cached bounds as dirty.
9346 *
9347 * @member {number} PIXI.DisplayObject#_boundsID
9348 * @protected
9349 */
9350 protected _boundsID: number;
9351 /**
9352 * Cache of this display-object's bounds-rectangle.
9353 *
9354 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
9355 * @protected
9356 */
9357 protected _boundsRect: PIXI.Bounds;
9358 /**
9359 * Cache of this display-object's local-bounds rectangle.
9360 *
9361 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
9362 * @protected
9363 */
9364 protected _localBoundsRect: PIXI.Bounds;
9365 /**
9366 * The original, cached mask of the object.
9367 *
9368 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
9369 * @protected
9370 */
9371 protected _mask: PIXI.Container | PIXI.MaskData | null;
9372 /**
9373 * If the object has been destroyed via destroy(). If true, it should not be used.
9374 *
9375 * @member {boolean} PIXI.DisplayObject#_destroyed
9376 * @protected
9377 */
9378 protected _destroyed: boolean;
9379 /**
9380 * used to fast check if a sprite is.. a sprite!
9381 * @member {boolean} PIXI.DisplayObject#isSprite
9382 */
9383 isSprite: boolean;
9384 /**
9385 * Does any other displayObject use this object as a mask?
9386 * @member {boolean} PIXI.DisplayObject#isMask
9387 */
9388 isMask: boolean;
9389 /**
9390 * Recursively updates transform of all objects from the root to this one
9391 * internal function for toLocal()
9392 */
9393 _recursivePostUpdateTransform(): void;
9394 /**
9395 * Retrieves the bounds of the displayObject as a rectangle object.
9396 *
9397 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
9398 * being updated. This means the calculation returned MAY be out of date BUT will give you a
9399 * nice performance boost.
9400 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
9401 * @return {PIXI.Rectangle} The rectangular bounding area.
9402 */
9403 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
9404 /**
9405 * Calculates the global position of the display object.
9406 *
9407 * @param {PIXI.IPointData} position - The world origin to calculate from.
9408 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
9409 * (otherwise will create a new Point).
9410 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
9411 * @return {PIXI.Point} A point object representing the position of this object.
9412 */
9413 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
9414 /**
9415 * Calculates the local position of the display object relative to another point.
9416 *
9417 * @param {PIXI.IPointData} position - The world origin to calculate from.
9418 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
9419 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
9420 * (otherwise will create a new Point).
9421 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
9422 * @return {PIXI.Point} A point object representing the position of this object
9423 */
9424 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
9425 /**
9426 * Set the parent Container of this DisplayObject.
9427 *
9428 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
9429 * @return {PIXI.Container} The Container that this DisplayObject was added to.
9430 */
9431 setParent(container: PIXI.Container): PIXI.Container;
9432 /**
9433 * Convenience function to set the position, scale, skew and pivot at once.
9434 *
9435 * @param {number} [x=0] - The X position
9436 * @param {number} [y=0] - The Y position
9437 * @param {number} [scaleX=1] - The X scale value
9438 * @param {number} [scaleY=1] - The Y scale value
9439 * @param {number} [rotation=0] - The rotation
9440 * @param {number} [skewX=0] - The X skew value
9441 * @param {number} [skewY=0] - The Y skew value
9442 * @param {number} [pivotX=0] - The X pivot value
9443 * @param {number} [pivotY=0] - The Y pivot value
9444 * @return {PIXI.DisplayObject} The DisplayObject instance
9445 */
9446 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
9447 /**
9448 * @protected
9449 * @member {PIXI.Container}
9450 */
9451 protected _tempDisplayObjectParent: PIXI.Container;
9452 /**
9453 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
9454 *
9455 * ```
9456 * const cacheParent = elem.enableTempParent();
9457 * elem.updateTransform();
9458 * elem.disableTempParent(cacheParent);
9459 * ```
9460 *
9461 * @returns {PIXI.DisplayObject} current parent
9462 */
9463 enableTempParent(): PIXI.DisplayObject;
9464 /**
9465 * Pair method for `enableTempParent`
9466 * @param {PIXI.DisplayObject} cacheParent actual parent of element
9467 */
9468 disableTempParent(cacheParent: PIXI.DisplayObject): void;
9469 /**
9470 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
9471 * An alias to position.x
9472 *
9473 * @member {number}
9474 */
9475 x: number;
9476 /**
9477 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
9478 * An alias to position.y
9479 *
9480 * @member {number}
9481 */
9482 y: number;
9483 /**
9484 * Current transform of the object based on world (parent) factors.
9485 *
9486 * @member {PIXI.Matrix}
9487 * @readonly
9488 */
9489 readonly worldTransform: PIXI.Matrix;
9490 /**
9491 * Current transform of the object based on local factors: position, scale, other stuff.
9492 *
9493 * @member {PIXI.Matrix}
9494 * @readonly
9495 */
9496 readonly localTransform: PIXI.Matrix;
9497 /**
9498 * The coordinate of the object relative to the local coordinates of the parent.
9499 * Assignment by value since pixi-v4.
9500 *
9501 * @member {PIXI.ObservablePoint}
9502 */
9503 position: PIXI.ObservablePoint;
9504 /**
9505 * The scale factor of the object.
9506 * Assignment by value since pixi-v4.
9507 *
9508 * @member {PIXI.ObservablePoint}
9509 */
9510 scale: PIXI.ObservablePoint;
9511 /**
9512 * The pivot point of the displayObject that it rotates around.
9513 * Assignment by value since pixi-v4.
9514 *
9515 * @member {PIXI.ObservablePoint}
9516 */
9517 pivot: PIXI.ObservablePoint;
9518 /**
9519 * The skew factor for the object in radians.
9520 * Assignment by value since pixi-v4.
9521 *
9522 * @member {PIXI.ObservablePoint}
9523 */
9524 skew: PIXI.ObservablePoint;
9525 /**
9526 * The rotation of the object in radians.
9527 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
9528 *
9529 * @member {number}
9530 */
9531 rotation: number;
9532 /**
9533 * The angle of the object in degrees.
9534 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
9535 *
9536 * @member {number}
9537 */
9538 angle: number;
9539 /**
9540 * The zIndex of the displayObject.
9541 * If a container has the sortableChildren property set to true, children will be automatically
9542 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
9543 * and thus rendered on top of other displayObjects within the same container.
9544 *
9545 * @member {number}
9546 */
9547 zIndex: number;
9548 /**
9549 * Indicates if the object is globally visible.
9550 *
9551 * @member {boolean}
9552 * @readonly
9553 */
9554 readonly worldVisible: boolean;
9555 /**
9556 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
9557 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
9558 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
9559 * utilities shape clipping. To remove a mask, set this property to `null`.
9560 *
9561 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
9562 * @example
9563 * const graphics = new PIXI.Graphics();
9564 * graphics.beginFill(0xFF3300);
9565 * graphics.drawRect(50, 250, 100, 100);
9566 * graphics.endFill();
9567 *
9568 * const sprite = new PIXI.Sprite(texture);
9569 * sprite.mask = graphics;
9570 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
9571 *
9572 * @member {PIXI.Container|PIXI.MaskData|null}
9573 */
9574 mask: PIXI.Container | PIXI.MaskData | null;
9575 /**
9576 * DisplayObject default updateTransform, does not update children of container.
9577 * Will crash if there's no parent element.
9578 *
9579 * @memberof PIXI.DisplayObject#
9580 * @function displayObjectUpdateTransform
9581 */
9582 displayObjectUpdateTransform(): void;
9583 /**
9584 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
9585 * events will not be emitted unless `interactive` is set to `true`.
9586 *
9587 * @example
9588 * const sprite = new PIXI.Sprite(texture);
9589 * sprite.interactive = true;
9590 * sprite.on('tap', (event) => {
9591 * //handle event
9592 * });
9593 * @member {boolean}
9594 * @memberof PIXI.DisplayObject#
9595 */
9596 interactive: boolean;
9597 /**
9598 * Interaction shape. Children will be hit first, then this shape will be checked.
9599 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
9600 *
9601 * @example
9602 * const sprite = new PIXI.Sprite(texture);
9603 * sprite.interactive = true;
9604 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
9605 * @member {PIXI.IHitArea}
9606 * @memberof PIXI.DisplayObject#
9607 */
9608 hitArea: PIXI.IHitArea;
9609 /**
9610 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
9611 * Setting this changes the 'cursor' property to `'pointer'`.
9612 *
9613 * @example
9614 * const sprite = new PIXI.Sprite(texture);
9615 * sprite.interactive = true;
9616 * sprite.buttonMode = true;
9617 * @member {boolean}
9618 * @memberof PIXI.DisplayObject#
9619 */
9620 buttonMode: boolean;
9621 /**
9622 * This defines what cursor mode is used when the mouse cursor
9623 * is hovered over the displayObject.
9624 *
9625 * @example
9626 * const sprite = new PIXI.Sprite(texture);
9627 * sprite.interactive = true;
9628 * sprite.cursor = 'wait';
9629 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
9630 *
9631 * @member {string}
9632 * @memberof PIXI.DisplayObject#
9633 */
9634 cursor: string;
9635 /**
9636 * Set this to true if you want this display object to be cached as a bitmap.
9637 * This basically takes a snap shot of the display object as it is at that moment. It can
9638 * provide a performance benefit for complex static displayObjects.
9639 * To remove simply set this property to `false`
9640 *
9641 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
9642 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
9643 *
9644 * @member {boolean}
9645 * @memberof PIXI.DisplayObject#
9646 */
9647 cacheAsBitmap: boolean;
9648 /**
9649 * The instance name of the object.
9650 *
9651 * @memberof PIXI.DisplayObject#
9652 * @member {string} name
9653 */
9654 name: string;
9655 /**
9656 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
9657 *
9658 * @method getGlobalPosition
9659 * @memberof PIXI.DisplayObject#
9660 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
9661 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
9662 * being updated. This means the calculation returned MAY be out of date BUT will give you a
9663 * nice performance boost.
9664 * @return {PIXI.Point} The updated point.
9665 */
9666 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
9667 }
9668 /**
9669 * The base class for all objects that are rendered on the screen.
9670 *
9671 * This is an abstract class and should not be used on its own; rather it should b e extended.
9672 *
9673 * @class
9674 * @extends PIXI.utils.EventEmitter
9675 * @memberof PIXI
9676 */
9677 class DisplayObject extends PIXI.utils.EventEmitter {
9678 constructor();
9679 /**
9680 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
9681 * shadow div with attributes set
9682 *
9683 * @member {boolean}
9684 * @memberof PIXI.DisplayObject#
9685 */
9686 accessible: boolean;
9687 /**
9688 * Sets the title attribute of the shadow div
9689 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
9690 *
9691 * @member {?string}
9692 * @memberof PIXI.DisplayObject#
9693 */
9694 accessibleTitle: string;
9695 /**
9696 * Sets the aria-label attribute of the shadow div
9697 *
9698 * @member {string}
9699 * @memberof PIXI.DisplayObject#
9700 */
9701 accessibleHint: string;
9702 /**
9703 * @member {boolean}
9704 * @memberof PIXI.DisplayObject#
9705 * @todo Needs docs.
9706 */
9707 _accessibleActive: boolean;
9708 /**
9709 * @member {boolean}
9710 * @memberof PIXI.DisplayObject#
9711 * @todo Needs docs.
9712 */
9713 _accessibleDiv: boolean;
9714 /**
9715 * Specify the type of div the accessible layer is. Screen readers treat the element differently
9716 * depending on this type. Defaults to button.
9717 *
9718 * @member {string}
9719 * @memberof PIXI.DisplayObject#
9720 * @default 'button'
9721 */
9722 accessibleType: string;
9723 /**
9724 * Specify the pointer-events the accessible div will use
9725 * Defaults to auto.
9726 *
9727 * @member {string}
9728 * @memberof PIXI.DisplayObject#
9729 * @default 'auto'
9730 */
9731 accessiblePointerEvents: string;
9732 /**
9733 * Setting to false will prevent any children inside this container to
9734 * be accessible. Defaults to true.
9735 *
9736 * @member {boolean}
9737 * @memberof PIXI.DisplayObject#
9738 * @default true
9739 */
9740 accessibleChildren: boolean;
9741 /**
9742 * World transform and local transform of this object.
9743 * This will become read-only later, please do not assign anything there unless you know what are you doing.
9744 *
9745 * @member {PIXI.Transform} PIXI.DisplayObject#transform
9746 */
9747 transform: PIXI.Transform;
9748 /**
9749 * The opacity of the object.
9750 *
9751 * @member {number} PIXI.DisplayObject#alpha
9752 */
9753 alpha: number;
9754 /**
9755 * The visibility of the object. If false the object will not be drawn, and
9756 * the updateTransform function will not be called.
9757 *
9758 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
9759 *
9760 * @member {boolean} PIXI.DisplayObject#visible
9761 */
9762 visible: boolean;
9763 /**
9764 * Can this object be rendered, if false the object will not be drawn but the updateTransform
9765 * methods will still be called.
9766 *
9767 * Only affects recursive calls from parent. You can ask for bounds manually.
9768 *
9769 * @member {boolean} PIXI.DisplayObject#renderable
9770 */
9771 renderable: boolean;
9772 /**
9773 * The display object container that contains this display object.
9774 *
9775 * @member {PIXI.Container} PIXI.DisplayObject#parent
9776 */
9777 parent: PIXI.Container;
9778 /**
9779 * The multiplied alpha of the displayObject.
9780 *
9781 * @member {number} PIXI.DisplayObject#worldAlpha
9782 * @readonly
9783 */
9784 readonly worldAlpha: number;
9785 /**
9786 * Which index in the children array the display component was before the previous zIndex sort.
9787 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
9788 *
9789 * @member {number} PIXI.DisplayObject#_lastSortedIndex
9790 * @protected
9791 */
9792 protected _lastSortedIndex: number;
9793 /**
9794 * The zIndex of the displayObject.
9795 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
9796 *
9797 * @member {number} PIXI.DisplayObject#_zIndex
9798 * @protected
9799 */
9800 protected _zIndex: number;
9801 /**
9802 * The area the filter is applied to. This is used as more of an optimization
9803 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
9804 *
9805 * Also works as an interaction mask.
9806 *
9807 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
9808 */
9809 filterArea: PIXI.Rectangle;
9810 /**
9811 * Sets the filters for the displayObject.
9812 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
9813 * To remove filters simply set this property to `'null'`.
9814 *
9815 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
9816 */
9817 filters: PIXI.Filter[];
9818 /**
9819 * Currently enabled filters
9820 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
9821 * @protected
9822 */
9823 protected _enabledFilters: PIXI.Filter[];
9824 /**
9825 * The bounds object, this is used to calculate and store the bounds of the displayObject.
9826 *
9827 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
9828 */
9829 _bounds: PIXI.Bounds;
9830 /**
9831 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
9832 *
9833 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
9834 */
9835 _localBounds: PIXI.Bounds;
9836 /**
9837 * Flags the cached bounds as dirty.
9838 *
9839 * @member {number} PIXI.DisplayObject#_boundsID
9840 * @protected
9841 */
9842 protected _boundsID: number;
9843 /**
9844 * Cache of this display-object's bounds-rectangle.
9845 *
9846 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
9847 * @protected
9848 */
9849 protected _boundsRect: PIXI.Bounds;
9850 /**
9851 * Cache of this display-object's local-bounds rectangle.
9852 *
9853 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
9854 * @protected
9855 */
9856 protected _localBoundsRect: PIXI.Bounds;
9857 /**
9858 * The original, cached mask of the object.
9859 *
9860 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
9861 * @protected
9862 */
9863 protected _mask: PIXI.Container | PIXI.MaskData | null;
9864 /**
9865 * If the object has been destroyed via destroy(). If true, it should not be used.
9866 *
9867 * @member {boolean} PIXI.DisplayObject#_destroyed
9868 * @protected
9869 */
9870 protected _destroyed: boolean;
9871 /**
9872 * used to fast check if a sprite is.. a sprite!
9873 * @member {boolean} PIXI.DisplayObject#isSprite
9874 */
9875 isSprite: boolean;
9876 /**
9877 * Does any other displayObject use this object as a mask?
9878 * @member {boolean} PIXI.DisplayObject#isMask
9879 */
9880 isMask: boolean;
9881 /**
9882 * Mixes all enumerable properties and methods from a source object to DisplayObject.
9883 *
9884 * @param {object} source - The source of properties and methods to mix in.
9885 */
9886 static mixin(source: any): void;
9887 /**
9888 * Recursively updates transform of all objects from the root to this one
9889 * internal function for toLocal()
9890 */
9891 _recursivePostUpdateTransform(): void;
9892 /**
9893 * Updates the object transform for rendering.
9894 *
9895 * TODO - Optimization pass!
9896 */
9897 updateTransform(): void;
9898 /**
9899 * Retrieves the bounds of the displayObject as a rectangle object.
9900 *
9901 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
9902 * being updated. This means the calculation returned MAY be out of date BUT will give you a
9903 * nice performance boost.
9904 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
9905 * @return {PIXI.Rectangle} The rectangular bounding area.
9906 */
9907 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
9908 /**
9909 * Retrieves the local bounds of the displayObject as a rectangle object.
9910 *
9911 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
9912 * @return {PIXI.Rectangle} The rectangular bounding area.
9913 */
9914 getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle;
9915 /**
9916 * Calculates the global position of the display object.
9917 *
9918 * @param {PIXI.IPointData} position - The world origin to calculate from.
9919 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
9920 * (otherwise will create a new Point).
9921 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
9922 * @return {PIXI.Point} A point object representing the position of this object.
9923 */
9924 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
9925 /**
9926 * Calculates the local position of the display object relative to another point.
9927 *
9928 * @param {PIXI.IPointData} position - The world origin to calculate from.
9929 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
9930 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
9931 * (otherwise will create a new Point).
9932 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
9933 * @return {PIXI.Point} A point object representing the position of this object
9934 */
9935 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
9936 /**
9937 * Set the parent Container of this DisplayObject.
9938 *
9939 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
9940 * @return {PIXI.Container} The Container that this DisplayObject was added to.
9941 */
9942 setParent(container: PIXI.Container): PIXI.Container;
9943 /**
9944 * Convenience function to set the position, scale, skew and pivot at once.
9945 *
9946 * @param {number} [x=0] - The X position
9947 * @param {number} [y=0] - The Y position
9948 * @param {number} [scaleX=1] - The X scale value
9949 * @param {number} [scaleY=1] - The Y scale value
9950 * @param {number} [rotation=0] - The rotation
9951 * @param {number} [skewX=0] - The X skew value
9952 * @param {number} [skewY=0] - The Y skew value
9953 * @param {number} [pivotX=0] - The X pivot value
9954 * @param {number} [pivotY=0] - The Y pivot value
9955 * @return {PIXI.DisplayObject} The DisplayObject instance
9956 */
9957 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
9958 /**
9959 * Base destroy method for generic display objects. This will automatically
9960 * remove the display object from its parent Container as well as remove
9961 * all current event listeners and internal references. Do not use a DisplayObject
9962 * after calling `destroy()`.
9963 *
9964 */
9965 destroy(): void;
9966 /**
9967 * @protected
9968 * @member {PIXI.Container}
9969 */
9970 protected _tempDisplayObjectParent: PIXI.Container;
9971 /**
9972 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
9973 *
9974 * ```
9975 * const cacheParent = elem.enableTempParent();
9976 * elem.updateTransform();
9977 * elem.disableTempParent(cacheParent);
9978 * ```
9979 *
9980 * @returns {PIXI.DisplayObject} current parent
9981 */
9982 enableTempParent(): PIXI.DisplayObject;
9983 /**
9984 * Pair method for `enableTempParent`
9985 * @param {PIXI.DisplayObject} cacheParent actual parent of element
9986 */
9987 disableTempParent(cacheParent: PIXI.DisplayObject): void;
9988 /**
9989 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
9990 * An alias to position.x
9991 *
9992 * @member {number}
9993 */
9994 x: number;
9995 /**
9996 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
9997 * An alias to position.y
9998 *
9999 * @member {number}
10000 */
10001 y: number;
10002 /**
10003 * Current transform of the object based on world (parent) factors.
10004 *
10005 * @member {PIXI.Matrix}
10006 * @readonly
10007 */
10008 readonly worldTransform: PIXI.Matrix;
10009 /**
10010 * Current transform of the object based on local factors: position, scale, other stuff.
10011 *
10012 * @member {PIXI.Matrix}
10013 * @readonly
10014 */
10015 readonly localTransform: PIXI.Matrix;
10016 /**
10017 * The coordinate of the object relative to the local coordinates of the parent.
10018 * Assignment by value since pixi-v4.
10019 *
10020 * @member {PIXI.ObservablePoint}
10021 */
10022 position: PIXI.ObservablePoint;
10023 /**
10024 * The scale factor of the object.
10025 * Assignment by value since pixi-v4.
10026 *
10027 * @member {PIXI.ObservablePoint}
10028 */
10029 scale: PIXI.ObservablePoint;
10030 /**
10031 * The pivot point of the displayObject that it rotates around.
10032 * Assignment by value since pixi-v4.
10033 *
10034 * @member {PIXI.ObservablePoint}
10035 */
10036 pivot: PIXI.ObservablePoint;
10037 /**
10038 * The skew factor for the object in radians.
10039 * Assignment by value since pixi-v4.
10040 *
10041 * @member {PIXI.ObservablePoint}
10042 */
10043 skew: PIXI.ObservablePoint;
10044 /**
10045 * The rotation of the object in radians.
10046 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
10047 *
10048 * @member {number}
10049 */
10050 rotation: number;
10051 /**
10052 * The angle of the object in degrees.
10053 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
10054 *
10055 * @member {number}
10056 */
10057 angle: number;
10058 /**
10059 * The zIndex of the displayObject.
10060 * If a container has the sortableChildren property set to true, children will be automatically
10061 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
10062 * and thus rendered on top of other displayObjects within the same container.
10063 *
10064 * @member {number}
10065 */
10066 zIndex: number;
10067 /**
10068 * Indicates if the object is globally visible.
10069 *
10070 * @member {boolean}
10071 * @readonly
10072 */
10073 readonly worldVisible: boolean;
10074 /**
10075 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
10076 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
10077 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
10078 * utilities shape clipping. To remove a mask, set this property to `null`.
10079 *
10080 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
10081 * @example
10082 * const graphics = new PIXI.Graphics();
10083 * graphics.beginFill(0xFF3300);
10084 * graphics.drawRect(50, 250, 100, 100);
10085 * graphics.endFill();
10086 *
10087 * const sprite = new PIXI.Sprite(texture);
10088 * sprite.mask = graphics;
10089 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
10090 *
10091 * @member {PIXI.Container|PIXI.MaskData|null}
10092 */
10093 mask: PIXI.Container | PIXI.MaskData | null;
10094 /**
10095 * DisplayObject default updateTransform, does not update children of container.
10096 * Will crash if there's no parent element.
10097 *
10098 * @memberof PIXI.DisplayObject#
10099 * @function displayObjectUpdateTransform
10100 */
10101 displayObjectUpdateTransform(): void;
10102 /**
10103 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
10104 * events will not be emitted unless `interactive` is set to `true`.
10105 *
10106 * @example
10107 * const sprite = new PIXI.Sprite(texture);
10108 * sprite.interactive = true;
10109 * sprite.on('tap', (event) => {
10110 * //handle event
10111 * });
10112 * @member {boolean}
10113 * @memberof PIXI.DisplayObject#
10114 */
10115 interactive: boolean;
10116 /**
10117 * Interaction shape. Children will be hit first, then this shape will be checked.
10118 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
10119 *
10120 * @example
10121 * const sprite = new PIXI.Sprite(texture);
10122 * sprite.interactive = true;
10123 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
10124 * @member {PIXI.IHitArea}
10125 * @memberof PIXI.DisplayObject#
10126 */
10127 hitArea: PIXI.IHitArea;
10128 /**
10129 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
10130 * Setting this changes the 'cursor' property to `'pointer'`.
10131 *
10132 * @example
10133 * const sprite = new PIXI.Sprite(texture);
10134 * sprite.interactive = true;
10135 * sprite.buttonMode = true;
10136 * @member {boolean}
10137 * @memberof PIXI.DisplayObject#
10138 */
10139 buttonMode: boolean;
10140 /**
10141 * This defines what cursor mode is used when the mouse cursor
10142 * is hovered over the displayObject.
10143 *
10144 * @example
10145 * const sprite = new PIXI.Sprite(texture);
10146 * sprite.interactive = true;
10147 * sprite.cursor = 'wait';
10148 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
10149 *
10150 * @member {string}
10151 * @memberof PIXI.DisplayObject#
10152 */
10153 cursor: string;
10154 /**
10155 * Set this to true if you want this display object to be cached as a bitmap.
10156 * This basically takes a snap shot of the display object as it is at that moment. It can
10157 * provide a performance benefit for complex static displayObjects.
10158 * To remove simply set this property to `false`
10159 *
10160 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
10161 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
10162 *
10163 * @member {boolean}
10164 * @memberof PIXI.DisplayObject#
10165 */
10166 cacheAsBitmap: boolean;
10167 /**
10168 * The instance name of the object.
10169 *
10170 * @memberof PIXI.DisplayObject#
10171 * @member {string} name
10172 */
10173 name: string;
10174 /**
10175 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
10176 *
10177 * @method getGlobalPosition
10178 * @memberof PIXI.DisplayObject#
10179 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
10180 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
10181 * being updated. This means the calculation returned MAY be out of date BUT will give you a
10182 * nice performance boost.
10183 * @return {PIXI.Point} The updated point.
10184 */
10185 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
10186 }
10187 /**
10188 * This class provides renderer-specific plugins for exporting content from a renderer.
10189 * For instance, these plugins can be used for saving an Image, Canvas element or for exporting the raw image data (pixels).
10190 *
10191 * Do not instantiate these plugins directly. It is available from the `renderer.plugins` property.
10192 * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.
10193 * @example
10194 * // Create a new app (will auto-add extract plugin to renderer)
10195 * const app = new PIXI.Application();
10196 *
10197 * // Draw a red circle
10198 * const graphics = new PIXI.Graphics()
10199 * .beginFill(0xFF0000)
10200 * .drawCircle(0, 0, 50);
10201 *
10202 * // Render the graphics as an HTMLImageElement
10203 * const image = app.renderer.plugins.extract.image(graphics);
10204 * document.body.appendChild(image);
10205 * @class
10206 * @memberof PIXI
10207 */
10208 class Extract {
10209 constructor(renderer: PIXI.Renderer);
10210 /**
10211 * Will return a HTML Image of the target
10212 *
10213 * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
10214 * to convert. If left empty will use the main renderer
10215 * @param {string} [format] - Image format, e.g. "image/jpeg" or "image/webp".
10216 * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.
10217 * @return {HTMLImageElement} HTML Image of the target
10218 */
10219 image(target: PIXI.DisplayObject | PIXI.RenderTexture, format?: string, quality?: number): HTMLImageElement;
10220 /**
10221 * Will return a a base64 encoded string of this target. It works by calling
10222 * `Extract.getCanvas` and then running toDataURL on that.
10223 *
10224 * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
10225 * to convert. If left empty will use the main renderer
10226 * @param {string} [format] - Image format, e.g. "image/jpeg" or "image/webp".
10227 * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.
10228 * @return {string} A base64 encoded string of the texture.
10229 */
10230 base64(target: PIXI.DisplayObject | PIXI.RenderTexture, format?: string, quality?: number): string;
10231 /**
10232 * Creates a Canvas element, renders this target to it and then returns it.
10233 *
10234 * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
10235 * to convert. If left empty will use the main renderer
10236 * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.
10237 */
10238 canvas(target: PIXI.DisplayObject | PIXI.RenderTexture): HTMLCanvasElement;
10239 /**
10240 * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA
10241 * order, with integer values between 0 and 255 (included).
10242 *
10243 * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
10244 * to convert. If left empty will use the main renderer
10245 * @return {Uint8Array} One-dimensional array containing the pixel data of the entire texture
10246 */
10247 pixels(target: PIXI.DisplayObject | PIXI.RenderTexture): Uint8Array;
10248 /**
10249 * Destroys the extract
10250 *
10251 */
10252 destroy(): void;
10253 }
10254 /**
10255 * The Graphics class contains methods used to draw primitive shapes such as lines, circles and
10256 * rectangles to the display, and to color and fill them.
10257 *
10258 * Note that because Graphics can share a GraphicsGeometry with other instances,
10259 * it is necessary to call `destroy()` to properly dereference the underlying
10260 * GraphicsGeometry and avoid a memory leak. Alternatively, keep using the same
10261 * Graphics instance and call `clear()` between redraws.
10262 *
10263 * @class
10264 * @extends PIXI.Container
10265 * @memberof PIXI
10266 */
10267 class Graphics extends PIXI.Container {
10268 constructor(geometry?: PIXI.GraphicsGeometry);
10269 /**
10270 * Generates a canvas texture. Only available with **pixi.js-legacy** bundle
10271 * or the **@pixi/canvas-graphics** package.
10272 * @method generateCanvasTexture
10273 * @memberof PIXI.Graphics#
10274 * @param {PIXI.SCALE_MODES} scaleMode - The scale mode of the texture.
10275 * @param {number} resolution - The resolution of the texture.
10276 * @return {PIXI.Texture} The new texture.
10277 */
10278 generateCanvasTexture(scaleMode: PIXI.SCALE_MODES, resolution: number): PIXI.Texture;
10279 /**
10280 * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
10281 * Can be shared between multiple Graphics objects.
10282 *
10283 * @member {PIXI.Shader} PIXI.Graphics#shader
10284 */
10285 shader: PIXI.Shader;
10286 /**
10287 * Represents the WebGL state the Graphics required to render, excludes shader and geometry. E.g.,
10288 * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
10289 *
10290 * @member {PIXI.State} PIXI.Graphics#state
10291 */
10292 state: PIXI.State;
10293 /**
10294 * Current fill style
10295 *
10296 * @member {PIXI.FillStyle} PIXI.Graphics#_fillStyle
10297 * @protected
10298 */
10299 protected _fillStyle: PIXI.FillStyle;
10300 /**
10301 * Current line style
10302 *
10303 * @member {PIXI.LineStyle} PIXI.Graphics#_lineStyle
10304 * @protected
10305 */
10306 protected _lineStyle: PIXI.LineStyle;
10307 /**
10308 * Current shape transform matrix.
10309 *
10310 * @member {PIXI.Matrix} PIXI.Graphics#_matrix
10311 * @protected
10312 */
10313 protected _matrix: PIXI.Matrix;
10314 /**
10315 * Current hole mode is enabled.
10316 *
10317 * @member {boolean} PIXI.Graphics#_holeMode
10318 * @default false
10319 * @protected
10320 */
10321 protected _holeMode: boolean;
10322 /**
10323 * Current path
10324 *
10325 * @member {PIXI.Polygon} PIXI.Graphics#currentPath
10326 * @protected
10327 */
10328 protected currentPath: PIXI.Polygon;
10329 /**
10330 * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.
10331 * This is useful if your graphics element does not change often, as it will speed up the rendering
10332 * of the object in exchange for taking up texture memory. It is also useful if you need the graphics
10333 * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if
10334 * you are constantly redrawing the graphics element.
10335 *
10336 * @name cacheAsBitmap
10337 * @member {boolean}
10338 * @memberof PIXI.Graphics#
10339 * @default false
10340 */
10341 cacheAsBitmap: boolean;
10342 /**
10343 * A collections of batches! These can be drawn by the renderer batch system.
10344 *
10345 * @protected
10346 * @member {object[]} PIXI.Graphics#batches
10347 */
10348 protected batches: any[];
10349 /**
10350 * Update dirty for limiting calculating tints for batches.
10351 *
10352 * @protected
10353 * @member {number} PIXI.Graphics#batchTint
10354 * @default -1
10355 */
10356 protected batchTint: number;
10357 /**
10358 * Update dirty for limiting calculating batches.
10359 *
10360 * @protected
10361 * @member {number} PIXI.Graphics#batchDirty
10362 * @default -1
10363 */
10364 protected batchDirty: number;
10365 /**
10366 * Copy of the object vertex data.
10367 *
10368 * @protected
10369 * @member {Float32Array} PIXI.Graphics#vertexData
10370 */
10371 protected vertexData: Float32Array;
10372 /**
10373 * Renderer plugin for batching
10374 *
10375 * @member {string} PIXI.Graphics#pluginName
10376 * @default 'batch'
10377 */
10378 pluginName: string;
10379 /**
10380 * Includes vertex positions, face indices, normals, colors, UVs, and
10381 * custom attributes within buffers, reducing the cost of passing all
10382 * this data to the GPU. Can be shared between multiple Mesh or Graphics objects.
10383 *
10384 * @member {PIXI.GraphicsGeometry}
10385 * @readonly
10386 */
10387 readonly geometry: PIXI.GraphicsGeometry;
10388 /**
10389 * Creates a new Graphics object with the same values as this one.
10390 * Note that only the geometry of the object is cloned, not its transform (position,scale,etc)
10391 *
10392 * @return {PIXI.Graphics} A clone of the graphics object
10393 */
10394 clone(): PIXI.Graphics;
10395 /**
10396 * The blend mode to be applied to the graphic shape. Apply a value of
10397 * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
10398 *
10399 * @member {number}
10400 * @default PIXI.BLEND_MODES.NORMAL;
10401 * @see PIXI.BLEND_MODES
10402 */
10403 blendMode: number;
10404 /**
10405 * The tint applied to the graphic shape. This is a hex value. A value of
10406 * 0xFFFFFF will remove any tint effect.
10407 *
10408 * @member {number}
10409 * @default 0xFFFFFF
10410 */
10411 tint: number;
10412 /**
10413 * The current fill style.
10414 *
10415 * @member {PIXI.FillStyle}
10416 * @readonly
10417 */
10418 readonly fill: PIXI.FillStyle;
10419 /**
10420 * The current line style.
10421 *
10422 * @member {PIXI.LineStyle}
10423 * @readonly
10424 */
10425 readonly line: PIXI.LineStyle;
10426 /**
10427 * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()
10428 * method or the drawCircle() method.
10429 *
10430 * @method PIXI.Graphics#lineStyle
10431 * @param {number} [width=0] - width of the line to draw, will update the objects stored style
10432 * @param {number} [color=0x0] - color of the line to draw, will update the objects stored style
10433 * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style
10434 * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
10435 * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP
10436 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10437 */
10438 lineStyle(width?: number, color?: number, alpha?: number, alignment?: number, native?: boolean): PIXI.Graphics;
10439 /**
10440 * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()
10441 * method or the drawCircle() method.
10442 *
10443 * @method PIXI.Graphics#lineStyle
10444 * @param {number} [width=0] - width of the line to draw, will update the objects stored style
10445 * @param {number} [color=0x0] - color of the line to draw, will update the objects stored style
10446 * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style
10447 * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
10448 * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP
10449 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10450 */
10451 lineStyle(width?: number, color?: number, alpha?: number, alignment?: number, native?: boolean): PIXI.Graphics;
10452 /**
10453 * Like line style but support texture for line fill.
10454 *
10455 * @param {object} [options] - Collection of options for setting line style.
10456 * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style
10457 * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to use
10458 * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style.
10459 * Default 0xFFFFFF if texture present.
10460 * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style
10461 * @param {PIXI.Matrix} [options.matrix=null] - Texture matrix to transform texture
10462 * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
10463 * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP
10464 * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style
10465 * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style
10466 * @param {number}[options.miterLimit=10] - miter limit ratio
10467 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10468 */
10469 lineTextureStyle(options?: {
10470 width?: number;
10471 texture?: PIXI.Texture;
10472 color?: number;
10473 alpha?: number;
10474 matrix?: PIXI.Matrix;
10475 alignment?: number;
10476 native?: boolean;
10477 cap?: PIXI.LINE_CAP;
10478 join?: PIXI.LINE_JOIN;
10479 miterLimit?: number;
10480 }): PIXI.Graphics;
10481 /**
10482 * Start a polygon object internally
10483 * @protected
10484 */
10485 protected startPoly(): void;
10486 /**
10487 * Finish the polygon object.
10488 * @protected
10489 */
10490 protected finishPoly(): void;
10491 /**
10492 * Moves the current drawing position to x, y.
10493 *
10494 * @param {number} x - the X coordinate to move to
10495 * @param {number} y - the Y coordinate to move to
10496 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10497 */
10498 moveTo(x: number, y: number): PIXI.Graphics;
10499 /**
10500 * Draws a line using the current line style from the current drawing position to (x, y);
10501 * The current drawing position is then set to (x, y).
10502 *
10503 * @param {number} x - the X coordinate to draw to
10504 * @param {number} y - the Y coordinate to draw to
10505 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10506 */
10507 lineTo(x: number, y: number): PIXI.Graphics;
10508 /**
10509 * Initialize the curve
10510 *
10511 * @protected
10512 * @param {number} [x=0]
10513 * @param {number} [y=0]
10514 */
10515 protected _initCurve(x?: number, y?: number): void;
10516 /**
10517 * Calculate the points for a quadratic bezier curve and then draws it.
10518 * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
10519 *
10520 * @param {number} cpX - Control point x
10521 * @param {number} cpY - Control point y
10522 * @param {number} toX - Destination point x
10523 * @param {number} toY - Destination point y
10524 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10525 */
10526 quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): PIXI.Graphics;
10527 /**
10528 * Calculate the points for a bezier curve and then draws it.
10529 *
10530 * @param {number} cpX - Control point x
10531 * @param {number} cpY - Control point y
10532 * @param {number} cpX2 - Second Control point x
10533 * @param {number} cpY2 - Second Control point y
10534 * @param {number} toX - Destination point x
10535 * @param {number} toY - Destination point y
10536 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10537 */
10538 bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): PIXI.Graphics;
10539 /**
10540 * The arcTo() method creates an arc/curve between two tangents on the canvas.
10541 *
10542 * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
10543 *
10544 * @param {number} x1 - The x-coordinate of the first tangent point of the arc
10545 * @param {number} y1 - The y-coordinate of the first tangent point of the arc
10546 * @param {number} x2 - The x-coordinate of the end of the arc
10547 * @param {number} y2 - The y-coordinate of the end of the arc
10548 * @param {number} radius - The radius of the arc
10549 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10550 */
10551 arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): PIXI.Graphics;
10552 /**
10553 * The arc method creates an arc/curve (used to create circles, or parts of circles).
10554 *
10555 * @param {number} cx - The x-coordinate of the center of the circle
10556 * @param {number} cy - The y-coordinate of the center of the circle
10557 * @param {number} radius - The radius of the circle
10558 * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position
10559 * of the arc's circle)
10560 * @param {number} endAngle - The ending angle, in radians
10561 * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be
10562 * counter-clockwise or clockwise. False is default, and indicates clockwise, while true
10563 * indicates counter-clockwise.
10564 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10565 */
10566 arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): PIXI.Graphics;
10567 /**
10568 * Specifies a simple one-color fill that subsequent calls to other Graphics methods
10569 * (such as lineTo() or drawCircle()) use when drawing.
10570 *
10571 * @param {number} [color=0] - the color of the fill
10572 * @param {number} [alpha=1] - the alpha of the fill
10573 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10574 */
10575 beginFill(color?: number, alpha?: number): PIXI.Graphics;
10576 /**
10577 * Begin the texture fill
10578 *
10579 * @param {object} [options] - Object object.
10580 * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to fill
10581 * @param {number} [options.color=0xffffff] - Background to fill behind texture
10582 * @param {number} [options.alpha=1] - Alpha of fill
10583 * @param {PIXI.Matrix} [options.matrix=null] - Transform matrix
10584 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10585 */
10586 beginTextureFill(options?: {
10587 texture?: PIXI.Texture;
10588 color?: number;
10589 alpha?: number;
10590 matrix?: PIXI.Matrix;
10591 }): PIXI.Graphics;
10592 /**
10593 * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
10594 *
10595 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10596 */
10597 endFill(): PIXI.Graphics;
10598 /**
10599 * Draws a rectangle shape.
10600 *
10601 * @param {number} x - The X coord of the top-left of the rectangle
10602 * @param {number} y - The Y coord of the top-left of the rectangle
10603 * @param {number} width - The width of the rectangle
10604 * @param {number} height - The height of the rectangle
10605 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10606 */
10607 drawRect(x: number, y: number, width: number, height: number): PIXI.Graphics;
10608 /**
10609 * Draw a rectangle shape with rounded/beveled corners.
10610 *
10611 * @param {number} x - The X coord of the top-left of the rectangle
10612 * @param {number} y - The Y coord of the top-left of the rectangle
10613 * @param {number} width - The width of the rectangle
10614 * @param {number} height - The height of the rectangle
10615 * @param {number} radius - Radius of the rectangle corners
10616 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10617 */
10618 drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): PIXI.Graphics;
10619 /**
10620 * Draws a circle.
10621 *
10622 * @param {number} x - The X coordinate of the center of the circle
10623 * @param {number} y - The Y coordinate of the center of the circle
10624 * @param {number} radius - The radius of the circle
10625 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10626 */
10627 drawCircle(x: number, y: number, radius: number): PIXI.Graphics;
10628 /**
10629 * Draws an ellipse.
10630 *
10631 * @param {number} x - The X coordinate of the center of the ellipse
10632 * @param {number} y - The Y coordinate of the center of the ellipse
10633 * @param {number} width - The half width of the ellipse
10634 * @param {number} height - The half height of the ellipse
10635 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10636 */
10637 drawEllipse(x: number, y: number, width: number, height: number): PIXI.Graphics;
10638 /**
10639 * Draws a polygon using the given path.
10640 *
10641 * @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon.
10642 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10643 */
10644 drawPolygon(...path: (number[] | PIXI.Point[] | PIXI.Polygon)[]): PIXI.Graphics;
10645 /**
10646 * Draw any shape.
10647 *
10648 * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - Shape to draw
10649 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10650 */
10651 drawShape(shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle): PIXI.Graphics;
10652 /**
10653 * Draw a star shape with an arbitrary number of points.
10654 *
10655 * @param {number} x - Center X position of the star
10656 * @param {number} y - Center Y position of the star
10657 * @param {number} points - The number of points of the star, must be > 1
10658 * @param {number} radius - The outer radius of the star
10659 * @param {number} [innerRadius] - The inner radius between points, default half `radius`
10660 * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical
10661 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10662 */
10663 drawStar(x: number, y: number, points: number, radius: number, innerRadius?: number, rotation?: number): PIXI.Graphics;
10664 /**
10665 * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
10666 *
10667 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
10668 */
10669 clear(): PIXI.Graphics;
10670 /**
10671 * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and
10672 * masked with gl.scissor.
10673 *
10674 * @returns {boolean} True if only 1 rect.
10675 */
10676 isFastRect(): boolean;
10677 /**
10678 * Renders the object using the WebGL renderer
10679 *
10680 * @protected
10681 * @param {PIXI.Renderer} renderer - The renderer
10682 */
10683 protected _render(renderer: PIXI.Renderer): void;
10684 /**
10685 * Populating batches for rendering
10686 *
10687 * @protected
10688 */
10689 protected _populateBatches(): void;
10690 /**
10691 * Renders the batches using the BathedRenderer plugin
10692 *
10693 * @protected
10694 * @param {PIXI.Renderer} renderer - The renderer
10695 */
10696 protected _renderBatched(renderer: PIXI.Renderer): void;
10697 /**
10698 * Renders the graphics direct
10699 *
10700 * @protected
10701 * @param {PIXI.Renderer} renderer - The renderer
10702 */
10703 protected _renderDirect(renderer: PIXI.Renderer): void;
10704 /**
10705 * Renders specific DrawCall
10706 *
10707 * @param {PIXI.Renderer} renderer
10708 * @param {PIXI.BatchDrawCall} drawCall
10709 */
10710 _renderDrawCallDirect(renderer: PIXI.Renderer, drawCall: PIXI.BatchDrawCall): void;
10711 /**
10712 * Resolves shader for direct rendering
10713 *
10714 * @protected
10715 * @param {PIXI.Renderer} renderer - The renderer
10716 */
10717 protected _resolveDirectShader(renderer: PIXI.Renderer): void;
10718 /**
10719 * Retrieves the bounds of the graphic shape as a rectangle object
10720 *
10721 * @protected
10722 */
10723 protected _calculateBounds(): void;
10724 /**
10725 * Tests if a point is inside this graphics object
10726 *
10727 * @param {PIXI.IPointData} point - the point to test
10728 * @return {boolean} the result of the test
10729 */
10730 containsPoint(point: PIXI.IPointData): boolean;
10731 /**
10732 * Recalcuate the tint by applying tin to batches using Graphics tint.
10733 * @protected
10734 */
10735 protected calculateTints(): void;
10736 /**
10737 * If there's a transform update or a change to the shape of the
10738 * geometry, recaculate the vertices.
10739 * @protected
10740 */
10741 protected calculateVertices(): void;
10742 /**
10743 * Closes the current path.
10744 *
10745 * @return {PIXI.Graphics} Returns itself.
10746 */
10747 closePath(): PIXI.Graphics;
10748 /**
10749 * Apply a matrix to the positional data.
10750 *
10751 * @param {PIXI.Matrix} matrix - Matrix to use for transform current shape.
10752 * @return {PIXI.Graphics} Returns itself.
10753 */
10754 setMatrix(matrix: PIXI.Matrix): PIXI.Graphics;
10755 /**
10756 * Begin adding holes to the last draw shape
10757 * IMPORTANT: holes must be fully inside a shape to work
10758 * Also weirdness ensues if holes overlap!
10759 * Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,
10760 * please use `moveTo` `lineTo`, `quadraticCurveTo` if you rely on pixi-legacy bundle.
10761 * @return {PIXI.Graphics} Returns itself.
10762 */
10763 beginHole(): PIXI.Graphics;
10764 /**
10765 * End adding holes to the last draw shape
10766 * @return {PIXI.Graphics} Returns itself.
10767 */
10768 endHole(): PIXI.Graphics;
10769 /**
10770 * Destroys the Graphics object.
10771 *
10772 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
10773 * options have been set to that value
10774 * @param {boolean} [options.children=false] - if set to true, all the children will have
10775 * their destroy method called as well. 'options' will be passed on to those calls.
10776 * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
10777 * Should it destroy the texture of the child sprite
10778 * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
10779 * Should it destroy the base texture of the child sprite
10780 */
10781 destroy(options?: {
10782 children?: boolean;
10783 texture?: boolean;
10784 baseTexture?: boolean;
10785 }): void;
10786 /**
10787 * Draw Rectangle with chamfer corners.
10788 *
10789 * _Note: Only available with **@pixi/graphics-extras**._
10790 *
10791 * @method PIXI.Graphics#drawChamferRect
10792 * @param {number} x - Upper left corner of rect
10793 * @param {number} y - Upper right corner of rect
10794 * @param {number} width - Width of rect
10795 * @param {number} height - Height of rect
10796 * @param {number} chamfer - accept negative or positive values
10797 * @return {PIXI.Graphics} Returns self.
10798 */
10799 drawChamferRect(x: number, y: number, width: number, height: number, chamfer: number): PIXI.Graphics;
10800 /**
10801 * Draw Rectangle with fillet corners.
10802 *
10803 * _Note: Only available with **@pixi/graphics-extras**._
10804 *
10805 * @method PIXI.Graphics#drawFilletRect
10806 * @param {number} x - Upper left corner of rect
10807 * @param {number} y - Upper right corner of rect
10808 * @param {number} width - Width of rect
10809 * @param {number} height - Height of rect
10810 * @param {number} fillet - non-zero real number, size of corner cutout
10811 * @return {PIXI.Graphics} Returns self.
10812 */
10813 drawFilletRect(x: number, y: number, width: number, height: number, fillet: number): PIXI.Graphics;
10814 /**
10815 * Draw a regular polygon where all sides are the same length.
10816 *
10817 * _Note: Only available with **@pixi/graphics-extras**._
10818 *
10819 * @method PIXI.Graphics#drawRegularPolygon
10820 * @param {number} x - X position
10821 * @param {number} y - Y position
10822 * @param {number} radius - Polygon radius
10823 * @param {number} sides - Minimum value is 3
10824 * @param {number} rotation - Starting rotation values in radians..
10825 * @return {PIXI.Graphics}
10826 */
10827 drawRegularPolygon(x: number, y: number, radius: number, sides: number, rotation: number): PIXI.Graphics;
10828 /**
10829 * Draw a torus shape, like a donut. Can be used for something like a circle loader.
10830 *
10831 * _Note: Only available with **@pixi/graphics-extras**._
10832 *
10833 * @method PIXI.Graphics#drawTorus
10834 * @param {number} x - X position
10835 * @param {number} y - Y position
10836 * @param {number} innerRadius - Inner circle radius
10837 * @param {number} outerRadius - Outer circle radius
10838 * @param {number} [startArc=0] - Where to begin sweep, in radians, 0.0 = to the right
10839 * @param {number} [endArc=Math.PI*2] - Where to end sweep, in radians
10840 * @return {PIXI.Graphics}
10841 */
10842 drawTorus(x: number, y: number, innerRadius: number, outerRadius: number, startArc?: number, endArc?: number): PIXI.Graphics;
10843 /**
10844 * Renders the object using the Canvas renderer
10845 * @method renderCanvas
10846 * @memberof PIXI.Container#
10847 * @param {PIXI.CanvasRenderer} renderer - The renderer
10848 */
10849 renderCanvas(renderer: PIXI.CanvasRenderer): void;
10850 /**
10851 * The array of children of this container.
10852 *
10853 * @member {PIXI.DisplayObject[]} PIXI.Container#children
10854 * @readonly
10855 */
10856 readonly children: PIXI.DisplayObject[];
10857 /**
10858 * If set to true, the container will sort its children by zIndex value
10859 * when updateTransform() is called, or manually if sortChildren() is called.
10860 *
10861 * This actually changes the order of elements in the array, so should be treated
10862 * as a basic solution that is not performant compared to other solutions,
10863 * such as @link https://github.com/pixijs/pixi-display
10864 *
10865 * Also be aware of that this may not work nicely with the addChildAt() function,
10866 * as the zIndex sorting may cause the child to automatically sorted to another position.
10867 *
10868 * @see PIXI.settings.SORTABLE_CHILDREN
10869 *
10870 * @member {boolean} PIXI.Container#sortableChildren
10871 */
10872 sortableChildren: boolean;
10873 /**
10874 * Should children be sorted by zIndex at the next updateTransform call.
10875 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
10876 *
10877 * @member {boolean} PIXI.Container#sortDirty
10878 */
10879 sortDirty: boolean;
10880 /**
10881 * Overridable method that can be used by Container subclasses whenever the children array is modified
10882 *
10883 * @protected
10884 */
10885 protected onChildrenChange(): void;
10886 /**
10887 * Adds one or more children to the container.
10888 *
10889 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
10890 *
10891 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
10892 * @return {PIXI.DisplayObject} The first child that was added.
10893 */
10894 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
10895 /**
10896 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
10897 *
10898 * @param {PIXI.DisplayObject} child - The child to add
10899 * @param {number} index - The index to place the child in
10900 * @return {PIXI.DisplayObject} The child that was added.
10901 */
10902 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
10903 /**
10904 * Swaps the position of 2 Display Objects within this container.
10905 *
10906 * @param {PIXI.DisplayObject} child - First display object to swap
10907 * @param {PIXI.DisplayObject} child2 - Second display object to swap
10908 */
10909 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
10910 /**
10911 * Returns the index position of a child DisplayObject instance
10912 *
10913 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
10914 * @return {number} The index position of the child display object to identify
10915 */
10916 getChildIndex(child: PIXI.DisplayObject): number;
10917 /**
10918 * Changes the position of an existing child in the display object container
10919 *
10920 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
10921 * @param {number} index - The resulting index number for the child display object
10922 */
10923 setChildIndex(child: PIXI.DisplayObject, index: number): void;
10924 /**
10925 * Returns the child at the specified index
10926 *
10927 * @param {number} index - The index to get the child at
10928 * @return {PIXI.DisplayObject} The child at the given index, if any.
10929 */
10930 getChildAt(index: number): PIXI.DisplayObject;
10931 /**
10932 * Removes one or more children from the container.
10933 *
10934 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
10935 * @return {PIXI.DisplayObject} The first child that was removed.
10936 */
10937 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
10938 /**
10939 * Removes a child from the specified index position.
10940 *
10941 * @param {number} index - The index to get the child from
10942 * @return {PIXI.DisplayObject} The child that was removed.
10943 */
10944 removeChildAt(index: number): PIXI.DisplayObject;
10945 /**
10946 * Removes all children from this container that are within the begin and end indexes.
10947 *
10948 * @param {number} [beginIndex=0] - The beginning position.
10949 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
10950 * @returns {PIXI.DisplayObject[]} List of removed children
10951 */
10952 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
10953 /**
10954 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
10955 */
10956 sortChildren(): void;
10957 /**
10958 * Updates the transform on all children of this container for rendering
10959 */
10960 updateTransform(): void;
10961 /**
10962 * Recalculates the bounds of the container.
10963 *
10964 */
10965 calculateBounds(): void;
10966 /**
10967 * Retrieves the local bounds of the displayObject as a rectangle object.
10968 *
10969 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
10970 * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,
10971 * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
10972 * @return {PIXI.Rectangle} The rectangular bounding area.
10973 */
10974 getLocalBounds(rect?: PIXI.Rectangle, skipChildrenUpdate?: boolean): PIXI.Rectangle;
10975 /**
10976 * Renders the object using the WebGL renderer
10977 *
10978 * @param {PIXI.Renderer} renderer - The renderer
10979 */
10980 render(renderer: PIXI.Renderer): void;
10981 /**
10982 * Render the object using the WebGL renderer and advanced features.
10983 *
10984 * @protected
10985 * @param {PIXI.Renderer} renderer - The renderer
10986 */
10987 protected renderAdvanced(renderer: PIXI.Renderer): void;
10988 /**
10989 * The width of the Container, setting this will actually modify the scale to achieve the value set
10990 *
10991 * @member {number}
10992 */
10993 width: number;
10994 /**
10995 * The height of the Container, setting this will actually modify the scale to achieve the value set
10996 *
10997 * @member {number}
10998 */
10999 height: number;
11000 /**
11001 * Container default updateTransform, does update children of container.
11002 * Will crash if there's no parent element.
11003 *
11004 * @memberof PIXI.Container#
11005 * @function containerUpdateTransform
11006 */
11007 containerUpdateTransform(): void;
11008 /**
11009 * Determines if the children to the displayObject can be clicked/touched
11010 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
11011 *
11012 * @member {boolean}
11013 * @memberof PIXI.Container#
11014 */
11015 interactiveChildren: boolean;
11016 /**
11017 * Returns the display object in the container.
11018 *
11019 * Recursive searches are done in a preorder traversal.
11020 *
11021 * @method getChildByName
11022 * @memberof PIXI.Container#
11023 * @param {string} name - Instance name.
11024 * @param {boolean}[deep=false] - Whether to search recursively
11025 * @return {PIXI.DisplayObject} The child with the specified name.
11026 */
11027 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
11028 /**
11029 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
11030 * shadow div with attributes set
11031 *
11032 * @member {boolean}
11033 * @memberof PIXI.DisplayObject#
11034 */
11035 accessible: boolean;
11036 /**
11037 * Sets the title attribute of the shadow div
11038 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
11039 *
11040 * @member {?string}
11041 * @memberof PIXI.DisplayObject#
11042 */
11043 accessibleTitle: string;
11044 /**
11045 * Sets the aria-label attribute of the shadow div
11046 *
11047 * @member {string}
11048 * @memberof PIXI.DisplayObject#
11049 */
11050 accessibleHint: string;
11051 /**
11052 * @member {boolean}
11053 * @memberof PIXI.DisplayObject#
11054 * @todo Needs docs.
11055 */
11056 _accessibleActive: boolean;
11057 /**
11058 * @member {boolean}
11059 * @memberof PIXI.DisplayObject#
11060 * @todo Needs docs.
11061 */
11062 _accessibleDiv: boolean;
11063 /**
11064 * Specify the type of div the accessible layer is. Screen readers treat the element differently
11065 * depending on this type. Defaults to button.
11066 *
11067 * @member {string}
11068 * @memberof PIXI.DisplayObject#
11069 * @default 'button'
11070 */
11071 accessibleType: string;
11072 /**
11073 * Specify the pointer-events the accessible div will use
11074 * Defaults to auto.
11075 *
11076 * @member {string}
11077 * @memberof PIXI.DisplayObject#
11078 * @default 'auto'
11079 */
11080 accessiblePointerEvents: string;
11081 /**
11082 * Setting to false will prevent any children inside this container to
11083 * be accessible. Defaults to true.
11084 *
11085 * @member {boolean}
11086 * @memberof PIXI.DisplayObject#
11087 * @default true
11088 */
11089 accessibleChildren: boolean;
11090 /**
11091 * World transform and local transform of this object.
11092 * This will become read-only later, please do not assign anything there unless you know what are you doing.
11093 *
11094 * @member {PIXI.Transform} PIXI.DisplayObject#transform
11095 */
11096 transform: PIXI.Transform;
11097 /**
11098 * The opacity of the object.
11099 *
11100 * @member {number} PIXI.DisplayObject#alpha
11101 */
11102 alpha: number;
11103 /**
11104 * The visibility of the object. If false the object will not be drawn, and
11105 * the updateTransform function will not be called.
11106 *
11107 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
11108 *
11109 * @member {boolean} PIXI.DisplayObject#visible
11110 */
11111 visible: boolean;
11112 /**
11113 * Can this object be rendered, if false the object will not be drawn but the updateTransform
11114 * methods will still be called.
11115 *
11116 * Only affects recursive calls from parent. You can ask for bounds manually.
11117 *
11118 * @member {boolean} PIXI.DisplayObject#renderable
11119 */
11120 renderable: boolean;
11121 /**
11122 * The display object container that contains this display object.
11123 *
11124 * @member {PIXI.Container} PIXI.DisplayObject#parent
11125 */
11126 parent: PIXI.Container;
11127 /**
11128 * The multiplied alpha of the displayObject.
11129 *
11130 * @member {number} PIXI.DisplayObject#worldAlpha
11131 * @readonly
11132 */
11133 readonly worldAlpha: number;
11134 /**
11135 * Which index in the children array the display component was before the previous zIndex sort.
11136 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
11137 *
11138 * @member {number} PIXI.DisplayObject#_lastSortedIndex
11139 * @protected
11140 */
11141 protected _lastSortedIndex: number;
11142 /**
11143 * The zIndex of the displayObject.
11144 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
11145 *
11146 * @member {number} PIXI.DisplayObject#_zIndex
11147 * @protected
11148 */
11149 protected _zIndex: number;
11150 /**
11151 * The area the filter is applied to. This is used as more of an optimization
11152 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
11153 *
11154 * Also works as an interaction mask.
11155 *
11156 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
11157 */
11158 filterArea: PIXI.Rectangle;
11159 /**
11160 * Sets the filters for the displayObject.
11161 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
11162 * To remove filters simply set this property to `'null'`.
11163 *
11164 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
11165 */
11166 filters: PIXI.Filter[];
11167 /**
11168 * Currently enabled filters
11169 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
11170 * @protected
11171 */
11172 protected _enabledFilters: PIXI.Filter[];
11173 /**
11174 * The bounds object, this is used to calculate and store the bounds of the displayObject.
11175 *
11176 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
11177 */
11178 _bounds: PIXI.Bounds;
11179 /**
11180 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
11181 *
11182 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
11183 */
11184 _localBounds: PIXI.Bounds;
11185 /**
11186 * Flags the cached bounds as dirty.
11187 *
11188 * @member {number} PIXI.DisplayObject#_boundsID
11189 * @protected
11190 */
11191 protected _boundsID: number;
11192 /**
11193 * Cache of this display-object's bounds-rectangle.
11194 *
11195 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
11196 * @protected
11197 */
11198 protected _boundsRect: PIXI.Bounds;
11199 /**
11200 * Cache of this display-object's local-bounds rectangle.
11201 *
11202 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
11203 * @protected
11204 */
11205 protected _localBoundsRect: PIXI.Bounds;
11206 /**
11207 * The original, cached mask of the object.
11208 *
11209 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
11210 * @protected
11211 */
11212 protected _mask: PIXI.Container | PIXI.MaskData | null;
11213 /**
11214 * If the object has been destroyed via destroy(). If true, it should not be used.
11215 *
11216 * @member {boolean} PIXI.DisplayObject#_destroyed
11217 * @protected
11218 */
11219 protected _destroyed: boolean;
11220 /**
11221 * used to fast check if a sprite is.. a sprite!
11222 * @member {boolean} PIXI.DisplayObject#isSprite
11223 */
11224 isSprite: boolean;
11225 /**
11226 * Does any other displayObject use this object as a mask?
11227 * @member {boolean} PIXI.DisplayObject#isMask
11228 */
11229 isMask: boolean;
11230 /**
11231 * Recursively updates transform of all objects from the root to this one
11232 * internal function for toLocal()
11233 */
11234 _recursivePostUpdateTransform(): void;
11235 /**
11236 * Retrieves the bounds of the displayObject as a rectangle object.
11237 *
11238 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
11239 * being updated. This means the calculation returned MAY be out of date BUT will give you a
11240 * nice performance boost.
11241 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
11242 * @return {PIXI.Rectangle} The rectangular bounding area.
11243 */
11244 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
11245 /**
11246 * Calculates the global position of the display object.
11247 *
11248 * @param {PIXI.IPointData} position - The world origin to calculate from.
11249 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
11250 * (otherwise will create a new Point).
11251 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
11252 * @return {PIXI.Point} A point object representing the position of this object.
11253 */
11254 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
11255 /**
11256 * Calculates the local position of the display object relative to another point.
11257 *
11258 * @param {PIXI.IPointData} position - The world origin to calculate from.
11259 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
11260 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
11261 * (otherwise will create a new Point).
11262 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
11263 * @return {PIXI.Point} A point object representing the position of this object
11264 */
11265 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
11266 /**
11267 * Set the parent Container of this DisplayObject.
11268 *
11269 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
11270 * @return {PIXI.Container} The Container that this DisplayObject was added to.
11271 */
11272 setParent(container: PIXI.Container): PIXI.Container;
11273 /**
11274 * Convenience function to set the position, scale, skew and pivot at once.
11275 *
11276 * @param {number} [x=0] - The X position
11277 * @param {number} [y=0] - The Y position
11278 * @param {number} [scaleX=1] - The X scale value
11279 * @param {number} [scaleY=1] - The Y scale value
11280 * @param {number} [rotation=0] - The rotation
11281 * @param {number} [skewX=0] - The X skew value
11282 * @param {number} [skewY=0] - The Y skew value
11283 * @param {number} [pivotX=0] - The X pivot value
11284 * @param {number} [pivotY=0] - The Y pivot value
11285 * @return {PIXI.DisplayObject} The DisplayObject instance
11286 */
11287 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
11288 /**
11289 * @protected
11290 * @member {PIXI.Container}
11291 */
11292 protected _tempDisplayObjectParent: PIXI.Container;
11293 /**
11294 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
11295 *
11296 * ```
11297 * const cacheParent = elem.enableTempParent();
11298 * elem.updateTransform();
11299 * elem.disableTempParent(cacheParent);
11300 * ```
11301 *
11302 * @returns {PIXI.DisplayObject} current parent
11303 */
11304 enableTempParent(): PIXI.DisplayObject;
11305 /**
11306 * Pair method for `enableTempParent`
11307 * @param {PIXI.DisplayObject} cacheParent actual parent of element
11308 */
11309 disableTempParent(cacheParent: PIXI.DisplayObject): void;
11310 /**
11311 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
11312 * An alias to position.x
11313 *
11314 * @member {number}
11315 */
11316 x: number;
11317 /**
11318 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
11319 * An alias to position.y
11320 *
11321 * @member {number}
11322 */
11323 y: number;
11324 /**
11325 * Current transform of the object based on world (parent) factors.
11326 *
11327 * @member {PIXI.Matrix}
11328 * @readonly
11329 */
11330 readonly worldTransform: PIXI.Matrix;
11331 /**
11332 * Current transform of the object based on local factors: position, scale, other stuff.
11333 *
11334 * @member {PIXI.Matrix}
11335 * @readonly
11336 */
11337 readonly localTransform: PIXI.Matrix;
11338 /**
11339 * The coordinate of the object relative to the local coordinates of the parent.
11340 * Assignment by value since pixi-v4.
11341 *
11342 * @member {PIXI.ObservablePoint}
11343 */
11344 position: PIXI.ObservablePoint;
11345 /**
11346 * The scale factor of the object.
11347 * Assignment by value since pixi-v4.
11348 *
11349 * @member {PIXI.ObservablePoint}
11350 */
11351 scale: PIXI.ObservablePoint;
11352 /**
11353 * The pivot point of the displayObject that it rotates around.
11354 * Assignment by value since pixi-v4.
11355 *
11356 * @member {PIXI.ObservablePoint}
11357 */
11358 pivot: PIXI.ObservablePoint;
11359 /**
11360 * The skew factor for the object in radians.
11361 * Assignment by value since pixi-v4.
11362 *
11363 * @member {PIXI.ObservablePoint}
11364 */
11365 skew: PIXI.ObservablePoint;
11366 /**
11367 * The rotation of the object in radians.
11368 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
11369 *
11370 * @member {number}
11371 */
11372 rotation: number;
11373 /**
11374 * The angle of the object in degrees.
11375 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
11376 *
11377 * @member {number}
11378 */
11379 angle: number;
11380 /**
11381 * The zIndex of the displayObject.
11382 * If a container has the sortableChildren property set to true, children will be automatically
11383 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
11384 * and thus rendered on top of other displayObjects within the same container.
11385 *
11386 * @member {number}
11387 */
11388 zIndex: number;
11389 /**
11390 * Indicates if the object is globally visible.
11391 *
11392 * @member {boolean}
11393 * @readonly
11394 */
11395 readonly worldVisible: boolean;
11396 /**
11397 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
11398 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
11399 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
11400 * utilities shape clipping. To remove a mask, set this property to `null`.
11401 *
11402 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
11403 * @example
11404 * const graphics = new PIXI.Graphics();
11405 * graphics.beginFill(0xFF3300);
11406 * graphics.drawRect(50, 250, 100, 100);
11407 * graphics.endFill();
11408 *
11409 * const sprite = new PIXI.Sprite(texture);
11410 * sprite.mask = graphics;
11411 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
11412 *
11413 * @member {PIXI.Container|PIXI.MaskData|null}
11414 */
11415 mask: PIXI.Container | PIXI.MaskData | null;
11416 /**
11417 * DisplayObject default updateTransform, does not update children of container.
11418 * Will crash if there's no parent element.
11419 *
11420 * @memberof PIXI.DisplayObject#
11421 * @function displayObjectUpdateTransform
11422 */
11423 displayObjectUpdateTransform(): void;
11424 /**
11425 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
11426 * events will not be emitted unless `interactive` is set to `true`.
11427 *
11428 * @example
11429 * const sprite = new PIXI.Sprite(texture);
11430 * sprite.interactive = true;
11431 * sprite.on('tap', (event) => {
11432 * //handle event
11433 * });
11434 * @member {boolean}
11435 * @memberof PIXI.DisplayObject#
11436 */
11437 interactive: boolean;
11438 /**
11439 * Interaction shape. Children will be hit first, then this shape will be checked.
11440 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
11441 *
11442 * @example
11443 * const sprite = new PIXI.Sprite(texture);
11444 * sprite.interactive = true;
11445 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
11446 * @member {PIXI.IHitArea}
11447 * @memberof PIXI.DisplayObject#
11448 */
11449 hitArea: PIXI.IHitArea;
11450 /**
11451 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
11452 * Setting this changes the 'cursor' property to `'pointer'`.
11453 *
11454 * @example
11455 * const sprite = new PIXI.Sprite(texture);
11456 * sprite.interactive = true;
11457 * sprite.buttonMode = true;
11458 * @member {boolean}
11459 * @memberof PIXI.DisplayObject#
11460 */
11461 buttonMode: boolean;
11462 /**
11463 * This defines what cursor mode is used when the mouse cursor
11464 * is hovered over the displayObject.
11465 *
11466 * @example
11467 * const sprite = new PIXI.Sprite(texture);
11468 * sprite.interactive = true;
11469 * sprite.cursor = 'wait';
11470 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
11471 *
11472 * @member {string}
11473 * @memberof PIXI.DisplayObject#
11474 */
11475 cursor: string;
11476 /**
11477 * The instance name of the object.
11478 *
11479 * @memberof PIXI.DisplayObject#
11480 * @member {string} name
11481 */
11482 name: string;
11483 /**
11484 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
11485 *
11486 * @method getGlobalPosition
11487 * @memberof PIXI.DisplayObject#
11488 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
11489 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
11490 * being updated. This means the calculation returned MAY be out of date BUT will give you a
11491 * nice performance boost.
11492 * @return {PIXI.Point} The updated point.
11493 */
11494 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
11495 }
11496 /**
11497 * A class to contain data useful for Graphics objects
11498 *
11499 * @class
11500 * @memberof PIXI
11501 */
11502 class GraphicsData {
11503 constructor(shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle, fillStyle?: PIXI.FillStyle, lineStyle?: PIXI.LineStyle, matrix?: PIXI.Matrix);
11504 /**
11505 * The shape object to draw.
11506 * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} PIXI.GraphicsData#shape
11507 */
11508 shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle;
11509 /**
11510 * The style of the line.
11511 * @member {PIXI.LineStyle} PIXI.GraphicsData#lineStyle
11512 */
11513 lineStyle: PIXI.LineStyle;
11514 /**
11515 * The style of the fill.
11516 * @member {PIXI.FillStyle} PIXI.GraphicsData#fillStyle
11517 */
11518 fillStyle: PIXI.FillStyle;
11519 /**
11520 * The transform matrix.
11521 * @member {PIXI.Matrix} PIXI.GraphicsData#matrix
11522 */
11523 matrix: PIXI.Matrix;
11524 /**
11525 * The type of the shape, see the Const.Shapes file for all the existing types,
11526 * @member {number} PIXI.GraphicsData#type
11527 */
11528 type: number;
11529 /**
11530 * The collection of points.
11531 * @member {number[]} PIXI.GraphicsData#points
11532 */
11533 points: number[];
11534 /**
11535 * The collection of holes.
11536 * @member {PIXI.GraphicsData[]} PIXI.GraphicsData#holes
11537 */
11538 holes: PIXI.GraphicsData[];
11539 /**
11540 * Creates a new GraphicsData object with the same values as this one.
11541 *
11542 * @return {PIXI.GraphicsData} Cloned GraphicsData object
11543 */
11544 clone(): PIXI.GraphicsData;
11545 /**
11546 * Destroys the Graphics data.
11547 *
11548 */
11549 destroy(): void;
11550 }
11551 /**
11552 * The Graphics class contains methods used to draw primitive shapes such as lines, circles and
11553 * rectangles to the display, and to color and fill them.
11554 *
11555 * GraphicsGeometry is designed to not be continually updating the geometry since it's expensive
11556 * to re-tesselate using **earcut**. Consider using {@link PIXI.Mesh} for this use-case, it's much faster.
11557 *
11558 * @class
11559 * @extends PIXI.BatchGeometry
11560 * @memberof PIXI
11561 */
11562 class GraphicsGeometry extends PIXI.BatchGeometry {
11563 constructor();
11564 /**
11565 * An array of points to draw, 2 numbers per point
11566 *
11567 * @member {number[]} PIXI.GraphicsGeometry#points
11568 * @protected
11569 */
11570 protected points: number[];
11571 /**
11572 * The collection of colors
11573 *
11574 * @member {number[]} PIXI.GraphicsGeometry#colors
11575 * @protected
11576 */
11577 protected colors: number[];
11578 /**
11579 * The UVs collection
11580 *
11581 * @member {number[]} PIXI.GraphicsGeometry#uvs
11582 * @protected
11583 */
11584 protected uvs: number[];
11585 /**
11586 * The indices of the vertices
11587 *
11588 * @member {number[]} PIXI.GraphicsGeometry#indices
11589 * @protected
11590 */
11591 protected indices: number[];
11592 /**
11593 * Reference to the texture IDs.
11594 *
11595 * @member {number[]} PIXI.GraphicsGeometry#textureIds
11596 * @protected
11597 */
11598 protected textureIds: number[];
11599 /**
11600 * The collection of drawn shapes.
11601 *
11602 * @member {PIXI.GraphicsData[]} PIXI.GraphicsGeometry#graphicsData
11603 * @protected
11604 */
11605 protected graphicsData: PIXI.GraphicsData[];
11606 /**
11607 * Used to detect if the graphics object has changed.
11608 *
11609 * @member {number} PIXI.GraphicsGeometry#dirty
11610 * @protected
11611 */
11612 protected dirty: number;
11613 /**
11614 * Batches need to regenerated if the geometry is updated.
11615 *
11616 * @member {number} PIXI.GraphicsGeometry#batchDirty
11617 * @protected
11618 */
11619 protected batchDirty: number;
11620 /**
11621 * Used to check if the cache is dirty.
11622 *
11623 * @member {number} PIXI.GraphicsGeometry#cacheDirty
11624 * @protected
11625 */
11626 protected cacheDirty: number;
11627 /**
11628 * Used to detect if we cleared the graphicsData.
11629 *
11630 * @member {number} PIXI.GraphicsGeometry#clearDirty
11631 * @default 0
11632 * @protected
11633 */
11634 protected clearDirty: number;
11635 /**
11636 * List of current draw calls drived from the batches.
11637 *
11638 * @member {object[]} PIXI.GraphicsGeometry#drawCalls
11639 * @protected
11640 */
11641 protected drawCalls: any[];
11642 /**
11643 * Intermediate abstract format sent to batch system.
11644 * Can be converted to drawCalls or to batchable objects.
11645 *
11646 * @member {PIXI.graphicsUtils.BatchPart[]} PIXI.GraphicsGeometry#batches
11647 * @protected
11648 */
11649 protected batches: PIXI.graphicsUtils.BatchPart[];
11650 /**
11651 * Index of the last batched shape in the stack of calls.
11652 *
11653 * @member {number} PIXI.GraphicsGeometry#shapeIndex
11654 * @protected
11655 */
11656 protected shapeIndex: number;
11657 /**
11658 * Cached bounds.
11659 *
11660 * @member {PIXI.Bounds} PIXI.GraphicsGeometry#_bounds
11661 * @protected
11662 */
11663 protected _bounds: PIXI.Bounds;
11664 /**
11665 * The bounds dirty flag.
11666 *
11667 * @member {number} PIXI.GraphicsGeometry#boundsDirty
11668 * @protected
11669 */
11670 protected boundsDirty: number;
11671 /**
11672 * Padding to add to the bounds.
11673 *
11674 * @member {number} PIXI.GraphicsGeometry#boundsPadding
11675 * @default 0
11676 */
11677 boundsPadding: number;
11678 /**
11679 * Minimal distance between points that are considered different.
11680 * Affects line tesselation.
11681 *
11682 * @member {number} PIXI.GraphicsGeometry#closePointEps
11683 */
11684 closePointEps: number;
11685 /**
11686 * Get the current bounds of the graphic geometry.
11687 *
11688 * @member {PIXI.Bounds}
11689 * @readonly
11690 */
11691 readonly bounds: PIXI.Bounds;
11692 /**
11693 * Call if you changed graphicsData manually.
11694 * Empties all batch buffers.
11695 */
11696 invalidate(): void;
11697 /**
11698 * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
11699 *
11700 * @return {PIXI.GraphicsGeometry} This GraphicsGeometry object. Good for chaining method calls
11701 */
11702 clear(): PIXI.GraphicsGeometry;
11703 /**
11704 * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
11705 *
11706 * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.
11707 * @param {PIXI.FillStyle} fillStyle - Defines style of the fill.
11708 * @param {PIXI.LineStyle} lineStyle - Defines style of the lines.
11709 * @param {PIXI.Matrix} matrix - Transform applied to the points of the shape.
11710 * @return {PIXI.GraphicsGeometry} Returns geometry for chaining.
11711 */
11712 drawShape(shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle, fillStyle: PIXI.FillStyle, lineStyle: PIXI.LineStyle, matrix: PIXI.Matrix): PIXI.GraphicsGeometry;
11713 /**
11714 * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
11715 *
11716 * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.
11717 * @param {PIXI.Matrix} matrix - Transform applied to the points of the shape.
11718 * @return {PIXI.GraphicsGeometry} Returns geometry for chaining.
11719 */
11720 drawHole(shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle, matrix: PIXI.Matrix): PIXI.GraphicsGeometry;
11721 /**
11722 * Destroys the GraphicsGeometry object.
11723 *
11724 */
11725 destroy(): void;
11726 /**
11727 * Check to see if a point is contained within this geometry.
11728 *
11729 * @param {PIXI.IPointData} point - Point to check if it's contained.
11730 * @return {Boolean} `true` if the point is contained within geometry.
11731 */
11732 containsPoint(point: PIXI.IPointData): boolean;
11733 /**
11734 * Generates intermediate batch data. Either gets converted to drawCalls
11735 * or used to convert to batch objects directly by the Graphics object.
11736 *
11737 * @param {boolean} [aloow32Indices] - Allow using 32-bit indices for preventings artefacts when more that 65535 vertices
11738 */
11739 updateBatches(aloow32Indices?: boolean): void;
11740 /**
11741 * Affinity check
11742 *
11743 * @param {PIXI.FillStyle | PIXI.LineStyle} styleA
11744 * @param {PIXI.FillStyle | PIXI.LineStyle} styleB
11745 */
11746 _compareStyles(styleA: PIXI.FillStyle | PIXI.LineStyle, styleB: PIXI.FillStyle | PIXI.LineStyle): void;
11747 /**
11748 * Test geometry for batching process.
11749 *
11750 * @protected
11751 */
11752 protected validateBatching(): void;
11753 /**
11754 * Offset the indices so that it works with the batcher.
11755 *
11756 * @protected
11757 */
11758 protected packBatches(): void;
11759 /**
11760 * Checks to see if this graphics geometry can be batched.
11761 * Currently it needs to be small enough and not contain any native lines.
11762 *
11763 * @protected
11764 */
11765 protected isBatchable(): void;
11766 /**
11767 * Converts intermediate batches data to drawCalls.
11768 *
11769 * @protected
11770 */
11771 protected buildDrawCalls(): void;
11772 /**
11773 * Packs attributes to single buffer.
11774 *
11775 * @protected
11776 */
11777 protected packAttributes(): void;
11778 /**
11779 * Process fill part of Graphics.
11780 *
11781 * @param {PIXI.GraphicsData} data
11782 * @protected
11783 */
11784 protected processFill(data: PIXI.GraphicsData): void;
11785 /**
11786 * Process line part of Graphics.
11787 *
11788 * @param {PIXI.GraphicsData} data
11789 * @protected
11790 */
11791 protected processLine(data: PIXI.GraphicsData): void;
11792 /**
11793 * Process the holes data.
11794 *
11795 * @param {PIXI.GraphicsData[]} holes - Holes to render
11796 * @protected
11797 */
11798 protected processHoles(holes: PIXI.GraphicsData[]): void;
11799 /**
11800 * Update the local bounds of the object. Expensive to use performance-wise.
11801 *
11802 * @protected
11803 */
11804 protected calculateBounds(): void;
11805 /**
11806 * Transform points using matrix.
11807 *
11808 * @protected
11809 * @param {number[]} points - Points to transform
11810 * @param {PIXI.Matrix} matrix - Transform matrix
11811 */
11812 protected transformPoints(points: number[], matrix: PIXI.Matrix): void;
11813 /**
11814 * Add colors.
11815 *
11816 * @protected
11817 * @param {number[]} colors - List of colors to add to
11818 * @param {number} color - Color to add
11819 * @param {number} alpha - Alpha to use
11820 * @param {number} size - Number of colors to add
11821 */
11822 protected addColors(colors: number[], color: number, alpha: number, size: number): void;
11823 /**
11824 * Add texture id that the shader/fragment wants to use.
11825 *
11826 * @protected
11827 * @param {number[]} textureIds
11828 * @param {number} id
11829 * @param {number} size
11830 */
11831 protected addTextureIds(textureIds: number[], id: number, size: number): void;
11832 /**
11833 * Generates the UVs for a shape.
11834 *
11835 * @protected
11836 * @param {number[]} verts - Vertices
11837 * @param {number[]} uvs - UVs
11838 * @param {PIXI.Texture} texture - Reference to Texture
11839 * @param {number} start - Index buffer start index.
11840 * @param {number} size - The size/length for index buffer.
11841 * @param {PIXI.Matrix} [matrix] - Optional transform for all points.
11842 */
11843 protected addUvs(verts: number[], uvs: number[], texture: PIXI.Texture, start: number, size: number, matrix?: PIXI.Matrix): void;
11844 /**
11845 * Modify uvs array according to position of texture region
11846 * Does not work with rotated or trimmed textures
11847 *
11848 * @param {number[]} uvs - array
11849 * @param {PIXI.Texture} texture - region
11850 * @param {number} start - starting index for uvs
11851 * @param {number} size - how many points to adjust
11852 */
11853 adjustUvs(uvs: number[], texture: PIXI.Texture, start: number, size: number): void;
11854 /**
11855 * The maximum number of points to consider an object "batchable",
11856 * able to be batched by the renderer's batch system.
11857 *
11858 * @memberof PIXI.GraphicsGeometry
11859 * @static
11860 * @member {number} BATCHABLE_SIZE
11861 * @default 100
11862 */
11863 static BATCHABLE_SIZE: number;
11864 /**
11865 * Buffer used for position, color, texture IDs
11866 *
11867 * @member {PIXI.Buffer} PIXI.BatchGeometry#_buffer
11868 * @protected
11869 */
11870 protected _buffer: PIXI.Buffer;
11871 /**
11872 * Index buffer data
11873 *
11874 * @member {PIXI.Buffer} PIXI.BatchGeometry#_indexBuffer
11875 * @protected
11876 */
11877 protected _indexBuffer: PIXI.Buffer;
11878 }
11879 /**
11880 * Supported line joints in `PIXI.LineStyle` for graphics.
11881 *
11882 * @see PIXI.Graphics#lineStyle
11883 * @see https://graphicdesign.stackexchange.com/questions/59018/what-is-a-bevel-join-of-two-lines-exactly-illustrator
11884 *
11885 * @name LINE_JOIN
11886 * @memberof PIXI
11887 * @static
11888 * @enum {string}
11889 * @property {string} MITER - 'miter': make a sharp corner where outer part of lines meet
11890 * @property {string} BEVEL - 'bevel': add a square butt at each end of line segment and fill the triangle at turn
11891 * @property {string} ROUND - 'round': add an arc at the joint
11892 */
11893 enum LINE_JOIN {
11894 MITER,
11895 BEVEL,
11896 ROUND
11897 }
11898 /**
11899 * Support line caps in `PIXI.LineStyle` for graphics.
11900 *
11901 * @see PIXI.Graphics#lineStyle
11902 *
11903 * @name LINE_CAP
11904 * @memberof PIXI
11905 * @static
11906 * @enum {string}
11907 * @property {string} BUTT - 'butt': don't add any cap at line ends (leaves orthogonal edges)
11908 * @property {string} ROUND - 'round': add semicircle at ends
11909 * @property {string} SQUARE - 'square': add square at end (like `BUTT` except more length at end)
11910 */
11911 enum LINE_CAP {
11912 BUTT,
11913 ROUND,
11914 SQUARE
11915 }
11916 /**
11917 * Graphics curves resolution settings. If `adaptive` flag is set to `true`,
11918 * the resolution is calculated based on the curve's length to ensure better visual quality.
11919 * Adaptive draw works with `bezierCurveTo` and `quadraticCurveTo`.
11920 *
11921 * @static
11922 * @constant
11923 * @memberof PIXI
11924 * @name GRAPHICS_CURVES
11925 * @type {object}
11926 * @property {boolean} adaptive=false - flag indicating if the resolution should be adaptive
11927 * @property {number} maxLength=10 - maximal length of a single segment of the curve (if adaptive = false, ignored)
11928 * @property {number} minSegments=8 - minimal number of segments in the curve (if adaptive = false, ignored)
11929 * @property {number} maxSegments=2048 - maximal number of segments in the curve (if adaptive = false, ignored)
11930 */
11931 var GRAPHICS_CURVES: {
11932 adaptive: boolean;
11933 maxLength: number;
11934 minSegments: number;
11935 maxSegments: number;
11936 };
11937 /**
11938 * Fill style object for Graphics.
11939 *
11940 * @class
11941 * @memberof PIXI
11942 */
11943 class FillStyle {
11944 constructor();
11945 /**
11946 * The hex color value used when coloring the Graphics object.
11947 *
11948 * @member {number} PIXI.FillStyle#color
11949 * @default 0xFFFFFF
11950 */
11951 color: number;
11952 /**
11953 * The alpha value used when filling the Graphics object.
11954 *
11955 * @member {number} PIXI.FillStyle#alpha
11956 * @default 1
11957 */
11958 alpha: number;
11959 /**
11960 * The texture to be used for the fill.
11961 *
11962 * @member {PIXI.Texture} PIXI.FillStyle#texture
11963 * @default 0
11964 */
11965 texture: PIXI.Texture;
11966 /**
11967 * The transform aplpied to the texture.
11968 *
11969 * @member {PIXI.Matrix} PIXI.FillStyle#matrix
11970 * @default null
11971 */
11972 matrix: PIXI.Matrix;
11973 /**
11974 * If the current fill is visible.
11975 *
11976 * @member {boolean} PIXI.FillStyle#visible
11977 * @default false
11978 */
11979 visible: boolean;
11980 /**
11981 * Clones the object
11982 *
11983 * @return {PIXI.FillStyle}
11984 */
11985 clone(): PIXI.FillStyle;
11986 /**
11987 * Reset
11988 */
11989 reset(): void;
11990 /**
11991 * Destroy and don't use after this
11992 */
11993 destroy(): void;
11994 }
11995 /**
11996 * Represents the line style for Graphics.
11997 * @memberof PIXI
11998 * @class
11999 * @extends PIXI.FillStyle
12000 */
12001 class LineStyle extends PIXI.FillStyle {
12002 constructor();
12003 /**
12004 * The width (thickness) of any lines drawn.
12005 *
12006 * @member {number} PIXI.LineStyle#width
12007 * @default 0
12008 */
12009 width: number;
12010 /**
12011 * The alignment of any lines drawn (0.5 = middle, 1 = outer, 0 = inner).
12012 *
12013 * @member {number} PIXI.LineStyle#alignment
12014 * @default 0.5
12015 */
12016 alignment: number;
12017 /**
12018 * If true the lines will be draw using LINES instead of TRIANGLE_STRIP
12019 *
12020 * @member {boolean} PIXI.LineStyle#native
12021 * @default false
12022 */
12023 native: boolean;
12024 /**
12025 * Line cap style.
12026 *
12027 * @member {PIXI.LINE_CAP} PIXI.LineStyle#cap
12028 * @default PIXI.LINE_CAP.BUTT
12029 */
12030 cap: PIXI.LINE_CAP;
12031 /**
12032 * Line join style.
12033 *
12034 * @member {PIXI.LINE_JOIN} PIXI.LineStyle#join
12035 * @default PIXI.LINE_JOIN.MITER
12036 */
12037 join: PIXI.LINE_JOIN;
12038 /**
12039 * Miter limit.
12040 *
12041 * @member {number} PIXI.LineStyle#miterLimit
12042 * @default 10
12043 */
12044 miterLimit: number;
12045 /**
12046 * Clones the object
12047 *
12048 * @return {PIXI.LineStyle}
12049 */
12050 clone(): PIXI.LineStyle;
12051 /**
12052 * Reset the line style to default.
12053 */
12054 reset(): void;
12055 /**
12056 * The hex color value used when coloring the Graphics object.
12057 *
12058 * @member {number} PIXI.FillStyle#color
12059 * @default 0xFFFFFF
12060 */
12061 color: number;
12062 /**
12063 * The alpha value used when filling the Graphics object.
12064 *
12065 * @member {number} PIXI.FillStyle#alpha
12066 * @default 1
12067 */
12068 alpha: number;
12069 /**
12070 * The texture to be used for the fill.
12071 *
12072 * @member {PIXI.Texture} PIXI.FillStyle#texture
12073 * @default 0
12074 */
12075 texture: PIXI.Texture;
12076 /**
12077 * The transform aplpied to the texture.
12078 *
12079 * @member {PIXI.Matrix} PIXI.FillStyle#matrix
12080 * @default null
12081 */
12082 matrix: PIXI.Matrix;
12083 /**
12084 * If the current fill is visible.
12085 *
12086 * @member {boolean} PIXI.FillStyle#visible
12087 * @default false
12088 */
12089 visible: boolean;
12090 /**
12091 * Destroy and don't use after this
12092 */
12093 destroy(): void;
12094 }
12095 /**
12096 * Generalized convenience utilities for Graphics.
12097 *
12098 * @namespace graphicsUtils
12099 * @memberof PIXI
12100 */
12101 namespace graphicsUtils {
12102 /**
12103 * A structure to hold interim batch objects for Graphics.
12104 * @class
12105 * @memberof PIXI.graphicsUtils
12106 */
12107 class BatchPart {
12108 constructor();
12109 /**
12110 * Begin batch part
12111 *
12112 * @param {PIXI.FillStyle | PIXI.LineStyle} style
12113 * @param {number} startIndex
12114 * @param {number} attribStart
12115 */
12116 begin(style: PIXI.FillStyle | PIXI.LineStyle, startIndex: number, attribStart: number): void;
12117 /**
12118 * End batch part
12119 *
12120 * @param {number} endIndex
12121 * @param {number} endAttrib
12122 */
12123 end(endIndex: number, endAttrib: number): void;
12124 }
12125 /**
12126 * Draw a star shape with an arbitrary number of points.
12127 *
12128 * @class
12129 * @extends PIXI.Polygon
12130 * @memberof PIXI.graphicsUtils
12131 * @param {number} x - Center X position of the star
12132 * @param {number} y - Center Y position of the star
12133 * @param {number} points - The number of points of the star, must be > 1
12134 * @param {number} radius - The outer radius of the star
12135 * @param {number} [innerRadius] - The inner radius between points, default half `radius`
12136 * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical
12137 * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
12138 */
12139 class Star extends PIXI.Polygon {
12140 constructor(x: number, y: number, points: number, radius: number, innerRadius?: number, rotation?: number);
12141 /**
12142 * An array of the points of this polygon
12143 *
12144 * @member {number[]} PIXI.Polygon#points
12145 */
12146 points: number[];
12147 /**
12148 * The type of the object, mainly used to avoid `instanceof` checks
12149 *
12150 * @member {number} PIXI.Polygon#type
12151 * @readOnly
12152 * @default PIXI.SHAPES.POLY
12153 * @see PIXI.SHAPES
12154 */
12155 readonly type: number;
12156 /**
12157 * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.
12158 * @member {boolean} PIXI.Polygon#closeStroke
12159 * @default true
12160 */
12161 closeStroke: boolean;
12162 /**
12163 * Creates a clone of this polygon
12164 *
12165 * @return {PIXI.Polygon} a copy of the polygon
12166 */
12167 clone(): PIXI.Polygon;
12168 /**
12169 * Checks whether the x and y coordinates passed to this function are contained within this polygon
12170 *
12171 * @param {number} x - The X coordinate of the point to test
12172 * @param {number} y - The Y coordinate of the point to test
12173 * @return {boolean} Whether the x/y coordinates are within this polygon
12174 */
12175 contains(x: number, y: number): boolean;
12176 }
12177 /**
12178 * Map of fill commands for each shape type.
12179 *
12180 * @memberof PIXI.graphicsUtils
12181 * @member {Object} FILL_COMMANDS
12182 */
12183 var FILL_COMMANDS: any;
12184 /**
12185 * Batch pool, stores unused batches for preventing allocations.
12186 *
12187 * @memberof PIXI.graphicsUtils
12188 * @member {Array<PIXI.graphicsUtils.BatchPart>} BATCH_POOL
12189 */
12190 var BATCH_POOL: PIXI.graphicsUtils.BatchPart[];
12191 /**
12192 * Draw call pool, stores unused draw calls for preventing allocations.
12193 *
12194 * @memberof PIXI.graphicsUtils
12195 * @member {Array<PIXI.BatchDrawCall>} DRAW_CALL_POOL
12196 */
12197 var DRAW_CALL_POOL: PIXI.BatchDrawCall[];
12198 }
12199 /**
12200 * Holds all information related to an Interaction event
12201 *
12202 * @class
12203 * @memberof PIXI
12204 */
12205 class InteractionData {
12206 constructor();
12207 /**
12208 * This point stores the global coords of where the touch/mouse event happened
12209 *
12210 * @member {PIXI.Point} PIXI.InteractionData#global
12211 */
12212 global: PIXI.Point;
12213 /**
12214 * The target Sprite that was interacted with
12215 *
12216 * @member {PIXI.Sprite} PIXI.InteractionData#target
12217 */
12218 target: PIXI.Sprite;
12219 /**
12220 * When passed to an event handler, this will be the original DOM Event that was captured
12221 *
12222 * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
12223 * @see https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent
12224 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
12225 * @member {MouseEvent|TouchEvent|PointerEvent} PIXI.InteractionData#originalEvent
12226 */
12227 originalEvent: MouseEvent | TouchEvent | PointerEvent;
12228 /**
12229 * Unique identifier for this interaction
12230 *
12231 * @member {number} PIXI.InteractionData#identifier
12232 */
12233 identifier: number;
12234 /**
12235 * Indicates whether or not the pointer device that created the event is the primary pointer.
12236 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary
12237 * @type {Boolean}
12238 */
12239 isPrimary: boolean;
12240 /**
12241 * Indicates which button was pressed on the mouse or pointer device to trigger the event.
12242 * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
12243 * @type {number}
12244 */
12245 button: number;
12246 /**
12247 * Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.
12248 * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
12249 * @type {number}
12250 */
12251 buttons: number;
12252 /**
12253 * The width of the pointer's contact along the x-axis, measured in CSS pixels.
12254 * radiusX of TouchEvents will be represented by this value.
12255 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width
12256 * @type {number}
12257 */
12258 width: number;
12259 /**
12260 * The height of the pointer's contact along the y-axis, measured in CSS pixels.
12261 * radiusY of TouchEvents will be represented by this value.
12262 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height
12263 * @type {number}
12264 */
12265 height: number;
12266 /**
12267 * The angle, in degrees, between the pointer device and the screen.
12268 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
12269 * @type {number}
12270 */
12271 tiltX: number;
12272 /**
12273 * The angle, in degrees, between the pointer device and the screen.
12274 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
12275 * @type {number}
12276 */
12277 tiltY: number;
12278 /**
12279 * The type of pointer that triggered the event.
12280 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
12281 * @type {string}
12282 */
12283 pointerType: string;
12284 /**
12285 * Pressure applied by the pointing device during the event. A Touch's force property
12286 * will be represented by this value.
12287 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
12288 * @type {number}
12289 */
12290 pressure: number;
12291 /**
12292 * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.
12293 * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle
12294 * @type {number}
12295 */
12296 rotationAngle: number;
12297 /**
12298 * Twist of a stylus pointer.
12299 * @see https://w3c.github.io/pointerevents/#pointerevent-interface
12300 * @type {number}
12301 */
12302 twist: number;
12303 /**
12304 * Barrel pressure on a stylus pointer.
12305 * @see https://w3c.github.io/pointerevents/#pointerevent-interface
12306 * @type {number}
12307 */
12308 tangentialPressure: number;
12309 /**
12310 * The unique identifier of the pointer. It will be the same as `identifier`.
12311 * @readonly
12312 * @member {number}
12313 * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId
12314 */
12315 readonly pointerId: number;
12316 /**
12317 * This will return the local coordinates of the specified displayObject for this InteractionData
12318 *
12319 * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local
12320 * coords off
12321 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional (otherwise
12322 * will create a new point)
12323 * @param {PIXI.Point} [globalPos] - A Point object containing your custom global coords, optional
12324 * (otherwise will use the current global coords)
12325 * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative
12326 * to the DisplayObject
12327 */
12328 getLocalPosition(displayObject: PIXI.DisplayObject, point?: PIXI.Point, globalPos?: PIXI.Point): PIXI.Point;
12329 /**
12330 * Copies properties from normalized event data.
12331 *
12332 * @param {Touch|MouseEvent|PointerEvent} event - The normalized event data
12333 */
12334 copyEvent(event: Touch | MouseEvent | PointerEvent): void;
12335 /**
12336 * Resets the data for pooling.
12337 */
12338 reset(): void;
12339 }
12340 /**
12341 * Event class that mimics native DOM events.
12342 *
12343 * @class
12344 * @memberof PIXI
12345 */
12346 class InteractionEvent {
12347 constructor();
12348 /**
12349 * Whether this event will continue propagating in the tree.
12350 *
12351 * Remaining events for the {@link stopsPropagatingAt} object
12352 * will still be dispatched.
12353 *
12354 * @member {boolean} PIXI.InteractionEvent#stopped
12355 */
12356 stopped: boolean;
12357 /**
12358 * The object which caused this event to be dispatched.
12359 * For listener callback see {@link PIXI.InteractionEvent.currentTarget}.
12360 *
12361 * @member {PIXI.DisplayObject} PIXI.InteractionEvent#target
12362 */
12363 target: PIXI.DisplayObject;
12364 /**
12365 * The object whose event listener’s callback is currently being invoked.
12366 *
12367 * @member {PIXI.DisplayObject} PIXI.InteractionEvent#currentTarget
12368 */
12369 currentTarget: PIXI.DisplayObject;
12370 /**
12371 * Type of the event
12372 *
12373 * @member {string} PIXI.InteractionEvent#type
12374 */
12375 type: string;
12376 /**
12377 * InteractionData related to this event
12378 *
12379 * @member {PIXI.InteractionData} PIXI.InteractionEvent#data
12380 */
12381 data: PIXI.InteractionData;
12382 /**
12383 * Prevents event from reaching any objects other than the current object.
12384 *
12385 */
12386 stopPropagation(): void;
12387 /**
12388 * Resets the event.
12389 */
12390 reset(): void;
12391 }
12392 /**
12393 * The interaction manager deals with mouse, touch and pointer events.
12394 *
12395 * Any DisplayObject can be interactive if its `interactive` property is set to true.
12396 *
12397 * This manager also supports multitouch.
12398 *
12399 * An instance of this class is automatically created by default, and can be found at `renderer.plugins.interaction`
12400 *
12401 * @class
12402 * @extends PIXI.utils.EventEmitter
12403 * @memberof PIXI
12404 */
12405 class InteractionManager extends PIXI.utils.EventEmitter {
12406 constructor(renderer: PIXI.CanvasRenderer | PIXI.Renderer, options?: {
12407 autoPreventDefault?: boolean;
12408 interactionFrequency?: number;
12409 useSystemTicker?: number;
12410 });
12411 /**
12412 * The renderer this interaction manager works for.
12413 *
12414 * @member {PIXI.AbstractRenderer} PIXI.InteractionManager#renderer
12415 */
12416 renderer: PIXI.AbstractRenderer;
12417 /**
12418 * Should default browser actions automatically be prevented.
12419 * Does not apply to pointer events for backwards compatibility
12420 * preventDefault on pointer events stops mouse events from firing
12421 * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.
12422 *
12423 * @member {boolean} PIXI.InteractionManager#autoPreventDefault
12424 * @default true
12425 */
12426 autoPreventDefault: boolean;
12427 /**
12428 * Maximum requency in milliseconds at which pointer over/out states will be checked by {@link tickerUpdate}.
12429 *
12430 * @member {number} PIXI.InteractionManager#interactionFrequency
12431 * @default 10
12432 */
12433 interactionFrequency: number;
12434 /**
12435 * The mouse data
12436 *
12437 * @member {PIXI.InteractionData} PIXI.InteractionManager#mouse
12438 */
12439 mouse: PIXI.InteractionData;
12440 /**
12441 * An event data object to handle all the event tracking/dispatching
12442 *
12443 * @member {object} PIXI.InteractionManager#eventData
12444 */
12445 eventData: any;
12446 /**
12447 * The DOM element to bind to.
12448 *
12449 * @protected
12450 * @member {HTMLElement} PIXI.InteractionManager#interactionDOMElement
12451 */
12452 protected interactionDOMElement: HTMLElement;
12453 /**
12454 * This property determines if mousemove and touchmove events are fired only when the cursor
12455 * is over the object.
12456 * Setting to true will make things work more in line with how the DOM version works.
12457 * Setting to false can make things easier for things like dragging
12458 * It is currently set to false as this is how PixiJS used to work. This will be set to true in
12459 * future versions of pixi.
12460 *
12461 * @member {boolean} PIXI.InteractionManager#moveWhenInside
12462 * @default false
12463 */
12464 moveWhenInside: boolean;
12465 /**
12466 * Have events been attached to the dom element?
12467 *
12468 * @protected
12469 * @member {boolean} PIXI.InteractionManager#eventsAdded
12470 */
12471 protected eventsAdded: boolean;
12472 /**
12473 * Has the system ticker been added?
12474 *
12475 * @protected
12476 * @member {boolean} PIXI.InteractionManager#tickerAdded
12477 */
12478 protected tickerAdded: boolean;
12479 /**
12480 * Is the mouse hovering over the renderer?
12481 *
12482 * @protected
12483 * @member {boolean} PIXI.InteractionManager#mouseOverRenderer
12484 */
12485 protected mouseOverRenderer: boolean;
12486 /**
12487 * Does the device support touch events
12488 * https://www.w3.org/TR/touch-events/
12489 *
12490 * @readonly
12491 * @member {boolean} PIXI.InteractionManager#supportsTouchEvents
12492 */
12493 readonly supportsTouchEvents: boolean;
12494 /**
12495 * Does the device support pointer events
12496 * https://www.w3.org/Submission/pointer-events/
12497 *
12498 * @readonly
12499 * @member {boolean} PIXI.InteractionManager#supportsPointerEvents
12500 */
12501 readonly supportsPointerEvents: boolean;
12502 /**
12503 * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor
12504 * values, objects are handled as dictionaries of CSS values for interactionDOMElement,
12505 * and functions are called instead of changing the CSS.
12506 * Default CSS cursor values are provided for 'default' and 'pointer' modes.
12507 * @member {Object.<string, Object>} PIXI.InteractionManager#cursorStyles
12508 */
12509 cursorStyles: {
12510 [key: string]: any;
12511 };
12512 /**
12513 * The mode of the cursor that is being used.
12514 * The value of this is a key from the cursorStyles dictionary.
12515 *
12516 * @member {string} PIXI.InteractionManager#currentCursorMode
12517 */
12518 currentCursorMode: string;
12519 /**
12520 * The current resolution / device pixel ratio.
12521 *
12522 * @member {number} PIXI.InteractionManager#resolution
12523 * @default 1
12524 */
12525 resolution: number;
12526 /**
12527 * Should the InteractionManager automatically add {@link tickerUpdate} to {@link PIXI.Ticker.system}.
12528 *
12529 * @member {boolean}
12530 * @default true
12531 */
12532 useSystemTicker: boolean;
12533 /**
12534 * Last rendered object or temp object
12535 * @readonly
12536 * @protected
12537 * @member {PIXI.DisplayObject}
12538 */
12539 protected readonly lastObjectRendered: PIXI.DisplayObject;
12540 /**
12541 * Hit tests a point against the display tree, returning the first interactive object that is hit.
12542 *
12543 * @param {PIXI.Point} globalPoint - A point to hit test with, in global space.
12544 * @param {PIXI.Container} [root] - The root display object to start from. If omitted, defaults
12545 * to the last rendered root of the associated renderer.
12546 * @return {PIXI.DisplayObject} The hit display object, if any.
12547 */
12548 hitTest(globalPoint: PIXI.Point, root?: PIXI.Container): PIXI.DisplayObject;
12549 /**
12550 * Sets the DOM element which will receive mouse/touch events. This is useful for when you have
12551 * other DOM elements on top of the renderers Canvas element. With this you'll be bale to delegate
12552 * another DOM element to receive those events.
12553 *
12554 * @param {HTMLElement} element - the DOM element which will receive mouse and touch events.
12555 * @param {number} [resolution=1] - The resolution / device pixel ratio of the new element (relative to the canvas).
12556 */
12557 setTargetElement(element: HTMLElement, resolution?: number): void;
12558 /**
12559 * Updates the state of interactive objects if at least {@link interactionFrequency}
12560 * milliseconds have passed since the last invocation.
12561 *
12562 * Invoked by a throttled ticker update from {@link PIXI.Ticker.system}.
12563 *
12564 * @param {number} deltaTime - time delta since the last call
12565 */
12566 tickerUpdate(deltaTime: number): void;
12567 /**
12568 * Updates the state of interactive objects.
12569 */
12570 update(): void;
12571 /**
12572 * Sets the current cursor mode, handling any callbacks or CSS style changes.
12573 *
12574 * @param {string} mode - cursor mode, a key from the cursorStyles dictionary
12575 */
12576 setCursorMode(mode: string): void;
12577 /**
12578 * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The
12579 * resulting value is stored in the point. This takes into account the fact that the DOM
12580 * element could be scaled and positioned anywhere on the screen.
12581 *
12582 * @param {PIXI.IPointData} point - the point that the result will be stored in
12583 * @param {number} x - the x coord of the position to map
12584 * @param {number} y - the y coord of the position to map
12585 */
12586 mapPositionToPoint(point: PIXI.IPointData, x: number, y: number): void;
12587 /**
12588 * This function is provides a neat way of crawling through the scene graph and running a
12589 * specified function on all interactive objects it finds. It will also take care of hit
12590 * testing the interactive objects and passes the hit across in the function.
12591 *
12592 * @protected
12593 * @param {PIXI.InteractionEvent} interactionEvent - event containing the point that
12594 * is tested for collision
12595 * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject
12596 * that will be hit test (recursively crawls its children)
12597 * @param {Function} [func] - the function that will be called on each interactive object. The
12598 * interactionEvent, displayObject and hit will be passed to the function
12599 * @param {boolean} [hitTest] - indicates whether we want to calculate hits
12600 * or just iterate through all interactive objects
12601 */
12602 protected processInteractive(interactionEvent: PIXI.InteractionEvent, displayObject: PIXI.Container | PIXI.Sprite | PIXI.TilingSprite, func?: (...params: any[]) => any, hitTest?: boolean): void;
12603 /**
12604 * Destroys the interaction manager
12605 *
12606 */
12607 destroy(): void;
12608 }
12609 /**
12610 * Interface for classes that represent a hit area.
12611 *
12612 * It is implemented by the following classes:
12613 * - {@link PIXI.Circle}
12614 * - {@link PIXI.Ellipse}
12615 * - {@link PIXI.Polygon}
12616 * - {@link PIXI.RoundedRectangle}
12617 *
12618 * @interface IHitArea
12619 * @memberof PIXI
12620 */
12621 interface IHitArea {
12622 /**
12623 * Checks whether the x and y coordinates given are contained within this area
12624 *
12625 * @method
12626 * @name contains
12627 * @memberof PIXI.IHitArea#
12628 * @param {number} x - The X coordinate of the point to test
12629 * @param {number} y - The Y coordinate of the point to test
12630 * @return {boolean} Whether the x/y coordinates are within this area
12631 */
12632 contains(x: number, y: number): boolean;
12633 }
12634 /**
12635 * Application plugin for supporting loader option. Installing the LoaderPlugin
12636 * is not necessary if using **pixi.js** or **pixi.js-legacy**.
12637 * @example
12638 * import {AppLoaderPlugin} from '@pixi/loaders';
12639 * import {Application} from '@pixi/app';
12640 * Application.registerPlugin(AppLoaderPlugin);
12641 * @class
12642 * @memberof PIXI
12643 */
12644 class AppLoaderPlugin {
12645 }
12646 /**
12647 * Plugin to be installed for handling specific Loader resources.
12648 *
12649 * @memberof PIXI
12650 * @typedef {object} ILoaderPlugin
12651 * @property {function} [add] - Function to call immediate after registering plugin.
12652 * @property {PIXI.Loader.loaderMiddleware} [pre] - Middleware function to run before load, the
12653 * arguments for this are `(resource, next)`
12654 * @property {PIXI.Loader.loaderMiddleware} [use] - Middleware function to run after load, the
12655 * arguments for this are `(resource, next)`
12656 */
12657 type ILoaderPlugin = {
12658 add?: (...params: any[]) => any;
12659 pre?: PIXI.Loader.loaderMiddleware;
12660 use?: PIXI.Loader.loaderMiddleware;
12661 };
12662 module Loader {
12663 /**
12664 * @memberof PIXI.Loader
12665 * @typedef {object} ICallbackID
12666 */
12667 type ICallbackID = any;
12668 /**
12669 * @memberof PIXI.Loader
12670 * @typedef {function} ISignalCallback
12671 * @param {function} callback - Callback function
12672 * @param {object} [context] - Context
12673 * @returns {ICallbackID} - CallbackID
12674 */
12675 type ISignalCallback = (callback: (...params: any[]) => any, context?: any) => ICallbackID;
12676 /**
12677 * @memberof PIXI.Loader
12678 * @typedef {function} ISignalDetach
12679 * @param {ICallbackID} id - CallbackID returned by `add`/`once` methods
12680 */
12681 type ISignalDetach = (id: ICallbackID) => void;
12682 /**
12683 * @memberof PIXI.Loader
12684 * @typedef ILoaderSignal
12685 * @property {ISignalCallback} add - Register callback
12686 * @property {ISignalCallback} once - Register oneshot callback
12687 * @property {ISignalDetach} detach - Detach specific callback by ID
12688 */
12689 type ILoaderSignal = {
12690 add: ISignalCallback;
12691 once: ISignalCallback;
12692 detach: ISignalDetach;
12693 };
12694 /**
12695 * @memberof PIXI.Loader
12696 * @callback loaderMiddleware
12697 * @param {PIXI.LoaderResource} resource
12698 * @param {function} next
12699 */
12700 type loaderMiddleware = (resource: PIXI.LoaderResource, next: (...params: any[]) => any) => void;
12701 }
12702 /**
12703 * The new loader, extends Resource Loader by Chad Engler: https://github.com/englercj/resource-loader
12704 *
12705 * ```js
12706 * const loader = PIXI.Loader.shared; // PixiJS exposes a premade instance for you to use.
12707 * //or
12708 * const loader = new PIXI.Loader(); // you can also create your own if you want
12709 *
12710 * const sprites = {};
12711 *
12712 * // Chainable `add` to enqueue a resource
12713 * loader.add('bunny', 'data/bunny.png')
12714 * .add('spaceship', 'assets/spritesheet.json');
12715 * loader.add('scoreFont', 'assets/score.fnt');
12716 *
12717 * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource.
12718 * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc).
12719 * loader.pre(cachingMiddleware);
12720 *
12721 * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource.
12722 * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc).
12723 * loader.use(parsingMiddleware);
12724 *
12725 * // The `load` method loads the queue of resources, and calls the passed in callback called once all
12726 * // resources have loaded.
12727 * loader.load((loader, resources) => {
12728 * // resources is an object where the key is the name of the resource loaded and the value is the resource object.
12729 * // They have a couple default properties:
12730 * // - `url`: The URL that the resource was loaded from
12731 * // - `error`: The error that happened when trying to load (if any)
12732 * // - `data`: The raw data that was loaded
12733 * // also may contain other properties based on the middleware that runs.
12734 * sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture);
12735 * sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture);
12736 * sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture);
12737 * });
12738 *
12739 * // throughout the process multiple signals can be dispatched.
12740 * loader.onProgress.add(() => {}); // called once per loaded/errored file
12741 * loader.onError.add(() => {}); // called once per errored file
12742 * loader.onLoad.add(() => {}); // called once per loaded file
12743 * loader.onComplete.add(() => {}); // called once when the queued resources all load.
12744 * ```
12745 *
12746 * @see https://github.com/englercj/resource-loader
12747 *
12748 * @class Loader
12749 * @memberof PIXI
12750 * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.
12751 * @param {number} [concurrency=10] - The number of resources to load concurrently.
12752 */
12753 class Loader {
12754 constructor(baseUrl?: string, concurrency?: number);
12755 /**
12756 * @memberof PIXI.Loader#
12757 * @description Dispatched when the loader begins to loading process.
12758 * @member {PIXI.Loader.ILoaderSignal} onStart
12759 */
12760 onStart: PIXI.Loader.ILoaderSignal;
12761 /**
12762 * @memberof PIXI.Loader#
12763 * @description Dispatched once per loaded or errored resource.
12764 * @member {PIXI.Loader.ILoaderSignal} onProgress
12765 */
12766 onProgress: PIXI.Loader.ILoaderSignal;
12767 /**
12768 * @memberof PIXI.Loader#
12769 * @description Dispatched once per errored resource.
12770 * @member {PIXI.Loader.ILoaderSignal} onError
12771 */
12772 onError: PIXI.Loader.ILoaderSignal;
12773 /**
12774 * @memberof PIXI.Loader#
12775 * @description Dispatched once per loaded resource.
12776 * @member {PIXI.Loader.ILoaderSignal} onLoad
12777 */
12778 onLoad: PIXI.Loader.ILoaderSignal;
12779 /**
12780 * @memberof PIXI.Loader#
12781 * @description Dispatched when completely loaded all resources.
12782 * @member {PIXI.Loader.ILoaderSignal} onComplete
12783 */
12784 onComplete: PIXI.Loader.ILoaderSignal;
12785 /**
12786 * Destroy the loader, removes references.
12787 * @memberof PIXI.Loader#
12788 * @method destroy
12789 * @public
12790 */
12791 public destroy(): void;
12792 /**
12793 * A premade instance of the loader that can be used to load resources.
12794 * @name shared
12795 * @type {PIXI.Loader}
12796 * @static
12797 * @memberof PIXI.Loader
12798 */
12799 static shared: PIXI.Loader;
12800 /**
12801 * Adds a Loader plugin for the global shared loader and all
12802 * new Loader instances created.
12803 *
12804 * @static
12805 * @method registerPlugin
12806 * @memberof PIXI.Loader
12807 * @param {PIXI.ILoaderPlugin} plugin - The plugin to add
12808 * @return {PIXI.Loader} Reference to PIXI.Loader for chaining
12809 */
12810 static registerPlugin(plugin: PIXI.ILoaderPlugin): PIXI.Loader;
12811 }
12812 /**
12813 * Reference to **{@link https://github.com/englercj/resource-loader
12814 * resource-loader}**'s Resource class.
12815 * @see http://englercj.github.io/resource-loader/Resource.html
12816 * @class LoaderResource
12817 * @memberof PIXI
12818 */
12819 class LoaderResource {
12820 }
12821 interface TextureLoader extends PIXI.ILoaderPlugin {
12822 }
12823 /**
12824 * Loader plugin for handling Texture resources.
12825 * @class
12826 * @memberof PIXI
12827 * @implements PIXI.ILoaderPlugin
12828 */
12829 class TextureLoader implements PIXI.ILoaderPlugin {
12830 /**
12831 * Called after a resource is loaded.
12832 * @see PIXI.Loader.loaderMiddleware
12833 * @param {PIXI.LoaderResource} resource
12834 * @param {function} next
12835 */
12836 static use(resource: PIXI.LoaderResource, next: (...params: any[]) => any): void;
12837 }
12838 /**
12839 * Common interface for points. Both Point and ObservablePoint implement it
12840 * @memberof PIXI
12841 * @interface IPoint
12842 * @extends PIXI.IPointData
12843 */
12844 interface IPoint extends PIXI.IPointData {
12845 /**
12846 * Sets the point to a new x and y position.
12847 * If y is omitted, both x and y will be set to x.
12848 *
12849 * @method set
12850 * @memberof PIXI.IPoint#
12851 * @param {number} [x=0] - position of the point on the x axis
12852 * @param {number} [y=x] - position of the point on the y axis
12853 */
12854 set(x?: number, y?: number): void;
12855 /**
12856 * Copies x and y from the given point
12857 * @method copyFrom
12858 * @memberof PIXI.IPoint#
12859 * @param {PIXI.IPointData} p - The point to copy from
12860 * @returns {this} Returns itself.
12861 */
12862 copyFrom(p: PIXI.IPointData): this;
12863 /**
12864 * Copies x and y into the given point
12865 * @method copyTo
12866 * @memberof PIXI.IPoint#
12867 * @param {PIXI.IPoint} p - The point to copy.
12868 * @returns {PIXI.IPoint} Given point with values updated
12869 */
12870 copyTo(p: PIXI.IPoint): PIXI.IPoint;
12871 /**
12872 * Returns true if the given point is equal to this point
12873 *
12874 * @method equals
12875 * @memberof PIXI.IPoint#
12876 * @param {PIXI.IPointData} p - The point to check
12877 * @returns {boolean} Whether the given point equal to this point
12878 */
12879 equals(p: PIXI.IPointData): boolean;
12880 /**
12881 * X coord
12882 * @memberof PIXI.IPointData#
12883 * @member {number} x
12884 */
12885 x: number;
12886 /**
12887 * Y coord
12888 * @memberof PIXI.IPointData#
12889 * @member {number} y
12890 */
12891 y: number;
12892 }
12893 /**
12894 * Common interface for points. Both Point and ObservablePoint implement it
12895 * @memberof PIXI
12896 * @interface IPointData
12897 */
12898 interface IPointData {
12899 /**
12900 * X coord
12901 * @memberof PIXI.IPointData#
12902 * @member {number} x
12903 */
12904 x: number;
12905 /**
12906 * Y coord
12907 * @memberof PIXI.IPointData#
12908 * @member {number} y
12909 */
12910 y: number;
12911 }
12912 /**
12913 * The PixiJS Matrix as a class makes it a lot faster.
12914 *
12915 * Here is a representation of it:
12916 * ```js
12917 * | a | c | tx|
12918 * | b | d | ty|
12919 * | 0 | 0 | 1 |
12920 * ```
12921 * @class
12922 * @memberof PIXI
12923 */
12924 class Matrix {
12925 constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
12926 /**
12927 * @member {number} PIXI.Matrix#a
12928 * @default 1
12929 */
12930 a: number;
12931 /**
12932 * @member {number} PIXI.Matrix#b
12933 * @default 0
12934 */
12935 b: number;
12936 /**
12937 * @member {number} PIXI.Matrix#c
12938 * @default 0
12939 */
12940 c: number;
12941 /**
12942 * @member {number} PIXI.Matrix#d
12943 * @default 1
12944 */
12945 d: number;
12946 /**
12947 * @member {number} PIXI.Matrix#tx
12948 * @default 0
12949 */
12950 tx: number;
12951 /**
12952 * @member {number} PIXI.Matrix#ty
12953 * @default 0
12954 */
12955 ty: number;
12956 /**
12957 * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:
12958 *
12959 * a = array[0]
12960 * b = array[1]
12961 * c = array[3]
12962 * d = array[4]
12963 * tx = array[2]
12964 * ty = array[5]
12965 *
12966 * @param {number[]} array - The array that the matrix will be populated from.
12967 */
12968 fromArray(array: number[]): void;
12969 /**
12970 * sets the matrix properties
12971 *
12972 * @param {number} a - Matrix component
12973 * @param {number} b - Matrix component
12974 * @param {number} c - Matrix component
12975 * @param {number} d - Matrix component
12976 * @param {number} tx - Matrix component
12977 * @param {number} ty - Matrix component
12978 *
12979 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
12980 */
12981 set(a: number, b: number, c: number, d: number, tx: number, ty: number): PIXI.Matrix;
12982 /**
12983 * Creates an array from the current Matrix object.
12984 *
12985 * @param {boolean} transpose - Whether we need to transpose the matrix or not
12986 * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out
12987 * @return {number[]} the newly created array which contains the matrix
12988 */
12989 toArray(transpose: boolean, out?: Float32Array): number[];
12990 /**
12991 * Get a new position with the current transformation applied.
12992 * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)
12993 *
12994 * @param {PIXI.IPointData} pos - The origin
12995 * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)
12996 * @return {PIXI.Point} The new point, transformed through this matrix
12997 */
12998 apply(pos: PIXI.IPointData, newPos?: PIXI.Point): PIXI.Point;
12999 /**
13000 * Get a new position with the inverse of the current transformation applied.
13001 * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)
13002 *
13003 * @param {PIXI.IPointData} pos - The origin
13004 * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)
13005 * @return {PIXI.Point} The new point, inverse-transformed through this matrix
13006 */
13007 applyInverse(pos: PIXI.IPointData, newPos?: PIXI.Point): PIXI.Point;
13008 /**
13009 * Translates the matrix on the x and y.
13010 *
13011 * @param {number} x - How much to translate x by
13012 * @param {number} y - How much to translate y by
13013 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
13014 */
13015 translate(x: number, y: number): PIXI.Matrix;
13016 /**
13017 * Applies a scale transformation to the matrix.
13018 *
13019 * @param {number} x - The amount to scale horizontally
13020 * @param {number} y - The amount to scale vertically
13021 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
13022 */
13023 scale(x: number, y: number): PIXI.Matrix;
13024 /**
13025 * Applies a rotation transformation to the matrix.
13026 *
13027 * @param {number} angle - The angle in radians.
13028 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
13029 */
13030 rotate(angle: number): PIXI.Matrix;
13031 /**
13032 * Appends the given Matrix to this Matrix.
13033 *
13034 * @param {PIXI.Matrix} matrix - The matrix to append.
13035 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
13036 */
13037 append(matrix: PIXI.Matrix): PIXI.Matrix;
13038 /**
13039 * Sets the matrix based on all the available properties
13040 *
13041 * @param {number} x - Position on the x axis
13042 * @param {number} y - Position on the y axis
13043 * @param {number} pivotX - Pivot on the x axis
13044 * @param {number} pivotY - Pivot on the y axis
13045 * @param {number} scaleX - Scale on the x axis
13046 * @param {number} scaleY - Scale on the y axis
13047 * @param {number} rotation - Rotation in radians
13048 * @param {number} skewX - Skew on the x axis
13049 * @param {number} skewY - Skew on the y axis
13050 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
13051 */
13052 setTransform(x: number, y: number, pivotX: number, pivotY: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number): PIXI.Matrix;
13053 /**
13054 * Prepends the given Matrix to this Matrix.
13055 *
13056 * @param {PIXI.Matrix} matrix - The matrix to prepend
13057 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
13058 */
13059 prepend(matrix: PIXI.Matrix): PIXI.Matrix;
13060 /**
13061 * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.
13062 *
13063 * @param {PIXI.Transform} transform - The transform to apply the properties to.
13064 * @return {PIXI.Transform} The transform with the newly applied properties
13065 */
13066 decompose(transform: PIXI.Transform): PIXI.Transform;
13067 /**
13068 * Inverts this matrix
13069 *
13070 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
13071 */
13072 invert(): PIXI.Matrix;
13073 /**
13074 * Resets this Matrix to an identity (default) matrix.
13075 *
13076 * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
13077 */
13078 identity(): PIXI.Matrix;
13079 /**
13080 * Creates a new Matrix object with the same values as this one.
13081 *
13082 * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.
13083 */
13084 clone(): PIXI.Matrix;
13085 /**
13086 * Changes the values of the given matrix to be the same as the ones in this matrix
13087 *
13088 * @param {PIXI.Matrix} matrix - The matrix to copy to.
13089 * @return {PIXI.Matrix} The matrix given in parameter with its values updated.
13090 */
13091 copyTo(matrix: PIXI.Matrix): PIXI.Matrix;
13092 /**
13093 * Changes the values of the matrix to be the same as the ones in given matrix
13094 *
13095 * @param {PIXI.Matrix} matrix - The matrix to copy from.
13096 * @return {PIXI.Matrix} this
13097 */
13098 copyFrom(matrix: PIXI.Matrix): PIXI.Matrix;
13099 /**
13100 * A default (identity) matrix
13101 *
13102 * @static
13103 * @const
13104 * @member {PIXI.Matrix}
13105 */
13106 static IDENTITY: PIXI.Matrix;
13107 /**
13108 * A temp matrix
13109 *
13110 * @static
13111 * @const
13112 * @member {PIXI.Matrix}
13113 */
13114 static TEMP_MATRIX: PIXI.Matrix;
13115 }
13116 interface ObservablePoint extends IPoint {
13117 }
13118 /**
13119 * The Point object represents a location in a two-dimensional coordinate system, where x represents
13120 * the horizontal axis and y represents the vertical axis.
13121 *
13122 * An ObservablePoint is a point that triggers a callback when the point's position is changed.
13123 *
13124 * @class
13125 * @memberof PIXI
13126 * @implements IPoint
13127 */
13128 class ObservablePoint implements IPoint {
13129 constructor(cb: (...params: any[]) => any, scope: any, x?: number, y?: number);
13130 /**
13131 * Creates a clone of this point.
13132 * The callback and scope params can be overidden otherwise they will default
13133 * to the clone object's values.
13134 *
13135 * @override
13136 * @param {Function} [cb=null] - callback when changed
13137 * @param {object} [scope=null] - owner of callback
13138 * @return {PIXI.ObservablePoint} a copy of the point
13139 */
13140 clone(cb?: (...params: any[]) => any, scope?: any): PIXI.ObservablePoint;
13141 /**
13142 * Sets the point to a new x and y position.
13143 * If y is omitted, both x and y will be set to x.
13144 *
13145 * @param {number} [x=0] - position of the point on the x axis
13146 * @param {number} [y=x] - position of the point on the y axis
13147 * @returns {this} Returns itself.
13148 */
13149 set(x?: number, y?: number): this;
13150 /**
13151 * Copies x and y from the given point
13152 *
13153 * @param {PIXI.IPointData} p - The point to copy from.
13154 * @returns {this} Returns itself.
13155 */
13156 copyFrom(p: PIXI.IPointData): this;
13157 /**
13158 * Copies x and y into the given point
13159 *
13160 * @param {PIXI.IPoint} p - The point to copy.
13161 * @returns {PIXI.IPoint} Given point with values updated
13162 */
13163 copyTo(p: PIXI.IPoint): PIXI.IPoint;
13164 /**
13165 * Returns true if the given point is equal to this point
13166 *
13167 * @param {PIXI.IPointData} p - The point to check
13168 * @returns {boolean} Whether the given point equal to this point
13169 */
13170 equals(p: PIXI.IPointData): boolean;
13171 /**
13172 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
13173 *
13174 * @member {number}
13175 */
13176 x: number;
13177 /**
13178 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
13179 *
13180 * @member {number}
13181 */
13182 y: number;
13183 }
13184 interface Point extends IPoint {
13185 }
13186 /**
13187 * The Point object represents a location in a two-dimensional coordinate system, where x represents
13188 * the horizontal axis and y represents the vertical axis.
13189 *
13190 * @class
13191 * @memberof PIXI
13192 * @implements IPoint
13193 */
13194 class Point implements IPoint {
13195 constructor(x?: number, y?: number);
13196 /**
13197 * @member {number} PIXI.Point#x
13198 * @default 0
13199 */
13200 x: number;
13201 /**
13202 * @member {number} PIXI.Point#y
13203 * @default 0
13204 */
13205 y: number;
13206 /**
13207 * Creates a clone of this point
13208 *
13209 * @return {PIXI.Point} a copy of the point
13210 */
13211 clone(): PIXI.Point;
13212 /**
13213 * Copies x and y from the given point
13214 *
13215 * @param {PIXI.IPointData} p - The point to copy from
13216 * @returns {this} Returns itself.
13217 */
13218 copyFrom(p: PIXI.IPointData): this;
13219 /**
13220 * Copies x and y into the given point
13221 *
13222 * @param {PIXI.IPoint} p - The point to copy.
13223 * @returns {PIXI.IPoint} Given point with values updated
13224 */
13225 copyTo(p: PIXI.IPoint): PIXI.IPoint;
13226 /**
13227 * Returns true if the given point is equal to this point
13228 *
13229 * @param {PIXI.IPointData} p - The point to check
13230 * @returns {boolean} Whether the given point equal to this point
13231 */
13232 equals(p: PIXI.IPointData): boolean;
13233 /**
13234 * Sets the point to a new x and y position.
13235 * If y is omitted, both x and y will be set to x.
13236 *
13237 * @param {number} [x=0] - position of the point on the x axis
13238 * @param {number} [y=x] - position of the point on the y axis
13239 * @returns {this} Returns itself.
13240 */
13241 set(x?: number, y?: number): this;
13242 }
13243 /**
13244 * Transform that takes care about its versions
13245 *
13246 * @class
13247 * @memberof PIXI
13248 */
13249 class Transform {
13250 constructor();
13251 /**
13252 * The world transformation matrix.
13253 *
13254 * @member {PIXI.Matrix} PIXI.Transform#worldTransform
13255 */
13256 worldTransform: PIXI.Matrix;
13257 /**
13258 * The local transformation matrix.
13259 *
13260 * @member {PIXI.Matrix} PIXI.Transform#localTransform
13261 */
13262 localTransform: PIXI.Matrix;
13263 /**
13264 * The coordinate of the object relative to the local coordinates of the parent.
13265 *
13266 * @member {PIXI.ObservablePoint} PIXI.Transform#position
13267 */
13268 position: PIXI.ObservablePoint;
13269 /**
13270 * The scale factor of the object.
13271 *
13272 * @member {PIXI.ObservablePoint} PIXI.Transform#scale
13273 */
13274 scale: PIXI.ObservablePoint;
13275 /**
13276 * The pivot point of the displayObject that it rotates around.
13277 *
13278 * @member {PIXI.ObservablePoint} PIXI.Transform#pivot
13279 */
13280 pivot: PIXI.ObservablePoint;
13281 /**
13282 * The skew amount, on the x and y axis.
13283 *
13284 * @member {PIXI.ObservablePoint} PIXI.Transform#skew
13285 */
13286 skew: PIXI.ObservablePoint;
13287 /**
13288 * The rotation amount.
13289 *
13290 * @protected
13291 * @member {number} PIXI.Transform#_rotation
13292 */
13293 protected _rotation: number;
13294 /**
13295 * The X-coordinate value of the normalized local X axis,
13296 * the first column of the local transformation matrix without a scale.
13297 *
13298 * @protected
13299 * @member {number} PIXI.Transform#_cx
13300 */
13301 protected _cx: number;
13302 /**
13303 * The Y-coordinate value of the normalized local X axis,
13304 * the first column of the local transformation matrix without a scale.
13305 *
13306 * @protected
13307 * @member {number} PIXI.Transform#_sx
13308 */
13309 protected _sx: number;
13310 /**
13311 * The X-coordinate value of the normalized local Y axis,
13312 * the second column of the local transformation matrix without a scale.
13313 *
13314 * @protected
13315 * @member {number} PIXI.Transform#_cy
13316 */
13317 protected _cy: number;
13318 /**
13319 * The Y-coordinate value of the normalized local Y axis,
13320 * the second column of the local transformation matrix without a scale.
13321 *
13322 * @protected
13323 * @member {number} PIXI.Transform#_sy
13324 */
13325 protected _sy: number;
13326 /**
13327 * The locally unique ID of the local transform.
13328 *
13329 * @protected
13330 * @member {number} PIXI.Transform#_localID
13331 */
13332 protected _localID: number;
13333 /**
13334 * The locally unique ID of the local transform
13335 * used to calculate the current local transformation matrix.
13336 *
13337 * @protected
13338 * @member {number} PIXI.Transform#_currentLocalID
13339 */
13340 protected _currentLocalID: number;
13341 /**
13342 * The locally unique ID of the world transform.
13343 *
13344 * @protected
13345 * @member {number} PIXI.Transform#_worldID
13346 */
13347 protected _worldID: number;
13348 /**
13349 * The locally unique ID of the parent's world transform
13350 * used to calculate the current world transformation matrix.
13351 *
13352 * @protected
13353 * @member {number} PIXI.Transform#_parentID
13354 */
13355 protected _parentID: number;
13356 /**
13357 * Called when a value changes.
13358 *
13359 * @protected
13360 */
13361 protected onChange(): void;
13362 /**
13363 * Called when the skew or the rotation changes.
13364 *
13365 * @protected
13366 */
13367 protected updateSkew(): void;
13368 /**
13369 * Updates the local transformation matrix.
13370 */
13371 updateLocalTransform(): void;
13372 /**
13373 * Updates the local and the world transformation matrices.
13374 *
13375 * @param {PIXI.Transform} parentTransform - The parent transform
13376 */
13377 updateTransform(parentTransform: PIXI.Transform): void;
13378 /**
13379 * Decomposes a matrix and sets the transforms properties based on it.
13380 *
13381 * @param {PIXI.Matrix} matrix - The matrix to decompose
13382 */
13383 setFromMatrix(matrix: PIXI.Matrix): void;
13384 /**
13385 * The rotation of the object in radians.
13386 *
13387 * @member {number}
13388 */
13389 rotation: number;
13390 /**
13391 * A default (identity) transform
13392 *
13393 * @static
13394 * @constant
13395 * @member {PIXI.Transform}
13396 */
13397 static IDENTITY: PIXI.Transform;
13398 }
13399 /**
13400 * Constants that identify shapes, mainly to prevent `instanceof` calls.
13401 *
13402 * @static
13403 * @constant
13404 * @name SHAPES
13405 * @memberof PIXI
13406 * @type {enum}
13407 * @property {number} POLY Polygon
13408 * @property {number} RECT Rectangle
13409 * @property {number} CIRC Circle
13410 * @property {number} ELIP Ellipse
13411 * @property {number} RREC Rounded Rectangle
13412 * @enum {number}
13413 */
13414 enum SHAPES {
13415 POLY,
13416 RECT,
13417 CIRC,
13418 ELIP,
13419 RREC
13420 }
13421 /**
13422 * Two Pi.
13423 *
13424 * @static
13425 * @constant {number} PI_2
13426 * @memberof PIXI
13427 */
13428 var PI_2: number;
13429 /**
13430 * Conversion factor for converting radians to degrees.
13431 *
13432 * @static
13433 * @constant {number} RAD_TO_DEG
13434 * @memberof PIXI
13435 */
13436 var RAD_TO_DEG: number;
13437 /**
13438 * Conversion factor for converting degrees to radians.
13439 *
13440 * @static
13441 * @constant {number} DEG_TO_RAD
13442 * @memberof PIXI
13443 */
13444 var DEG_TO_RAD: number;
13445 /**
13446 * @memberof PIXI
13447 * @typedef {number} GD8Symmetry
13448 * @see PIXI.groupD8
13449 */
13450 type GD8Symmetry = number;
13451 /**
13452 * Implements the dihedral group D8, which is similar to
13453 * [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html};
13454 * D8 is the same but with diagonals, and it is used for texture
13455 * rotations.
13456 *
13457 * The directions the U- and V- axes after rotation
13458 * of an angle of `a: GD8Constant` are the vectors `(uX(a), uY(a))`
13459 * and `(vX(a), vY(a))`. These aren't necessarily unit vectors.
13460 *
13461 * **Origin:**<br>
13462 * This is the small part of gameofbombs.com portal system. It works.
13463 *
13464 * @see PIXI.groupD8.E
13465 * @see PIXI.groupD8.SE
13466 * @see PIXI.groupD8.S
13467 * @see PIXI.groupD8.SW
13468 * @see PIXI.groupD8.W
13469 * @see PIXI.groupD8.NW
13470 * @see PIXI.groupD8.N
13471 * @see PIXI.groupD8.NE
13472 * @author Ivan @ivanpopelyshev
13473 * @namespace PIXI.groupD8
13474 * @memberof PIXI
13475 */
13476 namespace groupD8 {
13477 /**
13478 * | Rotation | Direction |
13479 * |----------|-----------|
13480 * | 0° | East |
13481 *
13482 * @memberof PIXI.groupD8
13483 * @constant {PIXI.GD8Symmetry}
13484 */
13485 var E: PIXI.GD8Symmetry;
13486 /**
13487 * | Rotation | Direction |
13488 * |----------|-----------|
13489 * | 45°↻ | Southeast |
13490 *
13491 * @memberof PIXI.groupD8
13492 * @constant {PIXI.GD8Symmetry}
13493 */
13494 var SE: PIXI.GD8Symmetry;
13495 /**
13496 * | Rotation | Direction |
13497 * |----------|-----------|
13498 * | 90°↻ | South |
13499 *
13500 * @memberof PIXI.groupD8
13501 * @constant {PIXI.GD8Symmetry}
13502 */
13503 var S: PIXI.GD8Symmetry;
13504 /**
13505 * | Rotation | Direction |
13506 * |----------|-----------|
13507 * | 135°↻ | Southwest |
13508 *
13509 * @memberof PIXI.groupD8
13510 * @constant {PIXI.GD8Symmetry}
13511 */
13512 var SW: PIXI.GD8Symmetry;
13513 /**
13514 * | Rotation | Direction |
13515 * |----------|-----------|
13516 * | 180° | West |
13517 *
13518 * @memberof PIXI.groupD8
13519 * @constant {PIXI.GD8Symmetry}
13520 */
13521 var W: PIXI.GD8Symmetry;
13522 /**
13523 * | Rotation | Direction |
13524 * |-------------|--------------|
13525 * | -135°/225°↻ | Northwest |
13526 *
13527 * @memberof PIXI.groupD8
13528 * @constant {PIXI.GD8Symmetry}
13529 */
13530 var NW: PIXI.GD8Symmetry;
13531 /**
13532 * | Rotation | Direction |
13533 * |-------------|--------------|
13534 * | -90°/270°↻ | North |
13535 *
13536 * @memberof PIXI.groupD8
13537 * @constant {PIXI.GD8Symmetry}
13538 */
13539 var N: PIXI.GD8Symmetry;
13540 /**
13541 * | Rotation | Direction |
13542 * |-------------|--------------|
13543 * | -45°/315°↻ | Northeast |
13544 *
13545 * @memberof PIXI.groupD8
13546 * @constant {PIXI.GD8Symmetry}
13547 */
13548 var NE: PIXI.GD8Symmetry;
13549 /**
13550 * Reflection about Y-axis.
13551 *
13552 * @memberof PIXI.groupD8
13553 * @constant {PIXI.GD8Symmetry}
13554 */
13555 var MIRROR_VERTICAL: PIXI.GD8Symmetry;
13556 /**
13557 * Reflection about the main diagonal.
13558 *
13559 * @memberof PIXI.groupD8
13560 * @constant {PIXI.GD8Symmetry}
13561 */
13562 var MAIN_DIAGONAL: PIXI.GD8Symmetry;
13563 /**
13564 * Reflection about X-axis.
13565 *
13566 * @memberof PIXI.groupD8
13567 * @constant {PIXI.GD8Symmetry}
13568 */
13569 var MIRROR_HORIZONTAL: PIXI.GD8Symmetry;
13570 /**
13571 * Reflection about reverse diagonal.
13572 *
13573 * @memberof PIXI.groupD8
13574 * @constant {PIXI.GD8Symmetry}
13575 */
13576 var REVERSE_DIAGONAL: PIXI.GD8Symmetry;
13577 /**
13578 * @memberof PIXI.groupD8
13579 * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
13580 * @return {PIXI.GD8Symmetry} The X-component of the U-axis
13581 * after rotating the axes.
13582 */
13583 function uX(ind: PIXI.GD8Symmetry): PIXI.GD8Symmetry;
13584 /**
13585 * @memberof PIXI.groupD8
13586 * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
13587 * @return {PIXI.GD8Symmetry} The Y-component of the U-axis
13588 * after rotating the axes.
13589 */
13590 function uY(ind: PIXI.GD8Symmetry): PIXI.GD8Symmetry;
13591 /**
13592 * @memberof PIXI.groupD8
13593 * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
13594 * @return {PIXI.GD8Symmetry} The X-component of the V-axis
13595 * after rotating the axes.
13596 */
13597 function vX(ind: PIXI.GD8Symmetry): PIXI.GD8Symmetry;
13598 /**
13599 * @memberof PIXI.groupD8
13600 * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.
13601 * @return {PIXI.GD8Symmetry} The Y-component of the V-axis
13602 * after rotating the axes.
13603 */
13604 function vY(ind: PIXI.GD8Symmetry): PIXI.GD8Symmetry;
13605 /**
13606 * @memberof PIXI.groupD8
13607 * @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite
13608 * is needed. Only rotations have opposite symmetries while
13609 * reflections don't.
13610 * @return {PIXI.GD8Symmetry} The opposite symmetry of `rotation`
13611 */
13612 function inv(rotation: PIXI.GD8Symmetry): PIXI.GD8Symmetry;
13613 /**
13614 * Composes the two D8 operations.
13615 *
13616 * Taking `^` as reflection:
13617 *
13618 * | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |
13619 * |-------|-----|-----|-----|-----|------|-------|-------|-------|
13620 * | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |
13621 * | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |
13622 * | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |
13623 * | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |
13624 * | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |
13625 * | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |
13626 * | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |
13627 * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |
13628 *
13629 * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}
13630 * @memberof PIXI.groupD8
13631 * @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which
13632 * is the row in the above cayley table.
13633 * @param {PIXI.GD8Symmetry} rotationFirst - First operation, which
13634 * is the column in the above cayley table.
13635 * @return {PIXI.GD8Symmetry} Composed operation
13636 */
13637 function add(rotationSecond: PIXI.GD8Symmetry, rotationFirst: PIXI.GD8Symmetry): PIXI.GD8Symmetry;
13638 /**
13639 * Reverse of `add`.
13640 *
13641 * @memberof PIXI.groupD8
13642 * @param {PIXI.GD8Symmetry} rotationSecond - Second operation
13643 * @param {PIXI.GD8Symmetry} rotationFirst - First operation
13644 * @return {PIXI.GD8Symmetry} Result
13645 */
13646 function sub(rotationSecond: PIXI.GD8Symmetry, rotationFirst: PIXI.GD8Symmetry): PIXI.GD8Symmetry;
13647 /**
13648 * Adds 180 degrees to rotation, which is a commutative
13649 * operation.
13650 *
13651 * @memberof PIXI.groupD8
13652 * @param {number} rotation - The number to rotate.
13653 * @returns {number} Rotated number
13654 */
13655 function rotate180(rotation: number): number;
13656 /**
13657 * Checks if the rotation angle is vertical, i.e. south
13658 * or north. It doesn't work for reflections.
13659 *
13660 * @memberof PIXI.groupD8
13661 * @param {PIXI.GD8Symmetry} rotation - The number to check.
13662 * @returns {boolean} Whether or not the direction is vertical
13663 */
13664 function isVertical(rotation: PIXI.GD8Symmetry): boolean;
13665 /**
13666 * Approximates the vector `V(dx,dy)` into one of the
13667 * eight directions provided by `groupD8`.
13668 *
13669 * @memberof PIXI.groupD8
13670 * @param {number} dx - X-component of the vector
13671 * @param {number} dy - Y-component of the vector
13672 * @return {PIXI.GD8Symmetry} Approximation of the vector into
13673 * one of the eight symmetries.
13674 */
13675 function byDirection(dx: number, dy: number): PIXI.GD8Symmetry;
13676 /**
13677 * Helps sprite to compensate texture packer rotation.
13678 *
13679 * @memberof PIXI.groupD8
13680 * @param {PIXI.Matrix} matrix - sprite world matrix
13681 * @param {PIXI.GD8Symmetry} rotation - The rotation factor to use.
13682 * @param {number} tx - sprite anchoring
13683 * @param {number} ty - sprite anchoring
13684 */
13685 function matrixAppendRotationInv(matrix: PIXI.Matrix, rotation: PIXI.GD8Symmetry, tx: number, ty: number): void;
13686 }
13687 /**
13688 * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.
13689 *
13690 * @class
13691 * @memberof PIXI
13692 */
13693 class Circle {
13694 constructor(x?: number, y?: number, radius?: number);
13695 /**
13696 * @member {number} PIXI.Circle#x
13697 * @default 0
13698 */
13699 x: number;
13700 /**
13701 * @member {number} PIXI.Circle#y
13702 * @default 0
13703 */
13704 y: number;
13705 /**
13706 * @member {number} PIXI.Circle#radius
13707 * @default 0
13708 */
13709 radius: number;
13710 /**
13711 * The type of the object, mainly used to avoid `instanceof` checks
13712 *
13713 * @member {number} PIXI.Circle#type
13714 * @readOnly
13715 * @default PIXI.SHAPES.CIRC
13716 * @see PIXI.SHAPES
13717 */
13718 readonly type: number;
13719 /**
13720 * Creates a clone of this Circle instance
13721 *
13722 * @return {PIXI.Circle} a copy of the Circle
13723 */
13724 clone(): PIXI.Circle;
13725 /**
13726 * Checks whether the x and y coordinates given are contained within this circle
13727 *
13728 * @param {number} x - The X coordinate of the point to test
13729 * @param {number} y - The Y coordinate of the point to test
13730 * @return {boolean} Whether the x/y coordinates are within this Circle
13731 */
13732 contains(x: number, y: number): boolean;
13733 /**
13734 * Returns the framing rectangle of the circle as a Rectangle object
13735 *
13736 * @return {PIXI.Rectangle} the framing rectangle
13737 */
13738 getBounds(): PIXI.Rectangle;
13739 }
13740 /**
13741 * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.
13742 *
13743 * @class
13744 * @memberof PIXI
13745 */
13746 class Ellipse {
13747 constructor(x?: number, y?: number, halfWidth?: number, halfHeight?: number);
13748 /**
13749 * @member {number} PIXI.Ellipse#x
13750 * @default 0
13751 */
13752 x: number;
13753 /**
13754 * @member {number} PIXI.Ellipse#y
13755 * @default 0
13756 */
13757 y: number;
13758 /**
13759 * @member {number} PIXI.Ellipse#width
13760 * @default 0
13761 */
13762 width: number;
13763 /**
13764 * @member {number} PIXI.Ellipse#height
13765 * @default 0
13766 */
13767 height: number;
13768 /**
13769 * The type of the object, mainly used to avoid `instanceof` checks
13770 *
13771 * @member {number} PIXI.Ellipse#type
13772 * @readOnly
13773 * @default PIXI.SHAPES.ELIP
13774 * @see PIXI.SHAPES
13775 */
13776 readonly type: number;
13777 /**
13778 * Creates a clone of this Ellipse instance
13779 *
13780 * @return {PIXI.Ellipse} a copy of the ellipse
13781 */
13782 clone(): PIXI.Ellipse;
13783 /**
13784 * Checks whether the x and y coordinates given are contained within this ellipse
13785 *
13786 * @param {number} x - The X coordinate of the point to test
13787 * @param {number} y - The Y coordinate of the point to test
13788 * @return {boolean} Whether the x/y coords are within this ellipse
13789 */
13790 contains(x: number, y: number): boolean;
13791 /**
13792 * Returns the framing rectangle of the ellipse as a Rectangle object
13793 *
13794 * @return {PIXI.Rectangle} the framing rectangle
13795 */
13796 getBounds(): PIXI.Rectangle;
13797 }
13798 /**
13799 * A class to define a shape via user defined co-orinates.
13800 *
13801 * @class
13802 * @memberof PIXI
13803 */
13804 class Polygon {
13805 constructor(...points: (PIXI.IPoint[] | number[])[]);
13806 /**
13807 * An array of the points of this polygon
13808 *
13809 * @member {number[]} PIXI.Polygon#points
13810 */
13811 points: number[];
13812 /**
13813 * The type of the object, mainly used to avoid `instanceof` checks
13814 *
13815 * @member {number} PIXI.Polygon#type
13816 * @readOnly
13817 * @default PIXI.SHAPES.POLY
13818 * @see PIXI.SHAPES
13819 */
13820 readonly type: number;
13821 /**
13822 * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.
13823 * @member {boolean} PIXI.Polygon#closeStroke
13824 * @default true
13825 */
13826 closeStroke: boolean;
13827 /**
13828 * Creates a clone of this polygon
13829 *
13830 * @return {PIXI.Polygon} a copy of the polygon
13831 */
13832 clone(): PIXI.Polygon;
13833 /**
13834 * Checks whether the x and y coordinates passed to this function are contained within this polygon
13835 *
13836 * @param {number} x - The X coordinate of the point to test
13837 * @param {number} y - The Y coordinate of the point to test
13838 * @return {boolean} Whether the x/y coordinates are within this polygon
13839 */
13840 contains(x: number, y: number): boolean;
13841 }
13842 /**
13843 * Size object, contains width and height
13844 *
13845 * @memberof PIXI
13846 * @typedef {object} ISize
13847 * @property {number} width - Width component
13848 * @property {number} height - Height component
13849 */
13850 type ISize = {
13851 width: number;
13852 height: number;
13853 };
13854 /**
13855 * Rectangle object is an area defined by its position, as indicated by its top-left corner
13856 * point (x, y) and by its width and its height.
13857 *
13858 * @class
13859 * @memberof PIXI
13860 */
13861 class Rectangle {
13862 constructor(x?: number, y?: number, width?: number, height?: number);
13863 /**
13864 * @member {number} PIXI.Rectangle#x
13865 * @default 0
13866 */
13867 x: number;
13868 /**
13869 * @member {number} PIXI.Rectangle#y
13870 * @default 0
13871 */
13872 y: number;
13873 /**
13874 * @member {number} PIXI.Rectangle#width
13875 * @default 0
13876 */
13877 width: number;
13878 /**
13879 * @member {number} PIXI.Rectangle#height
13880 * @default 0
13881 */
13882 height: number;
13883 /**
13884 * The type of the object, mainly used to avoid `instanceof` checks
13885 *
13886 * @member {number} PIXI.Rectangle#type
13887 * @readOnly
13888 * @default PIXI.SHAPES.RECT
13889 * @see PIXI.SHAPES
13890 */
13891 readonly type: number;
13892 /**
13893 * returns the left edge of the rectangle
13894 *
13895 * @member {number}
13896 */
13897 left: number;
13898 /**
13899 * returns the right edge of the rectangle
13900 *
13901 * @member {number}
13902 */
13903 right: number;
13904 /**
13905 * returns the top edge of the rectangle
13906 *
13907 * @member {number}
13908 */
13909 top: number;
13910 /**
13911 * returns the bottom edge of the rectangle
13912 *
13913 * @member {number}
13914 */
13915 bottom: number;
13916 /**
13917 * A constant empty rectangle.
13918 *
13919 * @static
13920 * @constant
13921 * @member {PIXI.Rectangle}
13922 * @return {PIXI.Rectangle} An empty rectangle
13923 */
13924 static EMPTY: PIXI.Rectangle;
13925 /**
13926 * Creates a clone of this Rectangle
13927 *
13928 * @return {PIXI.Rectangle} a copy of the rectangle
13929 */
13930 clone(): PIXI.Rectangle;
13931 /**
13932 * Copies another rectangle to this one.
13933 *
13934 * @param {PIXI.Rectangle} rectangle - The rectangle to copy from.
13935 * @return {PIXI.Rectangle} Returns itself.
13936 */
13937 copyFrom(rectangle: PIXI.Rectangle): PIXI.Rectangle;
13938 /**
13939 * Copies this rectangle to another one.
13940 *
13941 * @param {PIXI.Rectangle} rectangle - The rectangle to copy to.
13942 * @return {PIXI.Rectangle} Returns given parameter.
13943 */
13944 copyTo(rectangle: PIXI.Rectangle): PIXI.Rectangle;
13945 /**
13946 * Checks whether the x and y coordinates given are contained within this Rectangle
13947 *
13948 * @param {number} x - The X coordinate of the point to test
13949 * @param {number} y - The Y coordinate of the point to test
13950 * @return {boolean} Whether the x/y coordinates are within this Rectangle
13951 */
13952 contains(x: number, y: number): boolean;
13953 /**
13954 * Pads the rectangle making it grow in all directions.
13955 * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
13956 *
13957 * @param {number} [paddingX=0] - The horizontal padding amount.
13958 * @param {number} [paddingY=0] - The vertical padding amount.
13959 * @return {PIXI.Rectangle} Returns itself.
13960 */
13961 pad(paddingX?: number, paddingY?: number): PIXI.Rectangle;
13962 /**
13963 * Fits this rectangle around the passed one.
13964 *
13965 * @param {PIXI.Rectangle} rectangle - The rectangle to fit.
13966 * @return {PIXI.Rectangle} Returns itself.
13967 */
13968 fit(rectangle: PIXI.Rectangle): PIXI.Rectangle;
13969 /**
13970 * Enlarges rectangle that way its corners lie on grid
13971 *
13972 * @param {number} [resolution=1] resolution
13973 * @param {number} [eps=0.001] precision
13974 * @return {PIXI.Rectangle} Returns itself.
13975 */
13976 ceil(resolution?: number, eps?: number): PIXI.Rectangle;
13977 /**
13978 * Enlarges this rectangle to include the passed rectangle.
13979 *
13980 * @param {PIXI.Rectangle} rectangle - The rectangle to include.
13981 * @return {PIXI.Rectangle} Returns itself.
13982 */
13983 enlarge(rectangle: PIXI.Rectangle): PIXI.Rectangle;
13984 }
13985 /**
13986 * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its
13987 * top-left corner point (x, y) and by its width and its height and its radius.
13988 *
13989 * @class
13990 * @memberof PIXI
13991 */
13992 class RoundedRectangle {
13993 constructor(x?: number, y?: number, width?: number, height?: number, radius?: number);
13994 /**
13995 * @member {number} PIXI.RoundedRectangle#x
13996 * @default 0
13997 */
13998 x: number;
13999 /**
14000 * @member {number} PIXI.RoundedRectangle#y
14001 * @default 0
14002 */
14003 y: number;
14004 /**
14005 * @member {number} PIXI.RoundedRectangle#width
14006 * @default 0
14007 */
14008 width: number;
14009 /**
14010 * @member {number} PIXI.RoundedRectangle#height
14011 * @default 0
14012 */
14013 height: number;
14014 /**
14015 * @member {number} PIXI.RoundedRectangle#radius
14016 * @default 20
14017 */
14018 radius: number;
14019 /**
14020 * The type of the object, mainly used to avoid `instanceof` checks
14021 *
14022 * @member {number} PIXI.RoundedRectangle#type
14023 * @readonly
14024 * @default PIXI.SHAPES.RREC
14025 * @see PIXI.SHAPES
14026 */
14027 readonly type: number;
14028 /**
14029 * Creates a clone of this Rounded Rectangle
14030 *
14031 * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle
14032 */
14033 clone(): PIXI.RoundedRectangle;
14034 /**
14035 * Checks whether the x and y coordinates given are contained within this Rounded Rectangle
14036 *
14037 * @param {number} x - The X coordinate of the point to test
14038 * @param {number} y - The Y coordinate of the point to test
14039 * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle
14040 */
14041 contains(x: number, y: number): boolean;
14042 }
14043 /**
14044 * Base mesh class.
14045 *
14046 * This class empowers you to have maximum flexibility to render any kind of WebGL visuals you can think of.
14047 * This class assumes a certain level of WebGL knowledge.
14048 * If you know a bit this should abstract enough away to make you life easier!
14049 *
14050 * Pretty much ALL WebGL can be broken down into the following:
14051 * - Geometry - The structure and data for the mesh. This can include anything from positions, uvs, normals, colors etc..
14052 * - Shader - This is the shader that PixiJS will render the geometry with (attributes in the shader must match the geometry)
14053 * - State - This is the state of WebGL required to render the mesh.
14054 *
14055 * Through a combination of the above elements you can render anything you want, 2D or 3D!
14056 *
14057 * @class
14058 * @extends PIXI.Container
14059 * @memberof PIXI
14060 */
14061 class Mesh extends PIXI.Container {
14062 constructor(geometry: PIXI.Geometry, shader: PIXI.MeshMaterial, state?: PIXI.State, drawMode?: number);
14063 /**
14064 * Cached tint value so we can tell when the tint is changed.
14065 * @memberof PIXI.Mesh#
14066 * @member {number} _cachedTint
14067 * @protected
14068 */
14069 protected _cachedTint: number;
14070 /**
14071 * Cached tinted texture.
14072 * @memberof PIXI.Mesh#
14073 * @member {HTMLCanvasElement} _tintedCanvas
14074 * @protected
14075 */
14076 protected _tintedCanvas: HTMLCanvasElement;
14077 /**
14078 * Renders the object using the Canvas renderer
14079 *
14080 * @protected
14081 * @method _renderCanvas
14082 * @memberof PIXI.Mesh#
14083 * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.
14084 */
14085 protected _renderCanvas(renderer: PIXI.CanvasRenderer): void;
14086 /**
14087 * Includes vertex positions, face indices, normals, colors, UVs, and
14088 * custom attributes within buffers, reducing the cost of passing all
14089 * this data to the GPU. Can be shared between multiple Mesh objects.
14090 * @member {PIXI.Geometry} PIXI.Mesh#geometry
14091 * @readonly
14092 */
14093 readonly geometry: PIXI.Geometry;
14094 /**
14095 * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
14096 * Can be shared between multiple Mesh objects.
14097 * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader
14098 */
14099 shader: PIXI.Shader | PIXI.MeshMaterial;
14100 /**
14101 * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g.,
14102 * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
14103 * @member {PIXI.State} PIXI.Mesh#state
14104 */
14105 state: PIXI.State;
14106 /**
14107 * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants.
14108 *
14109 * @member {number} PIXI.Mesh#drawMode
14110 * @see PIXI.DRAW_MODES
14111 */
14112 drawMode: number;
14113 /**
14114 * Typically the index of the IndexBuffer where to start drawing.
14115 * @member {number} PIXI.Mesh#start
14116 * @default 0
14117 */
14118 start: number;
14119 /**
14120 * How much of the geometry to draw, by default `0` renders everything.
14121 * @member {number} PIXI.Mesh#size
14122 * @default 0
14123 */
14124 size: number;
14125 /**
14126 * To change mesh uv's, change its uvBuffer data and increment its _updateID.
14127 * @member {PIXI.Buffer}
14128 * @readonly
14129 */
14130 readonly uvBuffer: PIXI.Buffer;
14131 /**
14132 * To change mesh vertices, change its uvBuffer data and increment its _updateID.
14133 * Incrementing _updateID is optional because most of Mesh objects do it anyway.
14134 * @member {PIXI.Buffer}
14135 * @readonly
14136 */
14137 readonly verticesBuffer: PIXI.Buffer;
14138 /**
14139 * Alias for {@link PIXI.Mesh#shader}.
14140 * @member {PIXI.MeshMaterial}
14141 */
14142 material: PIXI.MeshMaterial;
14143 /**
14144 * The blend mode to be applied to the Mesh. Apply a value of
14145 * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
14146 *
14147 * @member {number}
14148 * @default PIXI.BLEND_MODES.NORMAL;
14149 * @see PIXI.BLEND_MODES
14150 */
14151 blendMode: number;
14152 /**
14153 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
14154 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
14155 * The main disadvantage is movement of objects may appear less smooth.
14156 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
14157 *
14158 * @member {boolean}
14159 * @default false
14160 */
14161 roundPixels: boolean;
14162 /**
14163 * The multiply tint applied to the Mesh. This is a hex value. A value of
14164 * `0xFFFFFF` will remove any tint effect.
14165 *
14166 * @member {number}
14167 * @default 0xFFFFFF
14168 */
14169 tint: number;
14170 /**
14171 * The texture that the Mesh uses.
14172 *
14173 * @member {PIXI.Texture}
14174 */
14175 texture: PIXI.Texture;
14176 /**
14177 * Standard renderer draw.
14178 * @protected
14179 * @param {PIXI.Renderer} renderer - Instance to renderer.
14180 */
14181 protected _render(renderer: PIXI.Renderer): void;
14182 /**
14183 * Standard non-batching way of rendering.
14184 * @protected
14185 * @param {PIXI.Renderer} renderer - Instance to renderer.
14186 */
14187 protected _renderDefault(renderer: PIXI.Renderer): void;
14188 /**
14189 * Rendering by using the Batch system.
14190 * @protected
14191 * @param {PIXI.Renderer} renderer - Instance to renderer.
14192 */
14193 protected _renderToBatch(renderer: PIXI.Renderer): void;
14194 /**
14195 * Updates vertexData field based on transform and vertices
14196 */
14197 calculateVertices(): void;
14198 /**
14199 * Updates uv field based on from geometry uv's or batchUvs
14200 */
14201 calculateUvs(): void;
14202 /**
14203 * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.
14204 * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.
14205 *
14206 * @protected
14207 */
14208 protected _calculateBounds(): void;
14209 /**
14210 * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.
14211 *
14212 * @param {PIXI.IPointData} point - the point to test
14213 * @return {boolean} the result of the test
14214 */
14215 containsPoint(point: PIXI.IPointData): boolean;
14216 /**
14217 * Destroys the Mesh object.
14218 *
14219 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
14220 * options have been set to that value
14221 * @param {boolean} [options.children=false] - if set to true, all the children will have
14222 * their destroy method called as well. 'options' will be passed on to those calls.
14223 */
14224 destroy(options?: {
14225 children?: boolean;
14226 }): void;
14227 /**
14228 * The maximum number of vertices to consider batchable. Generally, the complexity
14229 * of the geometry.
14230 * @memberof PIXI.Mesh
14231 * @static
14232 * @member {number} BATCHABLE_SIZE
14233 */
14234 static BATCHABLE_SIZE: number;
14235 /**
14236 * Renders the object using the Canvas renderer
14237 * @method renderCanvas
14238 * @memberof PIXI.Container#
14239 * @param {PIXI.CanvasRenderer} renderer - The renderer
14240 */
14241 renderCanvas(renderer: PIXI.CanvasRenderer): void;
14242 /**
14243 * The array of children of this container.
14244 *
14245 * @member {PIXI.DisplayObject[]} PIXI.Container#children
14246 * @readonly
14247 */
14248 readonly children: PIXI.DisplayObject[];
14249 /**
14250 * If set to true, the container will sort its children by zIndex value
14251 * when updateTransform() is called, or manually if sortChildren() is called.
14252 *
14253 * This actually changes the order of elements in the array, so should be treated
14254 * as a basic solution that is not performant compared to other solutions,
14255 * such as @link https://github.com/pixijs/pixi-display
14256 *
14257 * Also be aware of that this may not work nicely with the addChildAt() function,
14258 * as the zIndex sorting may cause the child to automatically sorted to another position.
14259 *
14260 * @see PIXI.settings.SORTABLE_CHILDREN
14261 *
14262 * @member {boolean} PIXI.Container#sortableChildren
14263 */
14264 sortableChildren: boolean;
14265 /**
14266 * Should children be sorted by zIndex at the next updateTransform call.
14267 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
14268 *
14269 * @member {boolean} PIXI.Container#sortDirty
14270 */
14271 sortDirty: boolean;
14272 /**
14273 * Overridable method that can be used by Container subclasses whenever the children array is modified
14274 *
14275 * @protected
14276 */
14277 protected onChildrenChange(): void;
14278 /**
14279 * Adds one or more children to the container.
14280 *
14281 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
14282 *
14283 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
14284 * @return {PIXI.DisplayObject} The first child that was added.
14285 */
14286 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
14287 /**
14288 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
14289 *
14290 * @param {PIXI.DisplayObject} child - The child to add
14291 * @param {number} index - The index to place the child in
14292 * @return {PIXI.DisplayObject} The child that was added.
14293 */
14294 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
14295 /**
14296 * Swaps the position of 2 Display Objects within this container.
14297 *
14298 * @param {PIXI.DisplayObject} child - First display object to swap
14299 * @param {PIXI.DisplayObject} child2 - Second display object to swap
14300 */
14301 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
14302 /**
14303 * Returns the index position of a child DisplayObject instance
14304 *
14305 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
14306 * @return {number} The index position of the child display object to identify
14307 */
14308 getChildIndex(child: PIXI.DisplayObject): number;
14309 /**
14310 * Changes the position of an existing child in the display object container
14311 *
14312 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
14313 * @param {number} index - The resulting index number for the child display object
14314 */
14315 setChildIndex(child: PIXI.DisplayObject, index: number): void;
14316 /**
14317 * Returns the child at the specified index
14318 *
14319 * @param {number} index - The index to get the child at
14320 * @return {PIXI.DisplayObject} The child at the given index, if any.
14321 */
14322 getChildAt(index: number): PIXI.DisplayObject;
14323 /**
14324 * Removes one or more children from the container.
14325 *
14326 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
14327 * @return {PIXI.DisplayObject} The first child that was removed.
14328 */
14329 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
14330 /**
14331 * Removes a child from the specified index position.
14332 *
14333 * @param {number} index - The index to get the child from
14334 * @return {PIXI.DisplayObject} The child that was removed.
14335 */
14336 removeChildAt(index: number): PIXI.DisplayObject;
14337 /**
14338 * Removes all children from this container that are within the begin and end indexes.
14339 *
14340 * @param {number} [beginIndex=0] - The beginning position.
14341 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
14342 * @returns {PIXI.DisplayObject[]} List of removed children
14343 */
14344 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
14345 /**
14346 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
14347 */
14348 sortChildren(): void;
14349 /**
14350 * Updates the transform on all children of this container for rendering
14351 */
14352 updateTransform(): void;
14353 /**
14354 * Recalculates the bounds of the container.
14355 *
14356 */
14357 calculateBounds(): void;
14358 /**
14359 * Retrieves the local bounds of the displayObject as a rectangle object.
14360 *
14361 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
14362 * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,
14363 * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
14364 * @return {PIXI.Rectangle} The rectangular bounding area.
14365 */
14366 getLocalBounds(rect?: PIXI.Rectangle, skipChildrenUpdate?: boolean): PIXI.Rectangle;
14367 /**
14368 * Renders the object using the WebGL renderer
14369 *
14370 * @param {PIXI.Renderer} renderer - The renderer
14371 */
14372 render(renderer: PIXI.Renderer): void;
14373 /**
14374 * Render the object using the WebGL renderer and advanced features.
14375 *
14376 * @protected
14377 * @param {PIXI.Renderer} renderer - The renderer
14378 */
14379 protected renderAdvanced(renderer: PIXI.Renderer): void;
14380 /**
14381 * The width of the Container, setting this will actually modify the scale to achieve the value set
14382 *
14383 * @member {number}
14384 */
14385 width: number;
14386 /**
14387 * The height of the Container, setting this will actually modify the scale to achieve the value set
14388 *
14389 * @member {number}
14390 */
14391 height: number;
14392 /**
14393 * Container default updateTransform, does update children of container.
14394 * Will crash if there's no parent element.
14395 *
14396 * @memberof PIXI.Container#
14397 * @function containerUpdateTransform
14398 */
14399 containerUpdateTransform(): void;
14400 /**
14401 * Determines if the children to the displayObject can be clicked/touched
14402 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
14403 *
14404 * @member {boolean}
14405 * @memberof PIXI.Container#
14406 */
14407 interactiveChildren: boolean;
14408 /**
14409 * Returns the display object in the container.
14410 *
14411 * Recursive searches are done in a preorder traversal.
14412 *
14413 * @method getChildByName
14414 * @memberof PIXI.Container#
14415 * @param {string} name - Instance name.
14416 * @param {boolean}[deep=false] - Whether to search recursively
14417 * @return {PIXI.DisplayObject} The child with the specified name.
14418 */
14419 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
14420 /**
14421 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
14422 * shadow div with attributes set
14423 *
14424 * @member {boolean}
14425 * @memberof PIXI.DisplayObject#
14426 */
14427 accessible: boolean;
14428 /**
14429 * Sets the title attribute of the shadow div
14430 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
14431 *
14432 * @member {?string}
14433 * @memberof PIXI.DisplayObject#
14434 */
14435 accessibleTitle: string;
14436 /**
14437 * Sets the aria-label attribute of the shadow div
14438 *
14439 * @member {string}
14440 * @memberof PIXI.DisplayObject#
14441 */
14442 accessibleHint: string;
14443 /**
14444 * @member {boolean}
14445 * @memberof PIXI.DisplayObject#
14446 * @todo Needs docs.
14447 */
14448 _accessibleActive: boolean;
14449 /**
14450 * @member {boolean}
14451 * @memberof PIXI.DisplayObject#
14452 * @todo Needs docs.
14453 */
14454 _accessibleDiv: boolean;
14455 /**
14456 * Specify the type of div the accessible layer is. Screen readers treat the element differently
14457 * depending on this type. Defaults to button.
14458 *
14459 * @member {string}
14460 * @memberof PIXI.DisplayObject#
14461 * @default 'button'
14462 */
14463 accessibleType: string;
14464 /**
14465 * Specify the pointer-events the accessible div will use
14466 * Defaults to auto.
14467 *
14468 * @member {string}
14469 * @memberof PIXI.DisplayObject#
14470 * @default 'auto'
14471 */
14472 accessiblePointerEvents: string;
14473 /**
14474 * Setting to false will prevent any children inside this container to
14475 * be accessible. Defaults to true.
14476 *
14477 * @member {boolean}
14478 * @memberof PIXI.DisplayObject#
14479 * @default true
14480 */
14481 accessibleChildren: boolean;
14482 /**
14483 * World transform and local transform of this object.
14484 * This will become read-only later, please do not assign anything there unless you know what are you doing.
14485 *
14486 * @member {PIXI.Transform} PIXI.DisplayObject#transform
14487 */
14488 transform: PIXI.Transform;
14489 /**
14490 * The opacity of the object.
14491 *
14492 * @member {number} PIXI.DisplayObject#alpha
14493 */
14494 alpha: number;
14495 /**
14496 * The visibility of the object. If false the object will not be drawn, and
14497 * the updateTransform function will not be called.
14498 *
14499 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
14500 *
14501 * @member {boolean} PIXI.DisplayObject#visible
14502 */
14503 visible: boolean;
14504 /**
14505 * Can this object be rendered, if false the object will not be drawn but the updateTransform
14506 * methods will still be called.
14507 *
14508 * Only affects recursive calls from parent. You can ask for bounds manually.
14509 *
14510 * @member {boolean} PIXI.DisplayObject#renderable
14511 */
14512 renderable: boolean;
14513 /**
14514 * The display object container that contains this display object.
14515 *
14516 * @member {PIXI.Container} PIXI.DisplayObject#parent
14517 */
14518 parent: PIXI.Container;
14519 /**
14520 * The multiplied alpha of the displayObject.
14521 *
14522 * @member {number} PIXI.DisplayObject#worldAlpha
14523 * @readonly
14524 */
14525 readonly worldAlpha: number;
14526 /**
14527 * Which index in the children array the display component was before the previous zIndex sort.
14528 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
14529 *
14530 * @member {number} PIXI.DisplayObject#_lastSortedIndex
14531 * @protected
14532 */
14533 protected _lastSortedIndex: number;
14534 /**
14535 * The zIndex of the displayObject.
14536 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
14537 *
14538 * @member {number} PIXI.DisplayObject#_zIndex
14539 * @protected
14540 */
14541 protected _zIndex: number;
14542 /**
14543 * The area the filter is applied to. This is used as more of an optimization
14544 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
14545 *
14546 * Also works as an interaction mask.
14547 *
14548 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
14549 */
14550 filterArea: PIXI.Rectangle;
14551 /**
14552 * Sets the filters for the displayObject.
14553 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
14554 * To remove filters simply set this property to `'null'`.
14555 *
14556 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
14557 */
14558 filters: PIXI.Filter[];
14559 /**
14560 * Currently enabled filters
14561 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
14562 * @protected
14563 */
14564 protected _enabledFilters: PIXI.Filter[];
14565 /**
14566 * The bounds object, this is used to calculate and store the bounds of the displayObject.
14567 *
14568 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
14569 */
14570 _bounds: PIXI.Bounds;
14571 /**
14572 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
14573 *
14574 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
14575 */
14576 _localBounds: PIXI.Bounds;
14577 /**
14578 * Flags the cached bounds as dirty.
14579 *
14580 * @member {number} PIXI.DisplayObject#_boundsID
14581 * @protected
14582 */
14583 protected _boundsID: number;
14584 /**
14585 * Cache of this display-object's bounds-rectangle.
14586 *
14587 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
14588 * @protected
14589 */
14590 protected _boundsRect: PIXI.Bounds;
14591 /**
14592 * Cache of this display-object's local-bounds rectangle.
14593 *
14594 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
14595 * @protected
14596 */
14597 protected _localBoundsRect: PIXI.Bounds;
14598 /**
14599 * The original, cached mask of the object.
14600 *
14601 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
14602 * @protected
14603 */
14604 protected _mask: PIXI.Container | PIXI.MaskData | null;
14605 /**
14606 * If the object has been destroyed via destroy(). If true, it should not be used.
14607 *
14608 * @member {boolean} PIXI.DisplayObject#_destroyed
14609 * @protected
14610 */
14611 protected _destroyed: boolean;
14612 /**
14613 * used to fast check if a sprite is.. a sprite!
14614 * @member {boolean} PIXI.DisplayObject#isSprite
14615 */
14616 isSprite: boolean;
14617 /**
14618 * Does any other displayObject use this object as a mask?
14619 * @member {boolean} PIXI.DisplayObject#isMask
14620 */
14621 isMask: boolean;
14622 /**
14623 * Recursively updates transform of all objects from the root to this one
14624 * internal function for toLocal()
14625 */
14626 _recursivePostUpdateTransform(): void;
14627 /**
14628 * Retrieves the bounds of the displayObject as a rectangle object.
14629 *
14630 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
14631 * being updated. This means the calculation returned MAY be out of date BUT will give you a
14632 * nice performance boost.
14633 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
14634 * @return {PIXI.Rectangle} The rectangular bounding area.
14635 */
14636 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
14637 /**
14638 * Calculates the global position of the display object.
14639 *
14640 * @param {PIXI.IPointData} position - The world origin to calculate from.
14641 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
14642 * (otherwise will create a new Point).
14643 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
14644 * @return {PIXI.Point} A point object representing the position of this object.
14645 */
14646 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
14647 /**
14648 * Calculates the local position of the display object relative to another point.
14649 *
14650 * @param {PIXI.IPointData} position - The world origin to calculate from.
14651 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
14652 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
14653 * (otherwise will create a new Point).
14654 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
14655 * @return {PIXI.Point} A point object representing the position of this object
14656 */
14657 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
14658 /**
14659 * Set the parent Container of this DisplayObject.
14660 *
14661 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
14662 * @return {PIXI.Container} The Container that this DisplayObject was added to.
14663 */
14664 setParent(container: PIXI.Container): PIXI.Container;
14665 /**
14666 * Convenience function to set the position, scale, skew and pivot at once.
14667 *
14668 * @param {number} [x=0] - The X position
14669 * @param {number} [y=0] - The Y position
14670 * @param {number} [scaleX=1] - The X scale value
14671 * @param {number} [scaleY=1] - The Y scale value
14672 * @param {number} [rotation=0] - The rotation
14673 * @param {number} [skewX=0] - The X skew value
14674 * @param {number} [skewY=0] - The Y skew value
14675 * @param {number} [pivotX=0] - The X pivot value
14676 * @param {number} [pivotY=0] - The Y pivot value
14677 * @return {PIXI.DisplayObject} The DisplayObject instance
14678 */
14679 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
14680 /**
14681 * @protected
14682 * @member {PIXI.Container}
14683 */
14684 protected _tempDisplayObjectParent: PIXI.Container;
14685 /**
14686 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
14687 *
14688 * ```
14689 * const cacheParent = elem.enableTempParent();
14690 * elem.updateTransform();
14691 * elem.disableTempParent(cacheParent);
14692 * ```
14693 *
14694 * @returns {PIXI.DisplayObject} current parent
14695 */
14696 enableTempParent(): PIXI.DisplayObject;
14697 /**
14698 * Pair method for `enableTempParent`
14699 * @param {PIXI.DisplayObject} cacheParent actual parent of element
14700 */
14701 disableTempParent(cacheParent: PIXI.DisplayObject): void;
14702 /**
14703 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
14704 * An alias to position.x
14705 *
14706 * @member {number}
14707 */
14708 x: number;
14709 /**
14710 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
14711 * An alias to position.y
14712 *
14713 * @member {number}
14714 */
14715 y: number;
14716 /**
14717 * Current transform of the object based on world (parent) factors.
14718 *
14719 * @member {PIXI.Matrix}
14720 * @readonly
14721 */
14722 readonly worldTransform: PIXI.Matrix;
14723 /**
14724 * Current transform of the object based on local factors: position, scale, other stuff.
14725 *
14726 * @member {PIXI.Matrix}
14727 * @readonly
14728 */
14729 readonly localTransform: PIXI.Matrix;
14730 /**
14731 * The coordinate of the object relative to the local coordinates of the parent.
14732 * Assignment by value since pixi-v4.
14733 *
14734 * @member {PIXI.ObservablePoint}
14735 */
14736 position: PIXI.ObservablePoint;
14737 /**
14738 * The scale factor of the object.
14739 * Assignment by value since pixi-v4.
14740 *
14741 * @member {PIXI.ObservablePoint}
14742 */
14743 scale: PIXI.ObservablePoint;
14744 /**
14745 * The pivot point of the displayObject that it rotates around.
14746 * Assignment by value since pixi-v4.
14747 *
14748 * @member {PIXI.ObservablePoint}
14749 */
14750 pivot: PIXI.ObservablePoint;
14751 /**
14752 * The skew factor for the object in radians.
14753 * Assignment by value since pixi-v4.
14754 *
14755 * @member {PIXI.ObservablePoint}
14756 */
14757 skew: PIXI.ObservablePoint;
14758 /**
14759 * The rotation of the object in radians.
14760 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
14761 *
14762 * @member {number}
14763 */
14764 rotation: number;
14765 /**
14766 * The angle of the object in degrees.
14767 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
14768 *
14769 * @member {number}
14770 */
14771 angle: number;
14772 /**
14773 * The zIndex of the displayObject.
14774 * If a container has the sortableChildren property set to true, children will be automatically
14775 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
14776 * and thus rendered on top of other displayObjects within the same container.
14777 *
14778 * @member {number}
14779 */
14780 zIndex: number;
14781 /**
14782 * Indicates if the object is globally visible.
14783 *
14784 * @member {boolean}
14785 * @readonly
14786 */
14787 readonly worldVisible: boolean;
14788 /**
14789 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
14790 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
14791 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
14792 * utilities shape clipping. To remove a mask, set this property to `null`.
14793 *
14794 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
14795 * @example
14796 * const graphics = new PIXI.Graphics();
14797 * graphics.beginFill(0xFF3300);
14798 * graphics.drawRect(50, 250, 100, 100);
14799 * graphics.endFill();
14800 *
14801 * const sprite = new PIXI.Sprite(texture);
14802 * sprite.mask = graphics;
14803 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
14804 *
14805 * @member {PIXI.Container|PIXI.MaskData|null}
14806 */
14807 mask: PIXI.Container | PIXI.MaskData | null;
14808 /**
14809 * DisplayObject default updateTransform, does not update children of container.
14810 * Will crash if there's no parent element.
14811 *
14812 * @memberof PIXI.DisplayObject#
14813 * @function displayObjectUpdateTransform
14814 */
14815 displayObjectUpdateTransform(): void;
14816 /**
14817 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
14818 * events will not be emitted unless `interactive` is set to `true`.
14819 *
14820 * @example
14821 * const sprite = new PIXI.Sprite(texture);
14822 * sprite.interactive = true;
14823 * sprite.on('tap', (event) => {
14824 * //handle event
14825 * });
14826 * @member {boolean}
14827 * @memberof PIXI.DisplayObject#
14828 */
14829 interactive: boolean;
14830 /**
14831 * Interaction shape. Children will be hit first, then this shape will be checked.
14832 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
14833 *
14834 * @example
14835 * const sprite = new PIXI.Sprite(texture);
14836 * sprite.interactive = true;
14837 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
14838 * @member {PIXI.IHitArea}
14839 * @memberof PIXI.DisplayObject#
14840 */
14841 hitArea: PIXI.IHitArea;
14842 /**
14843 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
14844 * Setting this changes the 'cursor' property to `'pointer'`.
14845 *
14846 * @example
14847 * const sprite = new PIXI.Sprite(texture);
14848 * sprite.interactive = true;
14849 * sprite.buttonMode = true;
14850 * @member {boolean}
14851 * @memberof PIXI.DisplayObject#
14852 */
14853 buttonMode: boolean;
14854 /**
14855 * This defines what cursor mode is used when the mouse cursor
14856 * is hovered over the displayObject.
14857 *
14858 * @example
14859 * const sprite = new PIXI.Sprite(texture);
14860 * sprite.interactive = true;
14861 * sprite.cursor = 'wait';
14862 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
14863 *
14864 * @member {string}
14865 * @memberof PIXI.DisplayObject#
14866 */
14867 cursor: string;
14868 /**
14869 * Set this to true if you want this display object to be cached as a bitmap.
14870 * This basically takes a snap shot of the display object as it is at that moment. It can
14871 * provide a performance benefit for complex static displayObjects.
14872 * To remove simply set this property to `false`
14873 *
14874 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
14875 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
14876 *
14877 * @member {boolean}
14878 * @memberof PIXI.DisplayObject#
14879 */
14880 cacheAsBitmap: boolean;
14881 /**
14882 * The instance name of the object.
14883 *
14884 * @memberof PIXI.DisplayObject#
14885 * @member {string} name
14886 */
14887 name: string;
14888 /**
14889 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
14890 *
14891 * @method getGlobalPosition
14892 * @memberof PIXI.DisplayObject#
14893 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
14894 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
14895 * being updated. This means the calculation returned MAY be out of date BUT will give you a
14896 * nice performance boost.
14897 * @return {PIXI.Point} The updated point.
14898 */
14899 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
14900 }
14901 /**
14902 * Class controls cache for UV mapping from Texture normal space to BaseTexture normal space.
14903 *
14904 * @class
14905 * @memberof PIXI
14906 */
14907 class MeshBatchUvs {
14908 constructor(uvBuffer: PIXI.Buffer, uvMatrix: PIXI.TextureMatrix);
14909 /**
14910 * Buffer with normalized UV's
14911 * @member {PIXI.Buffer} PIXI.MeshBatchUvs#uvBuffer
14912 */
14913 uvBuffer: PIXI.Buffer;
14914 /**
14915 * Material UV matrix
14916 * @member {PIXI.TextureMatrix} PIXI.MeshBatchUvs#uvMatrix
14917 */
14918 uvMatrix: PIXI.TextureMatrix;
14919 /**
14920 * UV Buffer data
14921 * @member {Float32Array} PIXI.MeshBatchUvs#data
14922 * @readonly
14923 */
14924 readonly data: Float32Array;
14925 /**
14926 * updates
14927 *
14928 * @param {boolean} [forceUpdate] - force the update
14929 */
14930 update(forceUpdate?: boolean): void;
14931 }
14932 /**
14933 * Standard 2D geometry used in PixiJS.
14934 *
14935 * Geometry can be defined without passing in a style or data if required.
14936 *
14937 * ```js
14938 * const geometry = new PIXI.Geometry();
14939 *
14940 * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);
14941 * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1], 2);
14942 * geometry.addIndex([0,1,2,1,3,2]);
14943 *
14944 * ```
14945 * @class
14946 * @memberof PIXI
14947 * @extends PIXI.Geometry
14948 */
14949 class MeshGeometry extends PIXI.Geometry {
14950 constructor(vertices?: Float32Array | number[], uvs?: Float32Array | number[], index?: Uint16Array | number[]);
14951 /**
14952 * A map of renderer IDs to webgl VAOs
14953 *
14954 * @protected
14955 * @type {object}
14956 */
14957 protected glVertexArrayObjects: any;
14958 /**
14959 * Number of instances in this geometry, pass it to `GeometrySystem.draw()`
14960 * @member {number} PIXI.Geometry#instanceCount
14961 * @default 1
14962 */
14963 instanceCount: number;
14964 /**
14965 * Count of existing (not destroyed) meshes that reference this geometry
14966 * @member {number} PIXI.Geometry#refCount
14967 */
14968 refCount: number;
14969 /**
14970 *
14971 * Adds an attribute to the geometry
14972 * Note: `stride` and `start` should be `undefined` if you dont know them, not 0!
14973 *
14974 * @param {String} id - the name of the attribute (matching up to a shader)
14975 * @param {PIXI.Buffer|number[]} [buffer] - the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
14976 * @param {Number} [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
14977 * @param {Boolean} [normalized=false] - should the data be normalized.
14978 * @param {Number} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {PIXI.TYPES} to see the ones available
14979 * @param {Number} [stride] - How far apart (in floats) the start of each value is. (used for interleaving data)
14980 * @param {Number} [start] - How far into the array to start reading values (used for interleaving data)
14981 * @param {boolean} [instance=false] - Instancing flag
14982 *
14983 * @return {PIXI.Geometry} returns self, useful for chaining.
14984 */
14985 addAttribute(id: string, buffer?: PIXI.Buffer | number[], size?: number, normalized?: boolean, type?: number, stride?: number, start?: number, instance?: boolean): PIXI.Geometry;
14986 /**
14987 * returns the requested attribute
14988 *
14989 * @param {String} id - the name of the attribute required
14990 * @return {PIXI.Attribute} the attribute requested.
14991 */
14992 getAttribute(id: string): PIXI.Attribute;
14993 /**
14994 * returns the requested buffer
14995 *
14996 * @param {String} id - the name of the buffer required
14997 * @return {PIXI.Buffer} the buffer requested.
14998 */
14999 getBuffer(id: string): PIXI.Buffer;
15000 /**
15001 *
15002 * Adds an index buffer to the geometry
15003 * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
15004 *
15005 * @param {PIXI.Buffer|number[]} [buffer] - the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
15006 * @return {PIXI.Geometry} returns self, useful for chaining.
15007 */
15008 addIndex(buffer?: PIXI.Buffer | number[]): PIXI.Geometry;
15009 /**
15010 * returns the index buffer
15011 *
15012 * @return {PIXI.Buffer} the index buffer.
15013 */
15014 getIndex(): PIXI.Buffer;
15015 /**
15016 * this function modifies the structure so that all current attributes become interleaved into a single buffer
15017 * This can be useful if your model remains static as it offers a little performance boost
15018 *
15019 * @return {PIXI.Geometry} returns self, useful for chaining.
15020 */
15021 interleave(): PIXI.Geometry;
15022 /**
15023 * disposes WebGL resources that are connected to this geometry
15024 */
15025 dispose(): void;
15026 /**
15027 * Destroys the geometry.
15028 */
15029 destroy(): void;
15030 /**
15031 * returns a clone of the geometry
15032 *
15033 * @returns {PIXI.Geometry} a new clone of this geometry
15034 */
15035 clone(): PIXI.Geometry;
15036 }
15037 /**
15038 * Slightly opinionated default shader for PixiJS 2D objects.
15039 * @class
15040 * @memberof PIXI
15041 * @extends PIXI.Shader
15042 */
15043 class MeshMaterial extends PIXI.Shader {
15044 constructor(uSampler: PIXI.Texture, options?: {
15045 alpha?: number;
15046 tint?: number;
15047 pluginName?: string;
15048 program?: PIXI.Program;
15049 uniforms?: any;
15050 });
15051 /**
15052 * Renders the mesh using the Canvas renderer
15053 *
15054 * @protected
15055 * @method render
15056 * @memberof PIXI.MeshMaterial#
15057 * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.
15058 * @param {PIXI.Mesh} mesh - Mesh to render.
15059 */
15060 protected render(renderer: PIXI.CanvasRenderer, mesh: PIXI.Mesh): void;
15061 /**
15062 * TextureMatrix instance for this Mesh, used to track Texture changes
15063 *
15064 * @member {PIXI.TextureMatrix} PIXI.MeshMaterial#uvMatrix
15065 * @readonly
15066 */
15067 readonly uvMatrix: PIXI.TextureMatrix;
15068 /**
15069 * `true` if shader can be batch with the renderer's batch system.
15070 * @member {boolean} PIXI.MeshMaterial#batchable
15071 * @default true
15072 */
15073 batchable: boolean;
15074 /**
15075 * Renderer plugin for batching
15076 *
15077 * @member {string} PIXI.MeshMaterial#pluginName
15078 * @default 'batch'
15079 */
15080 pluginName: string;
15081 /**
15082 * Reference to the texture being rendered.
15083 * @member {PIXI.Texture}
15084 */
15085 texture: PIXI.Texture;
15086 /**
15087 * This gets automatically set by the object using this.
15088 *
15089 * @default 1
15090 * @member {number}
15091 */
15092 alpha: number;
15093 /**
15094 * Multiply tint for the material.
15095 * @member {number}
15096 * @default 0xFFFFFF
15097 */
15098 tint: number;
15099 /**
15100 * Gets called automatically by the Mesh. Intended to be overridden for custom
15101 * MeshMaterial objects.
15102 */
15103 update(): void;
15104 /**
15105 * Program that the shader uses
15106 *
15107 * @member {PIXI.Program} PIXI.Shader#program
15108 */
15109 program: PIXI.Program;
15110 /**
15111 * Shader uniform values, shortcut for `uniformGroup.uniforms`
15112 * @readonly
15113 * @member {object}
15114 */
15115 readonly uniforms: any;
15116 }
15117 /**
15118 * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful
15119 * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically
15120 *
15121 *```js
15122 * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.from('BoxWithRoundedCorners.png'), 15, 15, 15, 15);
15123 * ```
15124 * <pre>
15125 * A B
15126 * +---+----------------------+---+
15127 * C | 1 | 2 | 3 |
15128 * +---+----------------------+---+
15129 * | | | |
15130 * | 4 | 5 | 6 |
15131 * | | | |
15132 * +---+----------------------+---+
15133 * D | 7 | 8 | 9 |
15134 * +---+----------------------+---+
15135
15136 * When changing this objects width and/or height:
15137 * areas 1 3 7 and 9 will remain unscaled.
15138 * areas 2 and 8 will be stretched horizontally
15139 * areas 4 and 6 will be stretched vertically
15140 * area 5 will be stretched both horizontally and vertically
15141 * </pre>
15142 *
15143 * @class
15144 * @extends PIXI.SimplePlane
15145 * @memberof PIXI
15146 *
15147 */
15148 class NineSlicePlane extends PIXI.SimplePlane {
15149 constructor(texture: PIXI.Texture, leftWidth?: number, topHeight?: number, rightWidth?: number, bottomHeight?: number);
15150 /**
15151 * Cached tint value so we can tell when the tint is changed.
15152 * @memberof PIXI.NineSlicePlane#
15153 * @member {number} _cachedTint
15154 * @protected
15155 */
15156 protected _cachedTint: number;
15157 /**
15158 * Cached tinted texture.
15159 * @memberof PIXI.NineSlicePlane#
15160 * @member {HTMLCanvasElement} _tintedCanvas
15161 * @protected
15162 */
15163 protected _tintedCanvas: HTMLCanvasElement;
15164 /**
15165 * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane
15166 *
15167 * @member {number} PIXI.NineSlicePlane#_width
15168 * @override
15169 */
15170 _width: number;
15171 /**
15172 * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane
15173 *
15174 * @member {number} PIXI.NineSlicePlane#_height
15175 * @override
15176 */
15177 _height: number;
15178 /**
15179 * Updates the horizontal vertices.
15180 *
15181 */
15182 updateHorizontalVertices(): void;
15183 /**
15184 * Updates the vertical vertices.
15185 *
15186 */
15187 updateVerticalVertices(): void;
15188 /**
15189 * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane
15190 *
15191 * @member {number}
15192 */
15193 width: number;
15194 /**
15195 * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane
15196 *
15197 * @member {number}
15198 */
15199 height: number;
15200 /**
15201 * The width of the left column
15202 *
15203 * @member {number}
15204 */
15205 leftWidth: number;
15206 /**
15207 * The width of the right column
15208 *
15209 * @member {number}
15210 */
15211 rightWidth: number;
15212 /**
15213 * The height of the top row
15214 *
15215 * @member {number}
15216 */
15217 topHeight: number;
15218 /**
15219 * The height of the bottom row
15220 *
15221 * @member {number}
15222 */
15223 bottomHeight: number;
15224 /**
15225 * Refreshes NineSlicePlane coords. All of them.
15226 */
15227 _refresh(): void;
15228 /**
15229 * Method used for overrides, to do something in case texture frame was changed.
15230 * Meshes based on plane can override it and change more details based on texture.
15231 */
15232 textureUpdated(): void;
15233 /**
15234 * Includes vertex positions, face indices, normals, colors, UVs, and
15235 * custom attributes within buffers, reducing the cost of passing all
15236 * this data to the GPU. Can be shared between multiple Mesh objects.
15237 * @member {PIXI.Geometry} PIXI.Mesh#geometry
15238 * @readonly
15239 */
15240 readonly geometry: PIXI.Geometry;
15241 /**
15242 * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
15243 * Can be shared between multiple Mesh objects.
15244 * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader
15245 */
15246 shader: PIXI.Shader | PIXI.MeshMaterial;
15247 /**
15248 * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g.,
15249 * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
15250 * @member {PIXI.State} PIXI.Mesh#state
15251 */
15252 state: PIXI.State;
15253 /**
15254 * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants.
15255 *
15256 * @member {number} PIXI.Mesh#drawMode
15257 * @see PIXI.DRAW_MODES
15258 */
15259 drawMode: number;
15260 /**
15261 * Typically the index of the IndexBuffer where to start drawing.
15262 * @member {number} PIXI.Mesh#start
15263 * @default 0
15264 */
15265 start: number;
15266 /**
15267 * How much of the geometry to draw, by default `0` renders everything.
15268 * @member {number} PIXI.Mesh#size
15269 * @default 0
15270 */
15271 size: number;
15272 /**
15273 * To change mesh uv's, change its uvBuffer data and increment its _updateID.
15274 * @member {PIXI.Buffer}
15275 * @readonly
15276 */
15277 readonly uvBuffer: PIXI.Buffer;
15278 /**
15279 * To change mesh vertices, change its uvBuffer data and increment its _updateID.
15280 * Incrementing _updateID is optional because most of Mesh objects do it anyway.
15281 * @member {PIXI.Buffer}
15282 * @readonly
15283 */
15284 readonly verticesBuffer: PIXI.Buffer;
15285 /**
15286 * Alias for {@link PIXI.Mesh#shader}.
15287 * @member {PIXI.MeshMaterial}
15288 */
15289 material: PIXI.MeshMaterial;
15290 /**
15291 * The blend mode to be applied to the Mesh. Apply a value of
15292 * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
15293 *
15294 * @member {number}
15295 * @default PIXI.BLEND_MODES.NORMAL;
15296 * @see PIXI.BLEND_MODES
15297 */
15298 blendMode: number;
15299 /**
15300 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
15301 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
15302 * The main disadvantage is movement of objects may appear less smooth.
15303 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
15304 *
15305 * @member {boolean}
15306 * @default false
15307 */
15308 roundPixels: boolean;
15309 /**
15310 * The multiply tint applied to the Mesh. This is a hex value. A value of
15311 * `0xFFFFFF` will remove any tint effect.
15312 *
15313 * @member {number}
15314 * @default 0xFFFFFF
15315 */
15316 tint: number;
15317 /**
15318 * The texture that the Mesh uses.
15319 *
15320 * @member {PIXI.Texture}
15321 */
15322 texture: PIXI.Texture;
15323 /**
15324 * Standard renderer draw.
15325 * @protected
15326 * @param {PIXI.Renderer} renderer - Instance to renderer.
15327 */
15328 protected _render(renderer: PIXI.Renderer): void;
15329 /**
15330 * Standard non-batching way of rendering.
15331 * @protected
15332 * @param {PIXI.Renderer} renderer - Instance to renderer.
15333 */
15334 protected _renderDefault(renderer: PIXI.Renderer): void;
15335 /**
15336 * Rendering by using the Batch system.
15337 * @protected
15338 * @param {PIXI.Renderer} renderer - Instance to renderer.
15339 */
15340 protected _renderToBatch(renderer: PIXI.Renderer): void;
15341 /**
15342 * Updates vertexData field based on transform and vertices
15343 */
15344 calculateVertices(): void;
15345 /**
15346 * Updates uv field based on from geometry uv's or batchUvs
15347 */
15348 calculateUvs(): void;
15349 /**
15350 * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.
15351 * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.
15352 *
15353 * @protected
15354 */
15355 protected _calculateBounds(): void;
15356 /**
15357 * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.
15358 *
15359 * @param {PIXI.IPointData} point - the point to test
15360 * @return {boolean} the result of the test
15361 */
15362 containsPoint(point: PIXI.IPointData): boolean;
15363 /**
15364 * Destroys the Mesh object.
15365 *
15366 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
15367 * options have been set to that value
15368 * @param {boolean} [options.children=false] - if set to true, all the children will have
15369 * their destroy method called as well. 'options' will be passed on to those calls.
15370 */
15371 destroy(options?: {
15372 children?: boolean;
15373 }): void;
15374 /**
15375 * Renders the object using the Canvas renderer
15376 * @method renderCanvas
15377 * @memberof PIXI.Container#
15378 * @param {PIXI.CanvasRenderer} renderer - The renderer
15379 */
15380 renderCanvas(renderer: PIXI.CanvasRenderer): void;
15381 /**
15382 * The array of children of this container.
15383 *
15384 * @member {PIXI.DisplayObject[]} PIXI.Container#children
15385 * @readonly
15386 */
15387 readonly children: PIXI.DisplayObject[];
15388 /**
15389 * If set to true, the container will sort its children by zIndex value
15390 * when updateTransform() is called, or manually if sortChildren() is called.
15391 *
15392 * This actually changes the order of elements in the array, so should be treated
15393 * as a basic solution that is not performant compared to other solutions,
15394 * such as @link https://github.com/pixijs/pixi-display
15395 *
15396 * Also be aware of that this may not work nicely with the addChildAt() function,
15397 * as the zIndex sorting may cause the child to automatically sorted to another position.
15398 *
15399 * @see PIXI.settings.SORTABLE_CHILDREN
15400 *
15401 * @member {boolean} PIXI.Container#sortableChildren
15402 */
15403 sortableChildren: boolean;
15404 /**
15405 * Should children be sorted by zIndex at the next updateTransform call.
15406 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
15407 *
15408 * @member {boolean} PIXI.Container#sortDirty
15409 */
15410 sortDirty: boolean;
15411 /**
15412 * Overridable method that can be used by Container subclasses whenever the children array is modified
15413 *
15414 * @protected
15415 */
15416 protected onChildrenChange(): void;
15417 /**
15418 * Adds one or more children to the container.
15419 *
15420 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
15421 *
15422 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
15423 * @return {PIXI.DisplayObject} The first child that was added.
15424 */
15425 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
15426 /**
15427 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
15428 *
15429 * @param {PIXI.DisplayObject} child - The child to add
15430 * @param {number} index - The index to place the child in
15431 * @return {PIXI.DisplayObject} The child that was added.
15432 */
15433 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
15434 /**
15435 * Swaps the position of 2 Display Objects within this container.
15436 *
15437 * @param {PIXI.DisplayObject} child - First display object to swap
15438 * @param {PIXI.DisplayObject} child2 - Second display object to swap
15439 */
15440 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
15441 /**
15442 * Returns the index position of a child DisplayObject instance
15443 *
15444 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
15445 * @return {number} The index position of the child display object to identify
15446 */
15447 getChildIndex(child: PIXI.DisplayObject): number;
15448 /**
15449 * Changes the position of an existing child in the display object container
15450 *
15451 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
15452 * @param {number} index - The resulting index number for the child display object
15453 */
15454 setChildIndex(child: PIXI.DisplayObject, index: number): void;
15455 /**
15456 * Returns the child at the specified index
15457 *
15458 * @param {number} index - The index to get the child at
15459 * @return {PIXI.DisplayObject} The child at the given index, if any.
15460 */
15461 getChildAt(index: number): PIXI.DisplayObject;
15462 /**
15463 * Removes one or more children from the container.
15464 *
15465 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
15466 * @return {PIXI.DisplayObject} The first child that was removed.
15467 */
15468 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
15469 /**
15470 * Removes a child from the specified index position.
15471 *
15472 * @param {number} index - The index to get the child from
15473 * @return {PIXI.DisplayObject} The child that was removed.
15474 */
15475 removeChildAt(index: number): PIXI.DisplayObject;
15476 /**
15477 * Removes all children from this container that are within the begin and end indexes.
15478 *
15479 * @param {number} [beginIndex=0] - The beginning position.
15480 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
15481 * @returns {PIXI.DisplayObject[]} List of removed children
15482 */
15483 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
15484 /**
15485 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
15486 */
15487 sortChildren(): void;
15488 /**
15489 * Updates the transform on all children of this container for rendering
15490 */
15491 updateTransform(): void;
15492 /**
15493 * Recalculates the bounds of the container.
15494 *
15495 */
15496 calculateBounds(): void;
15497 /**
15498 * Retrieves the local bounds of the displayObject as a rectangle object.
15499 *
15500 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
15501 * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,
15502 * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
15503 * @return {PIXI.Rectangle} The rectangular bounding area.
15504 */
15505 getLocalBounds(rect?: PIXI.Rectangle, skipChildrenUpdate?: boolean): PIXI.Rectangle;
15506 /**
15507 * Renders the object using the WebGL renderer
15508 *
15509 * @param {PIXI.Renderer} renderer - The renderer
15510 */
15511 render(renderer: PIXI.Renderer): void;
15512 /**
15513 * Render the object using the WebGL renderer and advanced features.
15514 *
15515 * @protected
15516 * @param {PIXI.Renderer} renderer - The renderer
15517 */
15518 protected renderAdvanced(renderer: PIXI.Renderer): void;
15519 /**
15520 * Container default updateTransform, does update children of container.
15521 * Will crash if there's no parent element.
15522 *
15523 * @memberof PIXI.Container#
15524 * @function containerUpdateTransform
15525 */
15526 containerUpdateTransform(): void;
15527 /**
15528 * Determines if the children to the displayObject can be clicked/touched
15529 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
15530 *
15531 * @member {boolean}
15532 * @memberof PIXI.Container#
15533 */
15534 interactiveChildren: boolean;
15535 /**
15536 * Returns the display object in the container.
15537 *
15538 * Recursive searches are done in a preorder traversal.
15539 *
15540 * @method getChildByName
15541 * @memberof PIXI.Container#
15542 * @param {string} name - Instance name.
15543 * @param {boolean}[deep=false] - Whether to search recursively
15544 * @return {PIXI.DisplayObject} The child with the specified name.
15545 */
15546 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
15547 /**
15548 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
15549 * shadow div with attributes set
15550 *
15551 * @member {boolean}
15552 * @memberof PIXI.DisplayObject#
15553 */
15554 accessible: boolean;
15555 /**
15556 * Sets the title attribute of the shadow div
15557 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
15558 *
15559 * @member {?string}
15560 * @memberof PIXI.DisplayObject#
15561 */
15562 accessibleTitle: string;
15563 /**
15564 * Sets the aria-label attribute of the shadow div
15565 *
15566 * @member {string}
15567 * @memberof PIXI.DisplayObject#
15568 */
15569 accessibleHint: string;
15570 /**
15571 * @member {boolean}
15572 * @memberof PIXI.DisplayObject#
15573 * @todo Needs docs.
15574 */
15575 _accessibleActive: boolean;
15576 /**
15577 * @member {boolean}
15578 * @memberof PIXI.DisplayObject#
15579 * @todo Needs docs.
15580 */
15581 _accessibleDiv: boolean;
15582 /**
15583 * Specify the type of div the accessible layer is. Screen readers treat the element differently
15584 * depending on this type. Defaults to button.
15585 *
15586 * @member {string}
15587 * @memberof PIXI.DisplayObject#
15588 * @default 'button'
15589 */
15590 accessibleType: string;
15591 /**
15592 * Specify the pointer-events the accessible div will use
15593 * Defaults to auto.
15594 *
15595 * @member {string}
15596 * @memberof PIXI.DisplayObject#
15597 * @default 'auto'
15598 */
15599 accessiblePointerEvents: string;
15600 /**
15601 * Setting to false will prevent any children inside this container to
15602 * be accessible. Defaults to true.
15603 *
15604 * @member {boolean}
15605 * @memberof PIXI.DisplayObject#
15606 * @default true
15607 */
15608 accessibleChildren: boolean;
15609 /**
15610 * World transform and local transform of this object.
15611 * This will become read-only later, please do not assign anything there unless you know what are you doing.
15612 *
15613 * @member {PIXI.Transform} PIXI.DisplayObject#transform
15614 */
15615 transform: PIXI.Transform;
15616 /**
15617 * The opacity of the object.
15618 *
15619 * @member {number} PIXI.DisplayObject#alpha
15620 */
15621 alpha: number;
15622 /**
15623 * The visibility of the object. If false the object will not be drawn, and
15624 * the updateTransform function will not be called.
15625 *
15626 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
15627 *
15628 * @member {boolean} PIXI.DisplayObject#visible
15629 */
15630 visible: boolean;
15631 /**
15632 * Can this object be rendered, if false the object will not be drawn but the updateTransform
15633 * methods will still be called.
15634 *
15635 * Only affects recursive calls from parent. You can ask for bounds manually.
15636 *
15637 * @member {boolean} PIXI.DisplayObject#renderable
15638 */
15639 renderable: boolean;
15640 /**
15641 * The display object container that contains this display object.
15642 *
15643 * @member {PIXI.Container} PIXI.DisplayObject#parent
15644 */
15645 parent: PIXI.Container;
15646 /**
15647 * The multiplied alpha of the displayObject.
15648 *
15649 * @member {number} PIXI.DisplayObject#worldAlpha
15650 * @readonly
15651 */
15652 readonly worldAlpha: number;
15653 /**
15654 * Which index in the children array the display component was before the previous zIndex sort.
15655 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
15656 *
15657 * @member {number} PIXI.DisplayObject#_lastSortedIndex
15658 * @protected
15659 */
15660 protected _lastSortedIndex: number;
15661 /**
15662 * The zIndex of the displayObject.
15663 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
15664 *
15665 * @member {number} PIXI.DisplayObject#_zIndex
15666 * @protected
15667 */
15668 protected _zIndex: number;
15669 /**
15670 * The area the filter is applied to. This is used as more of an optimization
15671 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
15672 *
15673 * Also works as an interaction mask.
15674 *
15675 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
15676 */
15677 filterArea: PIXI.Rectangle;
15678 /**
15679 * Sets the filters for the displayObject.
15680 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
15681 * To remove filters simply set this property to `'null'`.
15682 *
15683 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
15684 */
15685 filters: PIXI.Filter[];
15686 /**
15687 * Currently enabled filters
15688 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
15689 * @protected
15690 */
15691 protected _enabledFilters: PIXI.Filter[];
15692 /**
15693 * The bounds object, this is used to calculate and store the bounds of the displayObject.
15694 *
15695 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
15696 */
15697 _bounds: PIXI.Bounds;
15698 /**
15699 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
15700 *
15701 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
15702 */
15703 _localBounds: PIXI.Bounds;
15704 /**
15705 * Flags the cached bounds as dirty.
15706 *
15707 * @member {number} PIXI.DisplayObject#_boundsID
15708 * @protected
15709 */
15710 protected _boundsID: number;
15711 /**
15712 * Cache of this display-object's bounds-rectangle.
15713 *
15714 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
15715 * @protected
15716 */
15717 protected _boundsRect: PIXI.Bounds;
15718 /**
15719 * Cache of this display-object's local-bounds rectangle.
15720 *
15721 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
15722 * @protected
15723 */
15724 protected _localBoundsRect: PIXI.Bounds;
15725 /**
15726 * The original, cached mask of the object.
15727 *
15728 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
15729 * @protected
15730 */
15731 protected _mask: PIXI.Container | PIXI.MaskData | null;
15732 /**
15733 * If the object has been destroyed via destroy(). If true, it should not be used.
15734 *
15735 * @member {boolean} PIXI.DisplayObject#_destroyed
15736 * @protected
15737 */
15738 protected _destroyed: boolean;
15739 /**
15740 * used to fast check if a sprite is.. a sprite!
15741 * @member {boolean} PIXI.DisplayObject#isSprite
15742 */
15743 isSprite: boolean;
15744 /**
15745 * Does any other displayObject use this object as a mask?
15746 * @member {boolean} PIXI.DisplayObject#isMask
15747 */
15748 isMask: boolean;
15749 /**
15750 * Recursively updates transform of all objects from the root to this one
15751 * internal function for toLocal()
15752 */
15753 _recursivePostUpdateTransform(): void;
15754 /**
15755 * Retrieves the bounds of the displayObject as a rectangle object.
15756 *
15757 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
15758 * being updated. This means the calculation returned MAY be out of date BUT will give you a
15759 * nice performance boost.
15760 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
15761 * @return {PIXI.Rectangle} The rectangular bounding area.
15762 */
15763 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
15764 /**
15765 * Calculates the global position of the display object.
15766 *
15767 * @param {PIXI.IPointData} position - The world origin to calculate from.
15768 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
15769 * (otherwise will create a new Point).
15770 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
15771 * @return {PIXI.Point} A point object representing the position of this object.
15772 */
15773 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
15774 /**
15775 * Calculates the local position of the display object relative to another point.
15776 *
15777 * @param {PIXI.IPointData} position - The world origin to calculate from.
15778 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
15779 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
15780 * (otherwise will create a new Point).
15781 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
15782 * @return {PIXI.Point} A point object representing the position of this object
15783 */
15784 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
15785 /**
15786 * Set the parent Container of this DisplayObject.
15787 *
15788 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
15789 * @return {PIXI.Container} The Container that this DisplayObject was added to.
15790 */
15791 setParent(container: PIXI.Container): PIXI.Container;
15792 /**
15793 * Convenience function to set the position, scale, skew and pivot at once.
15794 *
15795 * @param {number} [x=0] - The X position
15796 * @param {number} [y=0] - The Y position
15797 * @param {number} [scaleX=1] - The X scale value
15798 * @param {number} [scaleY=1] - The Y scale value
15799 * @param {number} [rotation=0] - The rotation
15800 * @param {number} [skewX=0] - The X skew value
15801 * @param {number} [skewY=0] - The Y skew value
15802 * @param {number} [pivotX=0] - The X pivot value
15803 * @param {number} [pivotY=0] - The Y pivot value
15804 * @return {PIXI.DisplayObject} The DisplayObject instance
15805 */
15806 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
15807 /**
15808 * @protected
15809 * @member {PIXI.Container}
15810 */
15811 protected _tempDisplayObjectParent: PIXI.Container;
15812 /**
15813 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
15814 *
15815 * ```
15816 * const cacheParent = elem.enableTempParent();
15817 * elem.updateTransform();
15818 * elem.disableTempParent(cacheParent);
15819 * ```
15820 *
15821 * @returns {PIXI.DisplayObject} current parent
15822 */
15823 enableTempParent(): PIXI.DisplayObject;
15824 /**
15825 * Pair method for `enableTempParent`
15826 * @param {PIXI.DisplayObject} cacheParent actual parent of element
15827 */
15828 disableTempParent(cacheParent: PIXI.DisplayObject): void;
15829 /**
15830 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
15831 * An alias to position.x
15832 *
15833 * @member {number}
15834 */
15835 x: number;
15836 /**
15837 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
15838 * An alias to position.y
15839 *
15840 * @member {number}
15841 */
15842 y: number;
15843 /**
15844 * Current transform of the object based on world (parent) factors.
15845 *
15846 * @member {PIXI.Matrix}
15847 * @readonly
15848 */
15849 readonly worldTransform: PIXI.Matrix;
15850 /**
15851 * Current transform of the object based on local factors: position, scale, other stuff.
15852 *
15853 * @member {PIXI.Matrix}
15854 * @readonly
15855 */
15856 readonly localTransform: PIXI.Matrix;
15857 /**
15858 * The coordinate of the object relative to the local coordinates of the parent.
15859 * Assignment by value since pixi-v4.
15860 *
15861 * @member {PIXI.ObservablePoint}
15862 */
15863 position: PIXI.ObservablePoint;
15864 /**
15865 * The scale factor of the object.
15866 * Assignment by value since pixi-v4.
15867 *
15868 * @member {PIXI.ObservablePoint}
15869 */
15870 scale: PIXI.ObservablePoint;
15871 /**
15872 * The pivot point of the displayObject that it rotates around.
15873 * Assignment by value since pixi-v4.
15874 *
15875 * @member {PIXI.ObservablePoint}
15876 */
15877 pivot: PIXI.ObservablePoint;
15878 /**
15879 * The skew factor for the object in radians.
15880 * Assignment by value since pixi-v4.
15881 *
15882 * @member {PIXI.ObservablePoint}
15883 */
15884 skew: PIXI.ObservablePoint;
15885 /**
15886 * The rotation of the object in radians.
15887 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
15888 *
15889 * @member {number}
15890 */
15891 rotation: number;
15892 /**
15893 * The angle of the object in degrees.
15894 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
15895 *
15896 * @member {number}
15897 */
15898 angle: number;
15899 /**
15900 * The zIndex of the displayObject.
15901 * If a container has the sortableChildren property set to true, children will be automatically
15902 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
15903 * and thus rendered on top of other displayObjects within the same container.
15904 *
15905 * @member {number}
15906 */
15907 zIndex: number;
15908 /**
15909 * Indicates if the object is globally visible.
15910 *
15911 * @member {boolean}
15912 * @readonly
15913 */
15914 readonly worldVisible: boolean;
15915 /**
15916 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
15917 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
15918 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
15919 * utilities shape clipping. To remove a mask, set this property to `null`.
15920 *
15921 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
15922 * @example
15923 * const graphics = new PIXI.Graphics();
15924 * graphics.beginFill(0xFF3300);
15925 * graphics.drawRect(50, 250, 100, 100);
15926 * graphics.endFill();
15927 *
15928 * const sprite = new PIXI.Sprite(texture);
15929 * sprite.mask = graphics;
15930 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
15931 *
15932 * @member {PIXI.Container|PIXI.MaskData|null}
15933 */
15934 mask: PIXI.Container | PIXI.MaskData | null;
15935 /**
15936 * DisplayObject default updateTransform, does not update children of container.
15937 * Will crash if there's no parent element.
15938 *
15939 * @memberof PIXI.DisplayObject#
15940 * @function displayObjectUpdateTransform
15941 */
15942 displayObjectUpdateTransform(): void;
15943 /**
15944 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
15945 * events will not be emitted unless `interactive` is set to `true`.
15946 *
15947 * @example
15948 * const sprite = new PIXI.Sprite(texture);
15949 * sprite.interactive = true;
15950 * sprite.on('tap', (event) => {
15951 * //handle event
15952 * });
15953 * @member {boolean}
15954 * @memberof PIXI.DisplayObject#
15955 */
15956 interactive: boolean;
15957 /**
15958 * Interaction shape. Children will be hit first, then this shape will be checked.
15959 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
15960 *
15961 * @example
15962 * const sprite = new PIXI.Sprite(texture);
15963 * sprite.interactive = true;
15964 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
15965 * @member {PIXI.IHitArea}
15966 * @memberof PIXI.DisplayObject#
15967 */
15968 hitArea: PIXI.IHitArea;
15969 /**
15970 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
15971 * Setting this changes the 'cursor' property to `'pointer'`.
15972 *
15973 * @example
15974 * const sprite = new PIXI.Sprite(texture);
15975 * sprite.interactive = true;
15976 * sprite.buttonMode = true;
15977 * @member {boolean}
15978 * @memberof PIXI.DisplayObject#
15979 */
15980 buttonMode: boolean;
15981 /**
15982 * This defines what cursor mode is used when the mouse cursor
15983 * is hovered over the displayObject.
15984 *
15985 * @example
15986 * const sprite = new PIXI.Sprite(texture);
15987 * sprite.interactive = true;
15988 * sprite.cursor = 'wait';
15989 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
15990 *
15991 * @member {string}
15992 * @memberof PIXI.DisplayObject#
15993 */
15994 cursor: string;
15995 /**
15996 * Set this to true if you want this display object to be cached as a bitmap.
15997 * This basically takes a snap shot of the display object as it is at that moment. It can
15998 * provide a performance benefit for complex static displayObjects.
15999 * To remove simply set this property to `false`
16000 *
16001 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
16002 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
16003 *
16004 * @member {boolean}
16005 * @memberof PIXI.DisplayObject#
16006 */
16007 cacheAsBitmap: boolean;
16008 /**
16009 * The instance name of the object.
16010 *
16011 * @memberof PIXI.DisplayObject#
16012 * @member {string} name
16013 */
16014 name: string;
16015 /**
16016 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
16017 *
16018 * @method getGlobalPosition
16019 * @memberof PIXI.DisplayObject#
16020 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
16021 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
16022 * being updated. This means the calculation returned MAY be out of date BUT will give you a
16023 * nice performance boost.
16024 * @return {PIXI.Point} The updated point.
16025 */
16026 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
16027 }
16028 /**
16029 * The Simple Mesh class mimics Mesh in PixiJS v4, providing easy-to-use constructor arguments.
16030 * For more robust customization, use {@link PIXI.Mesh}.
16031 *
16032 * @class
16033 * @extends PIXI.Mesh
16034 * @memberof PIXI
16035 */
16036 class SimpleMesh extends PIXI.Mesh {
16037 constructor(texture?: PIXI.Texture, vertices?: Float32Array, uvs?: Float32Array, indices?: Uint16Array, drawMode?: number);
16038 /**
16039 * Triangles in canvas mode are automatically antialiased, use this value to force triangles
16040 * to overlap a bit with each other. To set the global default, set {@link PIXI.settings.MESH_CANVAS_PADDING}
16041 *
16042 * @see PIXI.settings.MESH_CANVAS_PADDING
16043 * @member {number} canvasPadding
16044 * @memberof PIXI.SimpleMesh#
16045 * @default 0
16046 */
16047 canvasPadding: number;
16048 /**
16049 * upload vertices buffer each frame
16050 * @member {boolean} PIXI.SimpleMesh#autoUpdate
16051 */
16052 autoUpdate: boolean;
16053 /**
16054 * Collection of vertices data.
16055 * @member {Float32Array}
16056 */
16057 vertices: Float32Array;
16058 /**
16059 * Cached tint value so we can tell when the tint is changed.
16060 * @memberof PIXI.Mesh#
16061 * @member {number} _cachedTint
16062 * @protected
16063 */
16064 protected _cachedTint: number;
16065 /**
16066 * Cached tinted texture.
16067 * @memberof PIXI.Mesh#
16068 * @member {HTMLCanvasElement} _tintedCanvas
16069 * @protected
16070 */
16071 protected _tintedCanvas: HTMLCanvasElement;
16072 /**
16073 * Includes vertex positions, face indices, normals, colors, UVs, and
16074 * custom attributes within buffers, reducing the cost of passing all
16075 * this data to the GPU. Can be shared between multiple Mesh objects.
16076 * @member {PIXI.Geometry} PIXI.Mesh#geometry
16077 * @readonly
16078 */
16079 readonly geometry: PIXI.Geometry;
16080 /**
16081 * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
16082 * Can be shared between multiple Mesh objects.
16083 * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader
16084 */
16085 shader: PIXI.Shader | PIXI.MeshMaterial;
16086 /**
16087 * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g.,
16088 * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
16089 * @member {PIXI.State} PIXI.Mesh#state
16090 */
16091 state: PIXI.State;
16092 /**
16093 * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants.
16094 *
16095 * @member {number} PIXI.Mesh#drawMode
16096 * @see PIXI.DRAW_MODES
16097 */
16098 drawMode: number;
16099 /**
16100 * Typically the index of the IndexBuffer where to start drawing.
16101 * @member {number} PIXI.Mesh#start
16102 * @default 0
16103 */
16104 start: number;
16105 /**
16106 * How much of the geometry to draw, by default `0` renders everything.
16107 * @member {number} PIXI.Mesh#size
16108 * @default 0
16109 */
16110 size: number;
16111 /**
16112 * To change mesh uv's, change its uvBuffer data and increment its _updateID.
16113 * @member {PIXI.Buffer}
16114 * @readonly
16115 */
16116 readonly uvBuffer: PIXI.Buffer;
16117 /**
16118 * To change mesh vertices, change its uvBuffer data and increment its _updateID.
16119 * Incrementing _updateID is optional because most of Mesh objects do it anyway.
16120 * @member {PIXI.Buffer}
16121 * @readonly
16122 */
16123 readonly verticesBuffer: PIXI.Buffer;
16124 /**
16125 * Alias for {@link PIXI.Mesh#shader}.
16126 * @member {PIXI.MeshMaterial}
16127 */
16128 material: PIXI.MeshMaterial;
16129 /**
16130 * The blend mode to be applied to the Mesh. Apply a value of
16131 * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
16132 *
16133 * @member {number}
16134 * @default PIXI.BLEND_MODES.NORMAL;
16135 * @see PIXI.BLEND_MODES
16136 */
16137 blendMode: number;
16138 /**
16139 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
16140 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
16141 * The main disadvantage is movement of objects may appear less smooth.
16142 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
16143 *
16144 * @member {boolean}
16145 * @default false
16146 */
16147 roundPixels: boolean;
16148 /**
16149 * The multiply tint applied to the Mesh. This is a hex value. A value of
16150 * `0xFFFFFF` will remove any tint effect.
16151 *
16152 * @member {number}
16153 * @default 0xFFFFFF
16154 */
16155 tint: number;
16156 /**
16157 * The texture that the Mesh uses.
16158 *
16159 * @member {PIXI.Texture}
16160 */
16161 texture: PIXI.Texture;
16162 /**
16163 * Standard renderer draw.
16164 * @protected
16165 * @param {PIXI.Renderer} renderer - Instance to renderer.
16166 */
16167 protected _render(renderer: PIXI.Renderer): void;
16168 /**
16169 * Standard non-batching way of rendering.
16170 * @protected
16171 * @param {PIXI.Renderer} renderer - Instance to renderer.
16172 */
16173 protected _renderDefault(renderer: PIXI.Renderer): void;
16174 /**
16175 * Rendering by using the Batch system.
16176 * @protected
16177 * @param {PIXI.Renderer} renderer - Instance to renderer.
16178 */
16179 protected _renderToBatch(renderer: PIXI.Renderer): void;
16180 /**
16181 * Updates vertexData field based on transform and vertices
16182 */
16183 calculateVertices(): void;
16184 /**
16185 * Updates uv field based on from geometry uv's or batchUvs
16186 */
16187 calculateUvs(): void;
16188 /**
16189 * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.
16190 * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.
16191 *
16192 * @protected
16193 */
16194 protected _calculateBounds(): void;
16195 /**
16196 * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.
16197 *
16198 * @param {PIXI.IPointData} point - the point to test
16199 * @return {boolean} the result of the test
16200 */
16201 containsPoint(point: PIXI.IPointData): boolean;
16202 /**
16203 * Destroys the Mesh object.
16204 *
16205 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
16206 * options have been set to that value
16207 * @param {boolean} [options.children=false] - if set to true, all the children will have
16208 * their destroy method called as well. 'options' will be passed on to those calls.
16209 */
16210 destroy(options?: {
16211 children?: boolean;
16212 }): void;
16213 /**
16214 * Renders the object using the Canvas renderer
16215 * @method renderCanvas
16216 * @memberof PIXI.Container#
16217 * @param {PIXI.CanvasRenderer} renderer - The renderer
16218 */
16219 renderCanvas(renderer: PIXI.CanvasRenderer): void;
16220 /**
16221 * The array of children of this container.
16222 *
16223 * @member {PIXI.DisplayObject[]} PIXI.Container#children
16224 * @readonly
16225 */
16226 readonly children: PIXI.DisplayObject[];
16227 /**
16228 * If set to true, the container will sort its children by zIndex value
16229 * when updateTransform() is called, or manually if sortChildren() is called.
16230 *
16231 * This actually changes the order of elements in the array, so should be treated
16232 * as a basic solution that is not performant compared to other solutions,
16233 * such as @link https://github.com/pixijs/pixi-display
16234 *
16235 * Also be aware of that this may not work nicely with the addChildAt() function,
16236 * as the zIndex sorting may cause the child to automatically sorted to another position.
16237 *
16238 * @see PIXI.settings.SORTABLE_CHILDREN
16239 *
16240 * @member {boolean} PIXI.Container#sortableChildren
16241 */
16242 sortableChildren: boolean;
16243 /**
16244 * Should children be sorted by zIndex at the next updateTransform call.
16245 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
16246 *
16247 * @member {boolean} PIXI.Container#sortDirty
16248 */
16249 sortDirty: boolean;
16250 /**
16251 * Overridable method that can be used by Container subclasses whenever the children array is modified
16252 *
16253 * @protected
16254 */
16255 protected onChildrenChange(): void;
16256 /**
16257 * Adds one or more children to the container.
16258 *
16259 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
16260 *
16261 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
16262 * @return {PIXI.DisplayObject} The first child that was added.
16263 */
16264 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
16265 /**
16266 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
16267 *
16268 * @param {PIXI.DisplayObject} child - The child to add
16269 * @param {number} index - The index to place the child in
16270 * @return {PIXI.DisplayObject} The child that was added.
16271 */
16272 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
16273 /**
16274 * Swaps the position of 2 Display Objects within this container.
16275 *
16276 * @param {PIXI.DisplayObject} child - First display object to swap
16277 * @param {PIXI.DisplayObject} child2 - Second display object to swap
16278 */
16279 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
16280 /**
16281 * Returns the index position of a child DisplayObject instance
16282 *
16283 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
16284 * @return {number} The index position of the child display object to identify
16285 */
16286 getChildIndex(child: PIXI.DisplayObject): number;
16287 /**
16288 * Changes the position of an existing child in the display object container
16289 *
16290 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
16291 * @param {number} index - The resulting index number for the child display object
16292 */
16293 setChildIndex(child: PIXI.DisplayObject, index: number): void;
16294 /**
16295 * Returns the child at the specified index
16296 *
16297 * @param {number} index - The index to get the child at
16298 * @return {PIXI.DisplayObject} The child at the given index, if any.
16299 */
16300 getChildAt(index: number): PIXI.DisplayObject;
16301 /**
16302 * Removes one or more children from the container.
16303 *
16304 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
16305 * @return {PIXI.DisplayObject} The first child that was removed.
16306 */
16307 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
16308 /**
16309 * Removes a child from the specified index position.
16310 *
16311 * @param {number} index - The index to get the child from
16312 * @return {PIXI.DisplayObject} The child that was removed.
16313 */
16314 removeChildAt(index: number): PIXI.DisplayObject;
16315 /**
16316 * Removes all children from this container that are within the begin and end indexes.
16317 *
16318 * @param {number} [beginIndex=0] - The beginning position.
16319 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
16320 * @returns {PIXI.DisplayObject[]} List of removed children
16321 */
16322 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
16323 /**
16324 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
16325 */
16326 sortChildren(): void;
16327 /**
16328 * Updates the transform on all children of this container for rendering
16329 */
16330 updateTransform(): void;
16331 /**
16332 * Recalculates the bounds of the container.
16333 *
16334 */
16335 calculateBounds(): void;
16336 /**
16337 * Retrieves the local bounds of the displayObject as a rectangle object.
16338 *
16339 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
16340 * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,
16341 * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
16342 * @return {PIXI.Rectangle} The rectangular bounding area.
16343 */
16344 getLocalBounds(rect?: PIXI.Rectangle, skipChildrenUpdate?: boolean): PIXI.Rectangle;
16345 /**
16346 * Renders the object using the WebGL renderer
16347 *
16348 * @param {PIXI.Renderer} renderer - The renderer
16349 */
16350 render(renderer: PIXI.Renderer): void;
16351 /**
16352 * Render the object using the WebGL renderer and advanced features.
16353 *
16354 * @protected
16355 * @param {PIXI.Renderer} renderer - The renderer
16356 */
16357 protected renderAdvanced(renderer: PIXI.Renderer): void;
16358 /**
16359 * The width of the Container, setting this will actually modify the scale to achieve the value set
16360 *
16361 * @member {number}
16362 */
16363 width: number;
16364 /**
16365 * The height of the Container, setting this will actually modify the scale to achieve the value set
16366 *
16367 * @member {number}
16368 */
16369 height: number;
16370 /**
16371 * Container default updateTransform, does update children of container.
16372 * Will crash if there's no parent element.
16373 *
16374 * @memberof PIXI.Container#
16375 * @function containerUpdateTransform
16376 */
16377 containerUpdateTransform(): void;
16378 /**
16379 * Determines if the children to the displayObject can be clicked/touched
16380 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
16381 *
16382 * @member {boolean}
16383 * @memberof PIXI.Container#
16384 */
16385 interactiveChildren: boolean;
16386 /**
16387 * Returns the display object in the container.
16388 *
16389 * Recursive searches are done in a preorder traversal.
16390 *
16391 * @method getChildByName
16392 * @memberof PIXI.Container#
16393 * @param {string} name - Instance name.
16394 * @param {boolean}[deep=false] - Whether to search recursively
16395 * @return {PIXI.DisplayObject} The child with the specified name.
16396 */
16397 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
16398 /**
16399 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
16400 * shadow div with attributes set
16401 *
16402 * @member {boolean}
16403 * @memberof PIXI.DisplayObject#
16404 */
16405 accessible: boolean;
16406 /**
16407 * Sets the title attribute of the shadow div
16408 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
16409 *
16410 * @member {?string}
16411 * @memberof PIXI.DisplayObject#
16412 */
16413 accessibleTitle: string;
16414 /**
16415 * Sets the aria-label attribute of the shadow div
16416 *
16417 * @member {string}
16418 * @memberof PIXI.DisplayObject#
16419 */
16420 accessibleHint: string;
16421 /**
16422 * @member {boolean}
16423 * @memberof PIXI.DisplayObject#
16424 * @todo Needs docs.
16425 */
16426 _accessibleActive: boolean;
16427 /**
16428 * @member {boolean}
16429 * @memberof PIXI.DisplayObject#
16430 * @todo Needs docs.
16431 */
16432 _accessibleDiv: boolean;
16433 /**
16434 * Specify the type of div the accessible layer is. Screen readers treat the element differently
16435 * depending on this type. Defaults to button.
16436 *
16437 * @member {string}
16438 * @memberof PIXI.DisplayObject#
16439 * @default 'button'
16440 */
16441 accessibleType: string;
16442 /**
16443 * Specify the pointer-events the accessible div will use
16444 * Defaults to auto.
16445 *
16446 * @member {string}
16447 * @memberof PIXI.DisplayObject#
16448 * @default 'auto'
16449 */
16450 accessiblePointerEvents: string;
16451 /**
16452 * Setting to false will prevent any children inside this container to
16453 * be accessible. Defaults to true.
16454 *
16455 * @member {boolean}
16456 * @memberof PIXI.DisplayObject#
16457 * @default true
16458 */
16459 accessibleChildren: boolean;
16460 /**
16461 * World transform and local transform of this object.
16462 * This will become read-only later, please do not assign anything there unless you know what are you doing.
16463 *
16464 * @member {PIXI.Transform} PIXI.DisplayObject#transform
16465 */
16466 transform: PIXI.Transform;
16467 /**
16468 * The opacity of the object.
16469 *
16470 * @member {number} PIXI.DisplayObject#alpha
16471 */
16472 alpha: number;
16473 /**
16474 * The visibility of the object. If false the object will not be drawn, and
16475 * the updateTransform function will not be called.
16476 *
16477 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
16478 *
16479 * @member {boolean} PIXI.DisplayObject#visible
16480 */
16481 visible: boolean;
16482 /**
16483 * Can this object be rendered, if false the object will not be drawn but the updateTransform
16484 * methods will still be called.
16485 *
16486 * Only affects recursive calls from parent. You can ask for bounds manually.
16487 *
16488 * @member {boolean} PIXI.DisplayObject#renderable
16489 */
16490 renderable: boolean;
16491 /**
16492 * The display object container that contains this display object.
16493 *
16494 * @member {PIXI.Container} PIXI.DisplayObject#parent
16495 */
16496 parent: PIXI.Container;
16497 /**
16498 * The multiplied alpha of the displayObject.
16499 *
16500 * @member {number} PIXI.DisplayObject#worldAlpha
16501 * @readonly
16502 */
16503 readonly worldAlpha: number;
16504 /**
16505 * Which index in the children array the display component was before the previous zIndex sort.
16506 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
16507 *
16508 * @member {number} PIXI.DisplayObject#_lastSortedIndex
16509 * @protected
16510 */
16511 protected _lastSortedIndex: number;
16512 /**
16513 * The zIndex of the displayObject.
16514 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
16515 *
16516 * @member {number} PIXI.DisplayObject#_zIndex
16517 * @protected
16518 */
16519 protected _zIndex: number;
16520 /**
16521 * The area the filter is applied to. This is used as more of an optimization
16522 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
16523 *
16524 * Also works as an interaction mask.
16525 *
16526 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
16527 */
16528 filterArea: PIXI.Rectangle;
16529 /**
16530 * Sets the filters for the displayObject.
16531 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
16532 * To remove filters simply set this property to `'null'`.
16533 *
16534 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
16535 */
16536 filters: PIXI.Filter[];
16537 /**
16538 * Currently enabled filters
16539 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
16540 * @protected
16541 */
16542 protected _enabledFilters: PIXI.Filter[];
16543 /**
16544 * The bounds object, this is used to calculate and store the bounds of the displayObject.
16545 *
16546 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
16547 */
16548 _bounds: PIXI.Bounds;
16549 /**
16550 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
16551 *
16552 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
16553 */
16554 _localBounds: PIXI.Bounds;
16555 /**
16556 * Flags the cached bounds as dirty.
16557 *
16558 * @member {number} PIXI.DisplayObject#_boundsID
16559 * @protected
16560 */
16561 protected _boundsID: number;
16562 /**
16563 * Cache of this display-object's bounds-rectangle.
16564 *
16565 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
16566 * @protected
16567 */
16568 protected _boundsRect: PIXI.Bounds;
16569 /**
16570 * Cache of this display-object's local-bounds rectangle.
16571 *
16572 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
16573 * @protected
16574 */
16575 protected _localBoundsRect: PIXI.Bounds;
16576 /**
16577 * The original, cached mask of the object.
16578 *
16579 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
16580 * @protected
16581 */
16582 protected _mask: PIXI.Container | PIXI.MaskData | null;
16583 /**
16584 * If the object has been destroyed via destroy(). If true, it should not be used.
16585 *
16586 * @member {boolean} PIXI.DisplayObject#_destroyed
16587 * @protected
16588 */
16589 protected _destroyed: boolean;
16590 /**
16591 * used to fast check if a sprite is.. a sprite!
16592 * @member {boolean} PIXI.DisplayObject#isSprite
16593 */
16594 isSprite: boolean;
16595 /**
16596 * Does any other displayObject use this object as a mask?
16597 * @member {boolean} PIXI.DisplayObject#isMask
16598 */
16599 isMask: boolean;
16600 /**
16601 * Recursively updates transform of all objects from the root to this one
16602 * internal function for toLocal()
16603 */
16604 _recursivePostUpdateTransform(): void;
16605 /**
16606 * Retrieves the bounds of the displayObject as a rectangle object.
16607 *
16608 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
16609 * being updated. This means the calculation returned MAY be out of date BUT will give you a
16610 * nice performance boost.
16611 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
16612 * @return {PIXI.Rectangle} The rectangular bounding area.
16613 */
16614 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
16615 /**
16616 * Calculates the global position of the display object.
16617 *
16618 * @param {PIXI.IPointData} position - The world origin to calculate from.
16619 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
16620 * (otherwise will create a new Point).
16621 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
16622 * @return {PIXI.Point} A point object representing the position of this object.
16623 */
16624 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
16625 /**
16626 * Calculates the local position of the display object relative to another point.
16627 *
16628 * @param {PIXI.IPointData} position - The world origin to calculate from.
16629 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
16630 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
16631 * (otherwise will create a new Point).
16632 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
16633 * @return {PIXI.Point} A point object representing the position of this object
16634 */
16635 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
16636 /**
16637 * Set the parent Container of this DisplayObject.
16638 *
16639 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
16640 * @return {PIXI.Container} The Container that this DisplayObject was added to.
16641 */
16642 setParent(container: PIXI.Container): PIXI.Container;
16643 /**
16644 * Convenience function to set the position, scale, skew and pivot at once.
16645 *
16646 * @param {number} [x=0] - The X position
16647 * @param {number} [y=0] - The Y position
16648 * @param {number} [scaleX=1] - The X scale value
16649 * @param {number} [scaleY=1] - The Y scale value
16650 * @param {number} [rotation=0] - The rotation
16651 * @param {number} [skewX=0] - The X skew value
16652 * @param {number} [skewY=0] - The Y skew value
16653 * @param {number} [pivotX=0] - The X pivot value
16654 * @param {number} [pivotY=0] - The Y pivot value
16655 * @return {PIXI.DisplayObject} The DisplayObject instance
16656 */
16657 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
16658 /**
16659 * @protected
16660 * @member {PIXI.Container}
16661 */
16662 protected _tempDisplayObjectParent: PIXI.Container;
16663 /**
16664 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
16665 *
16666 * ```
16667 * const cacheParent = elem.enableTempParent();
16668 * elem.updateTransform();
16669 * elem.disableTempParent(cacheParent);
16670 * ```
16671 *
16672 * @returns {PIXI.DisplayObject} current parent
16673 */
16674 enableTempParent(): PIXI.DisplayObject;
16675 /**
16676 * Pair method for `enableTempParent`
16677 * @param {PIXI.DisplayObject} cacheParent actual parent of element
16678 */
16679 disableTempParent(cacheParent: PIXI.DisplayObject): void;
16680 /**
16681 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
16682 * An alias to position.x
16683 *
16684 * @member {number}
16685 */
16686 x: number;
16687 /**
16688 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
16689 * An alias to position.y
16690 *
16691 * @member {number}
16692 */
16693 y: number;
16694 /**
16695 * Current transform of the object based on world (parent) factors.
16696 *
16697 * @member {PIXI.Matrix}
16698 * @readonly
16699 */
16700 readonly worldTransform: PIXI.Matrix;
16701 /**
16702 * Current transform of the object based on local factors: position, scale, other stuff.
16703 *
16704 * @member {PIXI.Matrix}
16705 * @readonly
16706 */
16707 readonly localTransform: PIXI.Matrix;
16708 /**
16709 * The coordinate of the object relative to the local coordinates of the parent.
16710 * Assignment by value since pixi-v4.
16711 *
16712 * @member {PIXI.ObservablePoint}
16713 */
16714 position: PIXI.ObservablePoint;
16715 /**
16716 * The scale factor of the object.
16717 * Assignment by value since pixi-v4.
16718 *
16719 * @member {PIXI.ObservablePoint}
16720 */
16721 scale: PIXI.ObservablePoint;
16722 /**
16723 * The pivot point of the displayObject that it rotates around.
16724 * Assignment by value since pixi-v4.
16725 *
16726 * @member {PIXI.ObservablePoint}
16727 */
16728 pivot: PIXI.ObservablePoint;
16729 /**
16730 * The skew factor for the object in radians.
16731 * Assignment by value since pixi-v4.
16732 *
16733 * @member {PIXI.ObservablePoint}
16734 */
16735 skew: PIXI.ObservablePoint;
16736 /**
16737 * The rotation of the object in radians.
16738 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
16739 *
16740 * @member {number}
16741 */
16742 rotation: number;
16743 /**
16744 * The angle of the object in degrees.
16745 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
16746 *
16747 * @member {number}
16748 */
16749 angle: number;
16750 /**
16751 * The zIndex of the displayObject.
16752 * If a container has the sortableChildren property set to true, children will be automatically
16753 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
16754 * and thus rendered on top of other displayObjects within the same container.
16755 *
16756 * @member {number}
16757 */
16758 zIndex: number;
16759 /**
16760 * Indicates if the object is globally visible.
16761 *
16762 * @member {boolean}
16763 * @readonly
16764 */
16765 readonly worldVisible: boolean;
16766 /**
16767 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
16768 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
16769 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
16770 * utilities shape clipping. To remove a mask, set this property to `null`.
16771 *
16772 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
16773 * @example
16774 * const graphics = new PIXI.Graphics();
16775 * graphics.beginFill(0xFF3300);
16776 * graphics.drawRect(50, 250, 100, 100);
16777 * graphics.endFill();
16778 *
16779 * const sprite = new PIXI.Sprite(texture);
16780 * sprite.mask = graphics;
16781 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
16782 *
16783 * @member {PIXI.Container|PIXI.MaskData|null}
16784 */
16785 mask: PIXI.Container | PIXI.MaskData | null;
16786 /**
16787 * DisplayObject default updateTransform, does not update children of container.
16788 * Will crash if there's no parent element.
16789 *
16790 * @memberof PIXI.DisplayObject#
16791 * @function displayObjectUpdateTransform
16792 */
16793 displayObjectUpdateTransform(): void;
16794 /**
16795 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
16796 * events will not be emitted unless `interactive` is set to `true`.
16797 *
16798 * @example
16799 * const sprite = new PIXI.Sprite(texture);
16800 * sprite.interactive = true;
16801 * sprite.on('tap', (event) => {
16802 * //handle event
16803 * });
16804 * @member {boolean}
16805 * @memberof PIXI.DisplayObject#
16806 */
16807 interactive: boolean;
16808 /**
16809 * Interaction shape. Children will be hit first, then this shape will be checked.
16810 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
16811 *
16812 * @example
16813 * const sprite = new PIXI.Sprite(texture);
16814 * sprite.interactive = true;
16815 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
16816 * @member {PIXI.IHitArea}
16817 * @memberof PIXI.DisplayObject#
16818 */
16819 hitArea: PIXI.IHitArea;
16820 /**
16821 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
16822 * Setting this changes the 'cursor' property to `'pointer'`.
16823 *
16824 * @example
16825 * const sprite = new PIXI.Sprite(texture);
16826 * sprite.interactive = true;
16827 * sprite.buttonMode = true;
16828 * @member {boolean}
16829 * @memberof PIXI.DisplayObject#
16830 */
16831 buttonMode: boolean;
16832 /**
16833 * This defines what cursor mode is used when the mouse cursor
16834 * is hovered over the displayObject.
16835 *
16836 * @example
16837 * const sprite = new PIXI.Sprite(texture);
16838 * sprite.interactive = true;
16839 * sprite.cursor = 'wait';
16840 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
16841 *
16842 * @member {string}
16843 * @memberof PIXI.DisplayObject#
16844 */
16845 cursor: string;
16846 /**
16847 * Set this to true if you want this display object to be cached as a bitmap.
16848 * This basically takes a snap shot of the display object as it is at that moment. It can
16849 * provide a performance benefit for complex static displayObjects.
16850 * To remove simply set this property to `false`
16851 *
16852 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
16853 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
16854 *
16855 * @member {boolean}
16856 * @memberof PIXI.DisplayObject#
16857 */
16858 cacheAsBitmap: boolean;
16859 /**
16860 * The instance name of the object.
16861 *
16862 * @memberof PIXI.DisplayObject#
16863 * @member {string} name
16864 */
16865 name: string;
16866 /**
16867 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
16868 *
16869 * @method getGlobalPosition
16870 * @memberof PIXI.DisplayObject#
16871 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
16872 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
16873 * being updated. This means the calculation returned MAY be out of date BUT will give you a
16874 * nice performance boost.
16875 * @return {PIXI.Point} The updated point.
16876 */
16877 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
16878 }
16879 /**
16880 * The SimplePlane allows you to draw a texture across several points and then manipulate these points
16881 *
16882 *```js
16883 * for (let i = 0; i < 20; i++) {
16884 * points.push(new PIXI.Point(i * 50, 0));
16885 * };
16886 * let SimplePlane = new PIXI.SimplePlane(PIXI.Texture.from("snake.png"), points);
16887 * ```
16888 *
16889 * @class
16890 * @extends PIXI.Mesh
16891 * @memberof PIXI
16892 *
16893 */
16894 class SimplePlane extends PIXI.Mesh {
16895 constructor(texture: PIXI.Texture, verticesX: number, verticesY: number);
16896 /**
16897 * Method used for overrides, to do something in case texture frame was changed.
16898 * Meshes based on plane can override it and change more details based on texture.
16899 */
16900 textureUpdated(): void;
16901 /**
16902 * Cached tint value so we can tell when the tint is changed.
16903 * @memberof PIXI.Mesh#
16904 * @member {number} _cachedTint
16905 * @protected
16906 */
16907 protected _cachedTint: number;
16908 /**
16909 * Cached tinted texture.
16910 * @memberof PIXI.Mesh#
16911 * @member {HTMLCanvasElement} _tintedCanvas
16912 * @protected
16913 */
16914 protected _tintedCanvas: HTMLCanvasElement;
16915 /**
16916 * Includes vertex positions, face indices, normals, colors, UVs, and
16917 * custom attributes within buffers, reducing the cost of passing all
16918 * this data to the GPU. Can be shared between multiple Mesh objects.
16919 * @member {PIXI.Geometry} PIXI.Mesh#geometry
16920 * @readonly
16921 */
16922 readonly geometry: PIXI.Geometry;
16923 /**
16924 * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
16925 * Can be shared between multiple Mesh objects.
16926 * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader
16927 */
16928 shader: PIXI.Shader | PIXI.MeshMaterial;
16929 /**
16930 * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g.,
16931 * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
16932 * @member {PIXI.State} PIXI.Mesh#state
16933 */
16934 state: PIXI.State;
16935 /**
16936 * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants.
16937 *
16938 * @member {number} PIXI.Mesh#drawMode
16939 * @see PIXI.DRAW_MODES
16940 */
16941 drawMode: number;
16942 /**
16943 * Typically the index of the IndexBuffer where to start drawing.
16944 * @member {number} PIXI.Mesh#start
16945 * @default 0
16946 */
16947 start: number;
16948 /**
16949 * How much of the geometry to draw, by default `0` renders everything.
16950 * @member {number} PIXI.Mesh#size
16951 * @default 0
16952 */
16953 size: number;
16954 /**
16955 * To change mesh uv's, change its uvBuffer data and increment its _updateID.
16956 * @member {PIXI.Buffer}
16957 * @readonly
16958 */
16959 readonly uvBuffer: PIXI.Buffer;
16960 /**
16961 * To change mesh vertices, change its uvBuffer data and increment its _updateID.
16962 * Incrementing _updateID is optional because most of Mesh objects do it anyway.
16963 * @member {PIXI.Buffer}
16964 * @readonly
16965 */
16966 readonly verticesBuffer: PIXI.Buffer;
16967 /**
16968 * Alias for {@link PIXI.Mesh#shader}.
16969 * @member {PIXI.MeshMaterial}
16970 */
16971 material: PIXI.MeshMaterial;
16972 /**
16973 * The blend mode to be applied to the Mesh. Apply a value of
16974 * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
16975 *
16976 * @member {number}
16977 * @default PIXI.BLEND_MODES.NORMAL;
16978 * @see PIXI.BLEND_MODES
16979 */
16980 blendMode: number;
16981 /**
16982 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
16983 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
16984 * The main disadvantage is movement of objects may appear less smooth.
16985 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
16986 *
16987 * @member {boolean}
16988 * @default false
16989 */
16990 roundPixels: boolean;
16991 /**
16992 * The multiply tint applied to the Mesh. This is a hex value. A value of
16993 * `0xFFFFFF` will remove any tint effect.
16994 *
16995 * @member {number}
16996 * @default 0xFFFFFF
16997 */
16998 tint: number;
16999 /**
17000 * The texture that the Mesh uses.
17001 *
17002 * @member {PIXI.Texture}
17003 */
17004 texture: PIXI.Texture;
17005 /**
17006 * Standard renderer draw.
17007 * @protected
17008 * @param {PIXI.Renderer} renderer - Instance to renderer.
17009 */
17010 protected _render(renderer: PIXI.Renderer): void;
17011 /**
17012 * Standard non-batching way of rendering.
17013 * @protected
17014 * @param {PIXI.Renderer} renderer - Instance to renderer.
17015 */
17016 protected _renderDefault(renderer: PIXI.Renderer): void;
17017 /**
17018 * Rendering by using the Batch system.
17019 * @protected
17020 * @param {PIXI.Renderer} renderer - Instance to renderer.
17021 */
17022 protected _renderToBatch(renderer: PIXI.Renderer): void;
17023 /**
17024 * Updates vertexData field based on transform and vertices
17025 */
17026 calculateVertices(): void;
17027 /**
17028 * Updates uv field based on from geometry uv's or batchUvs
17029 */
17030 calculateUvs(): void;
17031 /**
17032 * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.
17033 * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.
17034 *
17035 * @protected
17036 */
17037 protected _calculateBounds(): void;
17038 /**
17039 * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.
17040 *
17041 * @param {PIXI.IPointData} point - the point to test
17042 * @return {boolean} the result of the test
17043 */
17044 containsPoint(point: PIXI.IPointData): boolean;
17045 /**
17046 * Destroys the Mesh object.
17047 *
17048 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
17049 * options have been set to that value
17050 * @param {boolean} [options.children=false] - if set to true, all the children will have
17051 * their destroy method called as well. 'options' will be passed on to those calls.
17052 */
17053 destroy(options?: {
17054 children?: boolean;
17055 }): void;
17056 /**
17057 * Renders the object using the Canvas renderer
17058 * @method renderCanvas
17059 * @memberof PIXI.Container#
17060 * @param {PIXI.CanvasRenderer} renderer - The renderer
17061 */
17062 renderCanvas(renderer: PIXI.CanvasRenderer): void;
17063 /**
17064 * The array of children of this container.
17065 *
17066 * @member {PIXI.DisplayObject[]} PIXI.Container#children
17067 * @readonly
17068 */
17069 readonly children: PIXI.DisplayObject[];
17070 /**
17071 * If set to true, the container will sort its children by zIndex value
17072 * when updateTransform() is called, or manually if sortChildren() is called.
17073 *
17074 * This actually changes the order of elements in the array, so should be treated
17075 * as a basic solution that is not performant compared to other solutions,
17076 * such as @link https://github.com/pixijs/pixi-display
17077 *
17078 * Also be aware of that this may not work nicely with the addChildAt() function,
17079 * as the zIndex sorting may cause the child to automatically sorted to another position.
17080 *
17081 * @see PIXI.settings.SORTABLE_CHILDREN
17082 *
17083 * @member {boolean} PIXI.Container#sortableChildren
17084 */
17085 sortableChildren: boolean;
17086 /**
17087 * Should children be sorted by zIndex at the next updateTransform call.
17088 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
17089 *
17090 * @member {boolean} PIXI.Container#sortDirty
17091 */
17092 sortDirty: boolean;
17093 /**
17094 * Overridable method that can be used by Container subclasses whenever the children array is modified
17095 *
17096 * @protected
17097 */
17098 protected onChildrenChange(): void;
17099 /**
17100 * Adds one or more children to the container.
17101 *
17102 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
17103 *
17104 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
17105 * @return {PIXI.DisplayObject} The first child that was added.
17106 */
17107 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
17108 /**
17109 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
17110 *
17111 * @param {PIXI.DisplayObject} child - The child to add
17112 * @param {number} index - The index to place the child in
17113 * @return {PIXI.DisplayObject} The child that was added.
17114 */
17115 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
17116 /**
17117 * Swaps the position of 2 Display Objects within this container.
17118 *
17119 * @param {PIXI.DisplayObject} child - First display object to swap
17120 * @param {PIXI.DisplayObject} child2 - Second display object to swap
17121 */
17122 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
17123 /**
17124 * Returns the index position of a child DisplayObject instance
17125 *
17126 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
17127 * @return {number} The index position of the child display object to identify
17128 */
17129 getChildIndex(child: PIXI.DisplayObject): number;
17130 /**
17131 * Changes the position of an existing child in the display object container
17132 *
17133 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
17134 * @param {number} index - The resulting index number for the child display object
17135 */
17136 setChildIndex(child: PIXI.DisplayObject, index: number): void;
17137 /**
17138 * Returns the child at the specified index
17139 *
17140 * @param {number} index - The index to get the child at
17141 * @return {PIXI.DisplayObject} The child at the given index, if any.
17142 */
17143 getChildAt(index: number): PIXI.DisplayObject;
17144 /**
17145 * Removes one or more children from the container.
17146 *
17147 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
17148 * @return {PIXI.DisplayObject} The first child that was removed.
17149 */
17150 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
17151 /**
17152 * Removes a child from the specified index position.
17153 *
17154 * @param {number} index - The index to get the child from
17155 * @return {PIXI.DisplayObject} The child that was removed.
17156 */
17157 removeChildAt(index: number): PIXI.DisplayObject;
17158 /**
17159 * Removes all children from this container that are within the begin and end indexes.
17160 *
17161 * @param {number} [beginIndex=0] - The beginning position.
17162 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
17163 * @returns {PIXI.DisplayObject[]} List of removed children
17164 */
17165 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
17166 /**
17167 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
17168 */
17169 sortChildren(): void;
17170 /**
17171 * Updates the transform on all children of this container for rendering
17172 */
17173 updateTransform(): void;
17174 /**
17175 * Recalculates the bounds of the container.
17176 *
17177 */
17178 calculateBounds(): void;
17179 /**
17180 * Retrieves the local bounds of the displayObject as a rectangle object.
17181 *
17182 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
17183 * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,
17184 * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
17185 * @return {PIXI.Rectangle} The rectangular bounding area.
17186 */
17187 getLocalBounds(rect?: PIXI.Rectangle, skipChildrenUpdate?: boolean): PIXI.Rectangle;
17188 /**
17189 * Renders the object using the WebGL renderer
17190 *
17191 * @param {PIXI.Renderer} renderer - The renderer
17192 */
17193 render(renderer: PIXI.Renderer): void;
17194 /**
17195 * Render the object using the WebGL renderer and advanced features.
17196 *
17197 * @protected
17198 * @param {PIXI.Renderer} renderer - The renderer
17199 */
17200 protected renderAdvanced(renderer: PIXI.Renderer): void;
17201 /**
17202 * The width of the Container, setting this will actually modify the scale to achieve the value set
17203 *
17204 * @member {number}
17205 */
17206 width: number;
17207 /**
17208 * The height of the Container, setting this will actually modify the scale to achieve the value set
17209 *
17210 * @member {number}
17211 */
17212 height: number;
17213 /**
17214 * Container default updateTransform, does update children of container.
17215 * Will crash if there's no parent element.
17216 *
17217 * @memberof PIXI.Container#
17218 * @function containerUpdateTransform
17219 */
17220 containerUpdateTransform(): void;
17221 /**
17222 * Determines if the children to the displayObject can be clicked/touched
17223 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
17224 *
17225 * @member {boolean}
17226 * @memberof PIXI.Container#
17227 */
17228 interactiveChildren: boolean;
17229 /**
17230 * Returns the display object in the container.
17231 *
17232 * Recursive searches are done in a preorder traversal.
17233 *
17234 * @method getChildByName
17235 * @memberof PIXI.Container#
17236 * @param {string} name - Instance name.
17237 * @param {boolean}[deep=false] - Whether to search recursively
17238 * @return {PIXI.DisplayObject} The child with the specified name.
17239 */
17240 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
17241 /**
17242 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
17243 * shadow div with attributes set
17244 *
17245 * @member {boolean}
17246 * @memberof PIXI.DisplayObject#
17247 */
17248 accessible: boolean;
17249 /**
17250 * Sets the title attribute of the shadow div
17251 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
17252 *
17253 * @member {?string}
17254 * @memberof PIXI.DisplayObject#
17255 */
17256 accessibleTitle: string;
17257 /**
17258 * Sets the aria-label attribute of the shadow div
17259 *
17260 * @member {string}
17261 * @memberof PIXI.DisplayObject#
17262 */
17263 accessibleHint: string;
17264 /**
17265 * @member {boolean}
17266 * @memberof PIXI.DisplayObject#
17267 * @todo Needs docs.
17268 */
17269 _accessibleActive: boolean;
17270 /**
17271 * @member {boolean}
17272 * @memberof PIXI.DisplayObject#
17273 * @todo Needs docs.
17274 */
17275 _accessibleDiv: boolean;
17276 /**
17277 * Specify the type of div the accessible layer is. Screen readers treat the element differently
17278 * depending on this type. Defaults to button.
17279 *
17280 * @member {string}
17281 * @memberof PIXI.DisplayObject#
17282 * @default 'button'
17283 */
17284 accessibleType: string;
17285 /**
17286 * Specify the pointer-events the accessible div will use
17287 * Defaults to auto.
17288 *
17289 * @member {string}
17290 * @memberof PIXI.DisplayObject#
17291 * @default 'auto'
17292 */
17293 accessiblePointerEvents: string;
17294 /**
17295 * Setting to false will prevent any children inside this container to
17296 * be accessible. Defaults to true.
17297 *
17298 * @member {boolean}
17299 * @memberof PIXI.DisplayObject#
17300 * @default true
17301 */
17302 accessibleChildren: boolean;
17303 /**
17304 * World transform and local transform of this object.
17305 * This will become read-only later, please do not assign anything there unless you know what are you doing.
17306 *
17307 * @member {PIXI.Transform} PIXI.DisplayObject#transform
17308 */
17309 transform: PIXI.Transform;
17310 /**
17311 * The opacity of the object.
17312 *
17313 * @member {number} PIXI.DisplayObject#alpha
17314 */
17315 alpha: number;
17316 /**
17317 * The visibility of the object. If false the object will not be drawn, and
17318 * the updateTransform function will not be called.
17319 *
17320 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
17321 *
17322 * @member {boolean} PIXI.DisplayObject#visible
17323 */
17324 visible: boolean;
17325 /**
17326 * Can this object be rendered, if false the object will not be drawn but the updateTransform
17327 * methods will still be called.
17328 *
17329 * Only affects recursive calls from parent. You can ask for bounds manually.
17330 *
17331 * @member {boolean} PIXI.DisplayObject#renderable
17332 */
17333 renderable: boolean;
17334 /**
17335 * The display object container that contains this display object.
17336 *
17337 * @member {PIXI.Container} PIXI.DisplayObject#parent
17338 */
17339 parent: PIXI.Container;
17340 /**
17341 * The multiplied alpha of the displayObject.
17342 *
17343 * @member {number} PIXI.DisplayObject#worldAlpha
17344 * @readonly
17345 */
17346 readonly worldAlpha: number;
17347 /**
17348 * Which index in the children array the display component was before the previous zIndex sort.
17349 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
17350 *
17351 * @member {number} PIXI.DisplayObject#_lastSortedIndex
17352 * @protected
17353 */
17354 protected _lastSortedIndex: number;
17355 /**
17356 * The zIndex of the displayObject.
17357 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
17358 *
17359 * @member {number} PIXI.DisplayObject#_zIndex
17360 * @protected
17361 */
17362 protected _zIndex: number;
17363 /**
17364 * The area the filter is applied to. This is used as more of an optimization
17365 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
17366 *
17367 * Also works as an interaction mask.
17368 *
17369 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
17370 */
17371 filterArea: PIXI.Rectangle;
17372 /**
17373 * Sets the filters for the displayObject.
17374 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
17375 * To remove filters simply set this property to `'null'`.
17376 *
17377 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
17378 */
17379 filters: PIXI.Filter[];
17380 /**
17381 * Currently enabled filters
17382 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
17383 * @protected
17384 */
17385 protected _enabledFilters: PIXI.Filter[];
17386 /**
17387 * The bounds object, this is used to calculate and store the bounds of the displayObject.
17388 *
17389 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
17390 */
17391 _bounds: PIXI.Bounds;
17392 /**
17393 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
17394 *
17395 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
17396 */
17397 _localBounds: PIXI.Bounds;
17398 /**
17399 * Flags the cached bounds as dirty.
17400 *
17401 * @member {number} PIXI.DisplayObject#_boundsID
17402 * @protected
17403 */
17404 protected _boundsID: number;
17405 /**
17406 * Cache of this display-object's bounds-rectangle.
17407 *
17408 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
17409 * @protected
17410 */
17411 protected _boundsRect: PIXI.Bounds;
17412 /**
17413 * Cache of this display-object's local-bounds rectangle.
17414 *
17415 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
17416 * @protected
17417 */
17418 protected _localBoundsRect: PIXI.Bounds;
17419 /**
17420 * The original, cached mask of the object.
17421 *
17422 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
17423 * @protected
17424 */
17425 protected _mask: PIXI.Container | PIXI.MaskData | null;
17426 /**
17427 * If the object has been destroyed via destroy(). If true, it should not be used.
17428 *
17429 * @member {boolean} PIXI.DisplayObject#_destroyed
17430 * @protected
17431 */
17432 protected _destroyed: boolean;
17433 /**
17434 * used to fast check if a sprite is.. a sprite!
17435 * @member {boolean} PIXI.DisplayObject#isSprite
17436 */
17437 isSprite: boolean;
17438 /**
17439 * Does any other displayObject use this object as a mask?
17440 * @member {boolean} PIXI.DisplayObject#isMask
17441 */
17442 isMask: boolean;
17443 /**
17444 * Recursively updates transform of all objects from the root to this one
17445 * internal function for toLocal()
17446 */
17447 _recursivePostUpdateTransform(): void;
17448 /**
17449 * Retrieves the bounds of the displayObject as a rectangle object.
17450 *
17451 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
17452 * being updated. This means the calculation returned MAY be out of date BUT will give you a
17453 * nice performance boost.
17454 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
17455 * @return {PIXI.Rectangle} The rectangular bounding area.
17456 */
17457 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
17458 /**
17459 * Calculates the global position of the display object.
17460 *
17461 * @param {PIXI.IPointData} position - The world origin to calculate from.
17462 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
17463 * (otherwise will create a new Point).
17464 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
17465 * @return {PIXI.Point} A point object representing the position of this object.
17466 */
17467 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
17468 /**
17469 * Calculates the local position of the display object relative to another point.
17470 *
17471 * @param {PIXI.IPointData} position - The world origin to calculate from.
17472 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
17473 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
17474 * (otherwise will create a new Point).
17475 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
17476 * @return {PIXI.Point} A point object representing the position of this object
17477 */
17478 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
17479 /**
17480 * Set the parent Container of this DisplayObject.
17481 *
17482 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
17483 * @return {PIXI.Container} The Container that this DisplayObject was added to.
17484 */
17485 setParent(container: PIXI.Container): PIXI.Container;
17486 /**
17487 * Convenience function to set the position, scale, skew and pivot at once.
17488 *
17489 * @param {number} [x=0] - The X position
17490 * @param {number} [y=0] - The Y position
17491 * @param {number} [scaleX=1] - The X scale value
17492 * @param {number} [scaleY=1] - The Y scale value
17493 * @param {number} [rotation=0] - The rotation
17494 * @param {number} [skewX=0] - The X skew value
17495 * @param {number} [skewY=0] - The Y skew value
17496 * @param {number} [pivotX=0] - The X pivot value
17497 * @param {number} [pivotY=0] - The Y pivot value
17498 * @return {PIXI.DisplayObject} The DisplayObject instance
17499 */
17500 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
17501 /**
17502 * @protected
17503 * @member {PIXI.Container}
17504 */
17505 protected _tempDisplayObjectParent: PIXI.Container;
17506 /**
17507 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
17508 *
17509 * ```
17510 * const cacheParent = elem.enableTempParent();
17511 * elem.updateTransform();
17512 * elem.disableTempParent(cacheParent);
17513 * ```
17514 *
17515 * @returns {PIXI.DisplayObject} current parent
17516 */
17517 enableTempParent(): PIXI.DisplayObject;
17518 /**
17519 * Pair method for `enableTempParent`
17520 * @param {PIXI.DisplayObject} cacheParent actual parent of element
17521 */
17522 disableTempParent(cacheParent: PIXI.DisplayObject): void;
17523 /**
17524 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
17525 * An alias to position.x
17526 *
17527 * @member {number}
17528 */
17529 x: number;
17530 /**
17531 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
17532 * An alias to position.y
17533 *
17534 * @member {number}
17535 */
17536 y: number;
17537 /**
17538 * Current transform of the object based on world (parent) factors.
17539 *
17540 * @member {PIXI.Matrix}
17541 * @readonly
17542 */
17543 readonly worldTransform: PIXI.Matrix;
17544 /**
17545 * Current transform of the object based on local factors: position, scale, other stuff.
17546 *
17547 * @member {PIXI.Matrix}
17548 * @readonly
17549 */
17550 readonly localTransform: PIXI.Matrix;
17551 /**
17552 * The coordinate of the object relative to the local coordinates of the parent.
17553 * Assignment by value since pixi-v4.
17554 *
17555 * @member {PIXI.ObservablePoint}
17556 */
17557 position: PIXI.ObservablePoint;
17558 /**
17559 * The scale factor of the object.
17560 * Assignment by value since pixi-v4.
17561 *
17562 * @member {PIXI.ObservablePoint}
17563 */
17564 scale: PIXI.ObservablePoint;
17565 /**
17566 * The pivot point of the displayObject that it rotates around.
17567 * Assignment by value since pixi-v4.
17568 *
17569 * @member {PIXI.ObservablePoint}
17570 */
17571 pivot: PIXI.ObservablePoint;
17572 /**
17573 * The skew factor for the object in radians.
17574 * Assignment by value since pixi-v4.
17575 *
17576 * @member {PIXI.ObservablePoint}
17577 */
17578 skew: PIXI.ObservablePoint;
17579 /**
17580 * The rotation of the object in radians.
17581 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
17582 *
17583 * @member {number}
17584 */
17585 rotation: number;
17586 /**
17587 * The angle of the object in degrees.
17588 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
17589 *
17590 * @member {number}
17591 */
17592 angle: number;
17593 /**
17594 * The zIndex of the displayObject.
17595 * If a container has the sortableChildren property set to true, children will be automatically
17596 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
17597 * and thus rendered on top of other displayObjects within the same container.
17598 *
17599 * @member {number}
17600 */
17601 zIndex: number;
17602 /**
17603 * Indicates if the object is globally visible.
17604 *
17605 * @member {boolean}
17606 * @readonly
17607 */
17608 readonly worldVisible: boolean;
17609 /**
17610 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
17611 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
17612 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
17613 * utilities shape clipping. To remove a mask, set this property to `null`.
17614 *
17615 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
17616 * @example
17617 * const graphics = new PIXI.Graphics();
17618 * graphics.beginFill(0xFF3300);
17619 * graphics.drawRect(50, 250, 100, 100);
17620 * graphics.endFill();
17621 *
17622 * const sprite = new PIXI.Sprite(texture);
17623 * sprite.mask = graphics;
17624 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
17625 *
17626 * @member {PIXI.Container|PIXI.MaskData|null}
17627 */
17628 mask: PIXI.Container | PIXI.MaskData | null;
17629 /**
17630 * DisplayObject default updateTransform, does not update children of container.
17631 * Will crash if there's no parent element.
17632 *
17633 * @memberof PIXI.DisplayObject#
17634 * @function displayObjectUpdateTransform
17635 */
17636 displayObjectUpdateTransform(): void;
17637 /**
17638 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
17639 * events will not be emitted unless `interactive` is set to `true`.
17640 *
17641 * @example
17642 * const sprite = new PIXI.Sprite(texture);
17643 * sprite.interactive = true;
17644 * sprite.on('tap', (event) => {
17645 * //handle event
17646 * });
17647 * @member {boolean}
17648 * @memberof PIXI.DisplayObject#
17649 */
17650 interactive: boolean;
17651 /**
17652 * Interaction shape. Children will be hit first, then this shape will be checked.
17653 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
17654 *
17655 * @example
17656 * const sprite = new PIXI.Sprite(texture);
17657 * sprite.interactive = true;
17658 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
17659 * @member {PIXI.IHitArea}
17660 * @memberof PIXI.DisplayObject#
17661 */
17662 hitArea: PIXI.IHitArea;
17663 /**
17664 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
17665 * Setting this changes the 'cursor' property to `'pointer'`.
17666 *
17667 * @example
17668 * const sprite = new PIXI.Sprite(texture);
17669 * sprite.interactive = true;
17670 * sprite.buttonMode = true;
17671 * @member {boolean}
17672 * @memberof PIXI.DisplayObject#
17673 */
17674 buttonMode: boolean;
17675 /**
17676 * This defines what cursor mode is used when the mouse cursor
17677 * is hovered over the displayObject.
17678 *
17679 * @example
17680 * const sprite = new PIXI.Sprite(texture);
17681 * sprite.interactive = true;
17682 * sprite.cursor = 'wait';
17683 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
17684 *
17685 * @member {string}
17686 * @memberof PIXI.DisplayObject#
17687 */
17688 cursor: string;
17689 /**
17690 * Set this to true if you want this display object to be cached as a bitmap.
17691 * This basically takes a snap shot of the display object as it is at that moment. It can
17692 * provide a performance benefit for complex static displayObjects.
17693 * To remove simply set this property to `false`
17694 *
17695 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
17696 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
17697 *
17698 * @member {boolean}
17699 * @memberof PIXI.DisplayObject#
17700 */
17701 cacheAsBitmap: boolean;
17702 /**
17703 * The instance name of the object.
17704 *
17705 * @memberof PIXI.DisplayObject#
17706 * @member {string} name
17707 */
17708 name: string;
17709 /**
17710 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
17711 *
17712 * @method getGlobalPosition
17713 * @memberof PIXI.DisplayObject#
17714 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
17715 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
17716 * being updated. This means the calculation returned MAY be out of date BUT will give you a
17717 * nice performance boost.
17718 * @return {PIXI.Point} The updated point.
17719 */
17720 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
17721 }
17722 /**
17723 * The rope allows you to draw a texture across several points and then manipulate these points
17724 *
17725 *```js
17726 * for (let i = 0; i < 20; i++) {
17727 * points.push(new PIXI.Point(i * 50, 0));
17728 * };
17729 * let rope = new PIXI.SimpleRope(PIXI.Texture.from("snake.png"), points);
17730 * ```
17731 *
17732 * @class
17733 * @extends PIXI.Mesh
17734 * @memberof PIXI
17735 *
17736 */
17737 class SimpleRope extends PIXI.Mesh {
17738 constructor(texture: PIXI.Texture, points: PIXI.Point[], textureScale?: number);
17739 /**
17740 * re-calculate vertices by rope points each frame
17741 *
17742 * @member {boolean} PIXI.SimpleRope#autoUpdate
17743 */
17744 autoUpdate: boolean;
17745 /**
17746 * Cached tint value so we can tell when the tint is changed.
17747 * @memberof PIXI.Mesh#
17748 * @member {number} _cachedTint
17749 * @protected
17750 */
17751 protected _cachedTint: number;
17752 /**
17753 * Cached tinted texture.
17754 * @memberof PIXI.Mesh#
17755 * @member {HTMLCanvasElement} _tintedCanvas
17756 * @protected
17757 */
17758 protected _tintedCanvas: HTMLCanvasElement;
17759 /**
17760 * Includes vertex positions, face indices, normals, colors, UVs, and
17761 * custom attributes within buffers, reducing the cost of passing all
17762 * this data to the GPU. Can be shared between multiple Mesh objects.
17763 * @member {PIXI.Geometry} PIXI.Mesh#geometry
17764 * @readonly
17765 */
17766 readonly geometry: PIXI.Geometry;
17767 /**
17768 * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
17769 * Can be shared between multiple Mesh objects.
17770 * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader
17771 */
17772 shader: PIXI.Shader | PIXI.MeshMaterial;
17773 /**
17774 * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g.,
17775 * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
17776 * @member {PIXI.State} PIXI.Mesh#state
17777 */
17778 state: PIXI.State;
17779 /**
17780 * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants.
17781 *
17782 * @member {number} PIXI.Mesh#drawMode
17783 * @see PIXI.DRAW_MODES
17784 */
17785 drawMode: number;
17786 /**
17787 * Typically the index of the IndexBuffer where to start drawing.
17788 * @member {number} PIXI.Mesh#start
17789 * @default 0
17790 */
17791 start: number;
17792 /**
17793 * How much of the geometry to draw, by default `0` renders everything.
17794 * @member {number} PIXI.Mesh#size
17795 * @default 0
17796 */
17797 size: number;
17798 /**
17799 * To change mesh uv's, change its uvBuffer data and increment its _updateID.
17800 * @member {PIXI.Buffer}
17801 * @readonly
17802 */
17803 readonly uvBuffer: PIXI.Buffer;
17804 /**
17805 * To change mesh vertices, change its uvBuffer data and increment its _updateID.
17806 * Incrementing _updateID is optional because most of Mesh objects do it anyway.
17807 * @member {PIXI.Buffer}
17808 * @readonly
17809 */
17810 readonly verticesBuffer: PIXI.Buffer;
17811 /**
17812 * Alias for {@link PIXI.Mesh#shader}.
17813 * @member {PIXI.MeshMaterial}
17814 */
17815 material: PIXI.MeshMaterial;
17816 /**
17817 * The blend mode to be applied to the Mesh. Apply a value of
17818 * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
17819 *
17820 * @member {number}
17821 * @default PIXI.BLEND_MODES.NORMAL;
17822 * @see PIXI.BLEND_MODES
17823 */
17824 blendMode: number;
17825 /**
17826 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
17827 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
17828 * The main disadvantage is movement of objects may appear less smooth.
17829 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
17830 *
17831 * @member {boolean}
17832 * @default false
17833 */
17834 roundPixels: boolean;
17835 /**
17836 * The multiply tint applied to the Mesh. This is a hex value. A value of
17837 * `0xFFFFFF` will remove any tint effect.
17838 *
17839 * @member {number}
17840 * @default 0xFFFFFF
17841 */
17842 tint: number;
17843 /**
17844 * The texture that the Mesh uses.
17845 *
17846 * @member {PIXI.Texture}
17847 */
17848 texture: PIXI.Texture;
17849 /**
17850 * Standard renderer draw.
17851 * @protected
17852 * @param {PIXI.Renderer} renderer - Instance to renderer.
17853 */
17854 protected _render(renderer: PIXI.Renderer): void;
17855 /**
17856 * Standard non-batching way of rendering.
17857 * @protected
17858 * @param {PIXI.Renderer} renderer - Instance to renderer.
17859 */
17860 protected _renderDefault(renderer: PIXI.Renderer): void;
17861 /**
17862 * Rendering by using the Batch system.
17863 * @protected
17864 * @param {PIXI.Renderer} renderer - Instance to renderer.
17865 */
17866 protected _renderToBatch(renderer: PIXI.Renderer): void;
17867 /**
17868 * Updates vertexData field based on transform and vertices
17869 */
17870 calculateVertices(): void;
17871 /**
17872 * Updates uv field based on from geometry uv's or batchUvs
17873 */
17874 calculateUvs(): void;
17875 /**
17876 * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.
17877 * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.
17878 *
17879 * @protected
17880 */
17881 protected _calculateBounds(): void;
17882 /**
17883 * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.
17884 *
17885 * @param {PIXI.IPointData} point - the point to test
17886 * @return {boolean} the result of the test
17887 */
17888 containsPoint(point: PIXI.IPointData): boolean;
17889 /**
17890 * Destroys the Mesh object.
17891 *
17892 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
17893 * options have been set to that value
17894 * @param {boolean} [options.children=false] - if set to true, all the children will have
17895 * their destroy method called as well. 'options' will be passed on to those calls.
17896 */
17897 destroy(options?: {
17898 children?: boolean;
17899 }): void;
17900 /**
17901 * Renders the object using the Canvas renderer
17902 * @method renderCanvas
17903 * @memberof PIXI.Container#
17904 * @param {PIXI.CanvasRenderer} renderer - The renderer
17905 */
17906 renderCanvas(renderer: PIXI.CanvasRenderer): void;
17907 /**
17908 * The array of children of this container.
17909 *
17910 * @member {PIXI.DisplayObject[]} PIXI.Container#children
17911 * @readonly
17912 */
17913 readonly children: PIXI.DisplayObject[];
17914 /**
17915 * If set to true, the container will sort its children by zIndex value
17916 * when updateTransform() is called, or manually if sortChildren() is called.
17917 *
17918 * This actually changes the order of elements in the array, so should be treated
17919 * as a basic solution that is not performant compared to other solutions,
17920 * such as @link https://github.com/pixijs/pixi-display
17921 *
17922 * Also be aware of that this may not work nicely with the addChildAt() function,
17923 * as the zIndex sorting may cause the child to automatically sorted to another position.
17924 *
17925 * @see PIXI.settings.SORTABLE_CHILDREN
17926 *
17927 * @member {boolean} PIXI.Container#sortableChildren
17928 */
17929 sortableChildren: boolean;
17930 /**
17931 * Should children be sorted by zIndex at the next updateTransform call.
17932 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
17933 *
17934 * @member {boolean} PIXI.Container#sortDirty
17935 */
17936 sortDirty: boolean;
17937 /**
17938 * Overridable method that can be used by Container subclasses whenever the children array is modified
17939 *
17940 * @protected
17941 */
17942 protected onChildrenChange(): void;
17943 /**
17944 * Adds one or more children to the container.
17945 *
17946 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
17947 *
17948 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
17949 * @return {PIXI.DisplayObject} The first child that was added.
17950 */
17951 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
17952 /**
17953 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
17954 *
17955 * @param {PIXI.DisplayObject} child - The child to add
17956 * @param {number} index - The index to place the child in
17957 * @return {PIXI.DisplayObject} The child that was added.
17958 */
17959 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
17960 /**
17961 * Swaps the position of 2 Display Objects within this container.
17962 *
17963 * @param {PIXI.DisplayObject} child - First display object to swap
17964 * @param {PIXI.DisplayObject} child2 - Second display object to swap
17965 */
17966 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
17967 /**
17968 * Returns the index position of a child DisplayObject instance
17969 *
17970 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
17971 * @return {number} The index position of the child display object to identify
17972 */
17973 getChildIndex(child: PIXI.DisplayObject): number;
17974 /**
17975 * Changes the position of an existing child in the display object container
17976 *
17977 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
17978 * @param {number} index - The resulting index number for the child display object
17979 */
17980 setChildIndex(child: PIXI.DisplayObject, index: number): void;
17981 /**
17982 * Returns the child at the specified index
17983 *
17984 * @param {number} index - The index to get the child at
17985 * @return {PIXI.DisplayObject} The child at the given index, if any.
17986 */
17987 getChildAt(index: number): PIXI.DisplayObject;
17988 /**
17989 * Removes one or more children from the container.
17990 *
17991 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
17992 * @return {PIXI.DisplayObject} The first child that was removed.
17993 */
17994 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
17995 /**
17996 * Removes a child from the specified index position.
17997 *
17998 * @param {number} index - The index to get the child from
17999 * @return {PIXI.DisplayObject} The child that was removed.
18000 */
18001 removeChildAt(index: number): PIXI.DisplayObject;
18002 /**
18003 * Removes all children from this container that are within the begin and end indexes.
18004 *
18005 * @param {number} [beginIndex=0] - The beginning position.
18006 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
18007 * @returns {PIXI.DisplayObject[]} List of removed children
18008 */
18009 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
18010 /**
18011 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
18012 */
18013 sortChildren(): void;
18014 /**
18015 * Updates the transform on all children of this container for rendering
18016 */
18017 updateTransform(): void;
18018 /**
18019 * Recalculates the bounds of the container.
18020 *
18021 */
18022 calculateBounds(): void;
18023 /**
18024 * Retrieves the local bounds of the displayObject as a rectangle object.
18025 *
18026 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
18027 * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,
18028 * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
18029 * @return {PIXI.Rectangle} The rectangular bounding area.
18030 */
18031 getLocalBounds(rect?: PIXI.Rectangle, skipChildrenUpdate?: boolean): PIXI.Rectangle;
18032 /**
18033 * Renders the object using the WebGL renderer
18034 *
18035 * @param {PIXI.Renderer} renderer - The renderer
18036 */
18037 render(renderer: PIXI.Renderer): void;
18038 /**
18039 * Render the object using the WebGL renderer and advanced features.
18040 *
18041 * @protected
18042 * @param {PIXI.Renderer} renderer - The renderer
18043 */
18044 protected renderAdvanced(renderer: PIXI.Renderer): void;
18045 /**
18046 * The width of the Container, setting this will actually modify the scale to achieve the value set
18047 *
18048 * @member {number}
18049 */
18050 width: number;
18051 /**
18052 * The height of the Container, setting this will actually modify the scale to achieve the value set
18053 *
18054 * @member {number}
18055 */
18056 height: number;
18057 /**
18058 * Container default updateTransform, does update children of container.
18059 * Will crash if there's no parent element.
18060 *
18061 * @memberof PIXI.Container#
18062 * @function containerUpdateTransform
18063 */
18064 containerUpdateTransform(): void;
18065 /**
18066 * Determines if the children to the displayObject can be clicked/touched
18067 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
18068 *
18069 * @member {boolean}
18070 * @memberof PIXI.Container#
18071 */
18072 interactiveChildren: boolean;
18073 /**
18074 * Returns the display object in the container.
18075 *
18076 * Recursive searches are done in a preorder traversal.
18077 *
18078 * @method getChildByName
18079 * @memberof PIXI.Container#
18080 * @param {string} name - Instance name.
18081 * @param {boolean}[deep=false] - Whether to search recursively
18082 * @return {PIXI.DisplayObject} The child with the specified name.
18083 */
18084 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
18085 /**
18086 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
18087 * shadow div with attributes set
18088 *
18089 * @member {boolean}
18090 * @memberof PIXI.DisplayObject#
18091 */
18092 accessible: boolean;
18093 /**
18094 * Sets the title attribute of the shadow div
18095 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
18096 *
18097 * @member {?string}
18098 * @memberof PIXI.DisplayObject#
18099 */
18100 accessibleTitle: string;
18101 /**
18102 * Sets the aria-label attribute of the shadow div
18103 *
18104 * @member {string}
18105 * @memberof PIXI.DisplayObject#
18106 */
18107 accessibleHint: string;
18108 /**
18109 * @member {boolean}
18110 * @memberof PIXI.DisplayObject#
18111 * @todo Needs docs.
18112 */
18113 _accessibleActive: boolean;
18114 /**
18115 * @member {boolean}
18116 * @memberof PIXI.DisplayObject#
18117 * @todo Needs docs.
18118 */
18119 _accessibleDiv: boolean;
18120 /**
18121 * Specify the type of div the accessible layer is. Screen readers treat the element differently
18122 * depending on this type. Defaults to button.
18123 *
18124 * @member {string}
18125 * @memberof PIXI.DisplayObject#
18126 * @default 'button'
18127 */
18128 accessibleType: string;
18129 /**
18130 * Specify the pointer-events the accessible div will use
18131 * Defaults to auto.
18132 *
18133 * @member {string}
18134 * @memberof PIXI.DisplayObject#
18135 * @default 'auto'
18136 */
18137 accessiblePointerEvents: string;
18138 /**
18139 * Setting to false will prevent any children inside this container to
18140 * be accessible. Defaults to true.
18141 *
18142 * @member {boolean}
18143 * @memberof PIXI.DisplayObject#
18144 * @default true
18145 */
18146 accessibleChildren: boolean;
18147 /**
18148 * World transform and local transform of this object.
18149 * This will become read-only later, please do not assign anything there unless you know what are you doing.
18150 *
18151 * @member {PIXI.Transform} PIXI.DisplayObject#transform
18152 */
18153 transform: PIXI.Transform;
18154 /**
18155 * The opacity of the object.
18156 *
18157 * @member {number} PIXI.DisplayObject#alpha
18158 */
18159 alpha: number;
18160 /**
18161 * The visibility of the object. If false the object will not be drawn, and
18162 * the updateTransform function will not be called.
18163 *
18164 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
18165 *
18166 * @member {boolean} PIXI.DisplayObject#visible
18167 */
18168 visible: boolean;
18169 /**
18170 * Can this object be rendered, if false the object will not be drawn but the updateTransform
18171 * methods will still be called.
18172 *
18173 * Only affects recursive calls from parent. You can ask for bounds manually.
18174 *
18175 * @member {boolean} PIXI.DisplayObject#renderable
18176 */
18177 renderable: boolean;
18178 /**
18179 * The display object container that contains this display object.
18180 *
18181 * @member {PIXI.Container} PIXI.DisplayObject#parent
18182 */
18183 parent: PIXI.Container;
18184 /**
18185 * The multiplied alpha of the displayObject.
18186 *
18187 * @member {number} PIXI.DisplayObject#worldAlpha
18188 * @readonly
18189 */
18190 readonly worldAlpha: number;
18191 /**
18192 * Which index in the children array the display component was before the previous zIndex sort.
18193 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
18194 *
18195 * @member {number} PIXI.DisplayObject#_lastSortedIndex
18196 * @protected
18197 */
18198 protected _lastSortedIndex: number;
18199 /**
18200 * The zIndex of the displayObject.
18201 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
18202 *
18203 * @member {number} PIXI.DisplayObject#_zIndex
18204 * @protected
18205 */
18206 protected _zIndex: number;
18207 /**
18208 * The area the filter is applied to. This is used as more of an optimization
18209 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
18210 *
18211 * Also works as an interaction mask.
18212 *
18213 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
18214 */
18215 filterArea: PIXI.Rectangle;
18216 /**
18217 * Sets the filters for the displayObject.
18218 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
18219 * To remove filters simply set this property to `'null'`.
18220 *
18221 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
18222 */
18223 filters: PIXI.Filter[];
18224 /**
18225 * Currently enabled filters
18226 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
18227 * @protected
18228 */
18229 protected _enabledFilters: PIXI.Filter[];
18230 /**
18231 * The bounds object, this is used to calculate and store the bounds of the displayObject.
18232 *
18233 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
18234 */
18235 _bounds: PIXI.Bounds;
18236 /**
18237 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
18238 *
18239 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
18240 */
18241 _localBounds: PIXI.Bounds;
18242 /**
18243 * Flags the cached bounds as dirty.
18244 *
18245 * @member {number} PIXI.DisplayObject#_boundsID
18246 * @protected
18247 */
18248 protected _boundsID: number;
18249 /**
18250 * Cache of this display-object's bounds-rectangle.
18251 *
18252 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
18253 * @protected
18254 */
18255 protected _boundsRect: PIXI.Bounds;
18256 /**
18257 * Cache of this display-object's local-bounds rectangle.
18258 *
18259 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
18260 * @protected
18261 */
18262 protected _localBoundsRect: PIXI.Bounds;
18263 /**
18264 * The original, cached mask of the object.
18265 *
18266 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
18267 * @protected
18268 */
18269 protected _mask: PIXI.Container | PIXI.MaskData | null;
18270 /**
18271 * If the object has been destroyed via destroy(). If true, it should not be used.
18272 *
18273 * @member {boolean} PIXI.DisplayObject#_destroyed
18274 * @protected
18275 */
18276 protected _destroyed: boolean;
18277 /**
18278 * used to fast check if a sprite is.. a sprite!
18279 * @member {boolean} PIXI.DisplayObject#isSprite
18280 */
18281 isSprite: boolean;
18282 /**
18283 * Does any other displayObject use this object as a mask?
18284 * @member {boolean} PIXI.DisplayObject#isMask
18285 */
18286 isMask: boolean;
18287 /**
18288 * Recursively updates transform of all objects from the root to this one
18289 * internal function for toLocal()
18290 */
18291 _recursivePostUpdateTransform(): void;
18292 /**
18293 * Retrieves the bounds of the displayObject as a rectangle object.
18294 *
18295 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
18296 * being updated. This means the calculation returned MAY be out of date BUT will give you a
18297 * nice performance boost.
18298 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
18299 * @return {PIXI.Rectangle} The rectangular bounding area.
18300 */
18301 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
18302 /**
18303 * Calculates the global position of the display object.
18304 *
18305 * @param {PIXI.IPointData} position - The world origin to calculate from.
18306 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
18307 * (otherwise will create a new Point).
18308 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
18309 * @return {PIXI.Point} A point object representing the position of this object.
18310 */
18311 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
18312 /**
18313 * Calculates the local position of the display object relative to another point.
18314 *
18315 * @param {PIXI.IPointData} position - The world origin to calculate from.
18316 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
18317 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
18318 * (otherwise will create a new Point).
18319 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
18320 * @return {PIXI.Point} A point object representing the position of this object
18321 */
18322 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
18323 /**
18324 * Set the parent Container of this DisplayObject.
18325 *
18326 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
18327 * @return {PIXI.Container} The Container that this DisplayObject was added to.
18328 */
18329 setParent(container: PIXI.Container): PIXI.Container;
18330 /**
18331 * Convenience function to set the position, scale, skew and pivot at once.
18332 *
18333 * @param {number} [x=0] - The X position
18334 * @param {number} [y=0] - The Y position
18335 * @param {number} [scaleX=1] - The X scale value
18336 * @param {number} [scaleY=1] - The Y scale value
18337 * @param {number} [rotation=0] - The rotation
18338 * @param {number} [skewX=0] - The X skew value
18339 * @param {number} [skewY=0] - The Y skew value
18340 * @param {number} [pivotX=0] - The X pivot value
18341 * @param {number} [pivotY=0] - The Y pivot value
18342 * @return {PIXI.DisplayObject} The DisplayObject instance
18343 */
18344 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
18345 /**
18346 * @protected
18347 * @member {PIXI.Container}
18348 */
18349 protected _tempDisplayObjectParent: PIXI.Container;
18350 /**
18351 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
18352 *
18353 * ```
18354 * const cacheParent = elem.enableTempParent();
18355 * elem.updateTransform();
18356 * elem.disableTempParent(cacheParent);
18357 * ```
18358 *
18359 * @returns {PIXI.DisplayObject} current parent
18360 */
18361 enableTempParent(): PIXI.DisplayObject;
18362 /**
18363 * Pair method for `enableTempParent`
18364 * @param {PIXI.DisplayObject} cacheParent actual parent of element
18365 */
18366 disableTempParent(cacheParent: PIXI.DisplayObject): void;
18367 /**
18368 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
18369 * An alias to position.x
18370 *
18371 * @member {number}
18372 */
18373 x: number;
18374 /**
18375 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
18376 * An alias to position.y
18377 *
18378 * @member {number}
18379 */
18380 y: number;
18381 /**
18382 * Current transform of the object based on world (parent) factors.
18383 *
18384 * @member {PIXI.Matrix}
18385 * @readonly
18386 */
18387 readonly worldTransform: PIXI.Matrix;
18388 /**
18389 * Current transform of the object based on local factors: position, scale, other stuff.
18390 *
18391 * @member {PIXI.Matrix}
18392 * @readonly
18393 */
18394 readonly localTransform: PIXI.Matrix;
18395 /**
18396 * The coordinate of the object relative to the local coordinates of the parent.
18397 * Assignment by value since pixi-v4.
18398 *
18399 * @member {PIXI.ObservablePoint}
18400 */
18401 position: PIXI.ObservablePoint;
18402 /**
18403 * The scale factor of the object.
18404 * Assignment by value since pixi-v4.
18405 *
18406 * @member {PIXI.ObservablePoint}
18407 */
18408 scale: PIXI.ObservablePoint;
18409 /**
18410 * The pivot point of the displayObject that it rotates around.
18411 * Assignment by value since pixi-v4.
18412 *
18413 * @member {PIXI.ObservablePoint}
18414 */
18415 pivot: PIXI.ObservablePoint;
18416 /**
18417 * The skew factor for the object in radians.
18418 * Assignment by value since pixi-v4.
18419 *
18420 * @member {PIXI.ObservablePoint}
18421 */
18422 skew: PIXI.ObservablePoint;
18423 /**
18424 * The rotation of the object in radians.
18425 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
18426 *
18427 * @member {number}
18428 */
18429 rotation: number;
18430 /**
18431 * The angle of the object in degrees.
18432 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
18433 *
18434 * @member {number}
18435 */
18436 angle: number;
18437 /**
18438 * The zIndex of the displayObject.
18439 * If a container has the sortableChildren property set to true, children will be automatically
18440 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
18441 * and thus rendered on top of other displayObjects within the same container.
18442 *
18443 * @member {number}
18444 */
18445 zIndex: number;
18446 /**
18447 * Indicates if the object is globally visible.
18448 *
18449 * @member {boolean}
18450 * @readonly
18451 */
18452 readonly worldVisible: boolean;
18453 /**
18454 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
18455 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
18456 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
18457 * utilities shape clipping. To remove a mask, set this property to `null`.
18458 *
18459 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
18460 * @example
18461 * const graphics = new PIXI.Graphics();
18462 * graphics.beginFill(0xFF3300);
18463 * graphics.drawRect(50, 250, 100, 100);
18464 * graphics.endFill();
18465 *
18466 * const sprite = new PIXI.Sprite(texture);
18467 * sprite.mask = graphics;
18468 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
18469 *
18470 * @member {PIXI.Container|PIXI.MaskData|null}
18471 */
18472 mask: PIXI.Container | PIXI.MaskData | null;
18473 /**
18474 * DisplayObject default updateTransform, does not update children of container.
18475 * Will crash if there's no parent element.
18476 *
18477 * @memberof PIXI.DisplayObject#
18478 * @function displayObjectUpdateTransform
18479 */
18480 displayObjectUpdateTransform(): void;
18481 /**
18482 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
18483 * events will not be emitted unless `interactive` is set to `true`.
18484 *
18485 * @example
18486 * const sprite = new PIXI.Sprite(texture);
18487 * sprite.interactive = true;
18488 * sprite.on('tap', (event) => {
18489 * //handle event
18490 * });
18491 * @member {boolean}
18492 * @memberof PIXI.DisplayObject#
18493 */
18494 interactive: boolean;
18495 /**
18496 * Interaction shape. Children will be hit first, then this shape will be checked.
18497 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
18498 *
18499 * @example
18500 * const sprite = new PIXI.Sprite(texture);
18501 * sprite.interactive = true;
18502 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
18503 * @member {PIXI.IHitArea}
18504 * @memberof PIXI.DisplayObject#
18505 */
18506 hitArea: PIXI.IHitArea;
18507 /**
18508 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
18509 * Setting this changes the 'cursor' property to `'pointer'`.
18510 *
18511 * @example
18512 * const sprite = new PIXI.Sprite(texture);
18513 * sprite.interactive = true;
18514 * sprite.buttonMode = true;
18515 * @member {boolean}
18516 * @memberof PIXI.DisplayObject#
18517 */
18518 buttonMode: boolean;
18519 /**
18520 * This defines what cursor mode is used when the mouse cursor
18521 * is hovered over the displayObject.
18522 *
18523 * @example
18524 * const sprite = new PIXI.Sprite(texture);
18525 * sprite.interactive = true;
18526 * sprite.cursor = 'wait';
18527 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
18528 *
18529 * @member {string}
18530 * @memberof PIXI.DisplayObject#
18531 */
18532 cursor: string;
18533 /**
18534 * Set this to true if you want this display object to be cached as a bitmap.
18535 * This basically takes a snap shot of the display object as it is at that moment. It can
18536 * provide a performance benefit for complex static displayObjects.
18537 * To remove simply set this property to `false`
18538 *
18539 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
18540 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
18541 *
18542 * @member {boolean}
18543 * @memberof PIXI.DisplayObject#
18544 */
18545 cacheAsBitmap: boolean;
18546 /**
18547 * The instance name of the object.
18548 *
18549 * @memberof PIXI.DisplayObject#
18550 * @member {string} name
18551 */
18552 name: string;
18553 /**
18554 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
18555 *
18556 * @method getGlobalPosition
18557 * @memberof PIXI.DisplayObject#
18558 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
18559 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
18560 * being updated. This means the calculation returned MAY be out of date BUT will give you a
18561 * nice performance boost.
18562 * @return {PIXI.Point} The updated point.
18563 */
18564 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
18565 }
18566 /**
18567 * RopeGeometry allows you to draw a geometry across several points and then manipulate these points.
18568 *
18569 * ```js
18570 * for (let i = 0; i < 20; i++) {
18571 * points.push(new PIXI.Point(i * 50, 0));
18572 * };
18573 * const rope = new PIXI.RopeGeometry(100, points);
18574 * ```
18575 *
18576 * @class
18577 * @extends PIXI.MeshGeometry
18578 * @memberof PIXI
18579 *
18580 */
18581 class RopeGeometry extends PIXI.MeshGeometry {
18582 constructor(width?: number, points?: PIXI.Point[], textureScale?: number);
18583 /**
18584 * An array of points that determine the rope
18585 * @member {PIXI.Point[]} PIXI.RopeGeometry#points
18586 */
18587 points: PIXI.Point[];
18588 /**
18589 * The width (i.e., thickness) of the rope.
18590 * @member {number} PIXI.RopeGeometry#_width
18591 * @readOnly
18592 */
18593 readonly _width: number;
18594 /**
18595 * Rope texture scale, if zero then the rope texture is stretched.
18596 * @member {number} PIXI.RopeGeometry#textureScale
18597 * @readOnly
18598 */
18599 readonly textureScale: number;
18600 /**
18601 * The width (i.e., thickness) of the rope.
18602 * @member {number}
18603 * @readOnly
18604 */
18605 readonly width: number;
18606 /**
18607 * refreshes vertices of Rope mesh
18608 */
18609 updateVertices(): void;
18610 /**
18611 * A map of renderer IDs to webgl VAOs
18612 *
18613 * @protected
18614 * @type {object}
18615 */
18616 protected glVertexArrayObjects: any;
18617 /**
18618 * Number of instances in this geometry, pass it to `GeometrySystem.draw()`
18619 * @member {number} PIXI.Geometry#instanceCount
18620 * @default 1
18621 */
18622 instanceCount: number;
18623 /**
18624 * Count of existing (not destroyed) meshes that reference this geometry
18625 * @member {number} PIXI.Geometry#refCount
18626 */
18627 refCount: number;
18628 /**
18629 *
18630 * Adds an attribute to the geometry
18631 * Note: `stride` and `start` should be `undefined` if you dont know them, not 0!
18632 *
18633 * @param {String} id - the name of the attribute (matching up to a shader)
18634 * @param {PIXI.Buffer|number[]} [buffer] - the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
18635 * @param {Number} [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
18636 * @param {Boolean} [normalized=false] - should the data be normalized.
18637 * @param {Number} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {PIXI.TYPES} to see the ones available
18638 * @param {Number} [stride] - How far apart (in floats) the start of each value is. (used for interleaving data)
18639 * @param {Number} [start] - How far into the array to start reading values (used for interleaving data)
18640 * @param {boolean} [instance=false] - Instancing flag
18641 *
18642 * @return {PIXI.Geometry} returns self, useful for chaining.
18643 */
18644 addAttribute(id: string, buffer?: PIXI.Buffer | number[], size?: number, normalized?: boolean, type?: number, stride?: number, start?: number, instance?: boolean): PIXI.Geometry;
18645 /**
18646 * returns the requested attribute
18647 *
18648 * @param {String} id - the name of the attribute required
18649 * @return {PIXI.Attribute} the attribute requested.
18650 */
18651 getAttribute(id: string): PIXI.Attribute;
18652 /**
18653 * returns the requested buffer
18654 *
18655 * @param {String} id - the name of the buffer required
18656 * @return {PIXI.Buffer} the buffer requested.
18657 */
18658 getBuffer(id: string): PIXI.Buffer;
18659 /**
18660 *
18661 * Adds an index buffer to the geometry
18662 * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
18663 *
18664 * @param {PIXI.Buffer|number[]} [buffer] - the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
18665 * @return {PIXI.Geometry} returns self, useful for chaining.
18666 */
18667 addIndex(buffer?: PIXI.Buffer | number[]): PIXI.Geometry;
18668 /**
18669 * returns the index buffer
18670 *
18671 * @return {PIXI.Buffer} the index buffer.
18672 */
18673 getIndex(): PIXI.Buffer;
18674 /**
18675 * this function modifies the structure so that all current attributes become interleaved into a single buffer
18676 * This can be useful if your model remains static as it offers a little performance boost
18677 *
18678 * @return {PIXI.Geometry} returns self, useful for chaining.
18679 */
18680 interleave(): PIXI.Geometry;
18681 /**
18682 * disposes WebGL resources that are connected to this geometry
18683 */
18684 dispose(): void;
18685 /**
18686 * Destroys the geometry.
18687 */
18688 destroy(): void;
18689 /**
18690 * returns a clone of the geometry
18691 *
18692 * @returns {PIXI.Geometry} a new clone of this geometry
18693 */
18694 clone(): PIXI.Geometry;
18695 }
18696 /**
18697 * The ParticleContainer class is a really fast version of the Container built solely for speed,
18698 * so use when you need a lot of sprites or particles.
18699 *
18700 * The tradeoff of the ParticleContainer is that most advanced functionality will not work.
18701 * ParticleContainer implements the basic object transform (position, scale, rotation)
18702 * and some advanced functionality like tint (as of v4.5.6).
18703 *
18704 * Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch.
18705 *
18706 * It's extremely easy to use:
18707 * ```js
18708 * let container = new ParticleContainer();
18709 *
18710 * for (let i = 0; i < 100; ++i)
18711 * {
18712 * let sprite = PIXI.Sprite.from("myImage.png");
18713 * container.addChild(sprite);
18714 * }
18715 * ```
18716 *
18717 * And here you have a hundred sprites that will be rendered at the speed of light.
18718 *
18719 * @class
18720 * @extends PIXI.Container
18721 * @memberof PIXI
18722 */
18723 class ParticleContainer extends PIXI.Container {
18724 constructor(maxSize?: number, properties?: {
18725 vertices?: boolean;
18726 position?: boolean;
18727 rotation?: boolean;
18728 uvs?: boolean;
18729 tint?: boolean;
18730 }, batchSize?: number, autoResize?: boolean);
18731 /**
18732 * @member {boolean} PIXI.ParticleContainer#interactiveChildren
18733 *
18734 */
18735 interactiveChildren: boolean;
18736 /**
18737 * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL`
18738 * to reset the blend mode.
18739 *
18740 * @member {number} PIXI.ParticleContainer#blendMode
18741 * @default PIXI.BLEND_MODES.NORMAL
18742 * @see PIXI.BLEND_MODES
18743 */
18744 blendMode: number;
18745 /**
18746 * If true, container allocates more batches in case there are more than `maxSize` particles.
18747 * @member {boolean} PIXI.ParticleContainer#autoResize
18748 * @default false
18749 */
18750 autoResize: boolean;
18751 /**
18752 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
18753 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
18754 * The main disadvantage is movement of objects may appear less smooth.
18755 * Default to true here as performance is usually the priority for particles.
18756 *
18757 * @member {boolean} PIXI.ParticleContainer#roundPixels
18758 * @default true
18759 */
18760 roundPixels: boolean;
18761 /**
18762 * The texture used to render the children.
18763 *
18764 * @readonly
18765 * @member {PIXI.BaseTexture} PIXI.ParticleContainer#baseTexture
18766 */
18767 readonly baseTexture: PIXI.BaseTexture;
18768 /**
18769 * Sets the private properties array to dynamic / static based on the passed properties object
18770 *
18771 * @param {object} properties - The properties to be uploaded
18772 */
18773 setProperties(properties: any): void;
18774 /**
18775 * The tint applied to the container. This is a hex value.
18776 * A value of 0xFFFFFF will remove any tint effect.
18777 ** IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
18778 * @member {number}
18779 * @default 0xFFFFFF
18780 */
18781 tint: number;
18782 /**
18783 * Destroys the container
18784 *
18785 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
18786 * have been set to that value
18787 * @param {boolean} [options.children=false] - if set to true, all the children will have their
18788 * destroy method called as well. 'options' will be passed on to those calls.
18789 * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
18790 * Should it destroy the texture of the child sprite
18791 * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
18792 * Should it destroy the base texture of the child sprite
18793 */
18794 destroy(options?: {
18795 children?: boolean;
18796 texture?: boolean;
18797 baseTexture?: boolean;
18798 }): void;
18799 /**
18800 * To be overridden by the subclass
18801 * @method _renderCanvas
18802 * @memberof PIXI.Container#
18803 * @protected
18804 * @param {PIXI.CanvasRenderer} renderer - The renderer
18805 */
18806 protected _renderCanvas(renderer: PIXI.CanvasRenderer): void;
18807 /**
18808 * The array of children of this container.
18809 *
18810 * @member {PIXI.DisplayObject[]} PIXI.Container#children
18811 * @readonly
18812 */
18813 readonly children: PIXI.DisplayObject[];
18814 /**
18815 * If set to true, the container will sort its children by zIndex value
18816 * when updateTransform() is called, or manually if sortChildren() is called.
18817 *
18818 * This actually changes the order of elements in the array, so should be treated
18819 * as a basic solution that is not performant compared to other solutions,
18820 * such as @link https://github.com/pixijs/pixi-display
18821 *
18822 * Also be aware of that this may not work nicely with the addChildAt() function,
18823 * as the zIndex sorting may cause the child to automatically sorted to another position.
18824 *
18825 * @see PIXI.settings.SORTABLE_CHILDREN
18826 *
18827 * @member {boolean} PIXI.Container#sortableChildren
18828 */
18829 sortableChildren: boolean;
18830 /**
18831 * Should children be sorted by zIndex at the next updateTransform call.
18832 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
18833 *
18834 * @member {boolean} PIXI.Container#sortDirty
18835 */
18836 sortDirty: boolean;
18837 /**
18838 * Adds one or more children to the container.
18839 *
18840 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
18841 *
18842 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
18843 * @return {PIXI.DisplayObject} The first child that was added.
18844 */
18845 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
18846 /**
18847 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
18848 *
18849 * @param {PIXI.DisplayObject} child - The child to add
18850 * @param {number} index - The index to place the child in
18851 * @return {PIXI.DisplayObject} The child that was added.
18852 */
18853 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
18854 /**
18855 * Swaps the position of 2 Display Objects within this container.
18856 *
18857 * @param {PIXI.DisplayObject} child - First display object to swap
18858 * @param {PIXI.DisplayObject} child2 - Second display object to swap
18859 */
18860 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
18861 /**
18862 * Returns the index position of a child DisplayObject instance
18863 *
18864 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
18865 * @return {number} The index position of the child display object to identify
18866 */
18867 getChildIndex(child: PIXI.DisplayObject): number;
18868 /**
18869 * Changes the position of an existing child in the display object container
18870 *
18871 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
18872 * @param {number} index - The resulting index number for the child display object
18873 */
18874 setChildIndex(child: PIXI.DisplayObject, index: number): void;
18875 /**
18876 * Returns the child at the specified index
18877 *
18878 * @param {number} index - The index to get the child at
18879 * @return {PIXI.DisplayObject} The child at the given index, if any.
18880 */
18881 getChildAt(index: number): PIXI.DisplayObject;
18882 /**
18883 * Removes one or more children from the container.
18884 *
18885 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
18886 * @return {PIXI.DisplayObject} The first child that was removed.
18887 */
18888 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
18889 /**
18890 * Removes a child from the specified index position.
18891 *
18892 * @param {number} index - The index to get the child from
18893 * @return {PIXI.DisplayObject} The child that was removed.
18894 */
18895 removeChildAt(index: number): PIXI.DisplayObject;
18896 /**
18897 * Removes all children from this container that are within the begin and end indexes.
18898 *
18899 * @param {number} [beginIndex=0] - The beginning position.
18900 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
18901 * @returns {PIXI.DisplayObject[]} List of removed children
18902 */
18903 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
18904 /**
18905 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
18906 */
18907 sortChildren(): void;
18908 /**
18909 * Recalculates the bounds of the container.
18910 *
18911 */
18912 calculateBounds(): void;
18913 /**
18914 * Retrieves the local bounds of the displayObject as a rectangle object.
18915 *
18916 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
18917 * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,
18918 * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.
18919 * @return {PIXI.Rectangle} The rectangular bounding area.
18920 */
18921 getLocalBounds(rect?: PIXI.Rectangle, skipChildrenUpdate?: boolean): PIXI.Rectangle;
18922 /**
18923 * Recalculates the bounds of the object. Override this to
18924 * calculate the bounds of the specific object (not including children).
18925 *
18926 * @protected
18927 */
18928 protected _calculateBounds(): void;
18929 /**
18930 * Render the object using the WebGL renderer and advanced features.
18931 *
18932 * @protected
18933 * @param {PIXI.Renderer} renderer - The renderer
18934 */
18935 protected renderAdvanced(renderer: PIXI.Renderer): void;
18936 /**
18937 * To be overridden by the subclasses.
18938 *
18939 * @protected
18940 * @param {PIXI.Renderer} renderer - The renderer
18941 */
18942 protected _render(renderer: PIXI.Renderer): void;
18943 /**
18944 * The width of the Container, setting this will actually modify the scale to achieve the value set
18945 *
18946 * @member {number}
18947 */
18948 width: number;
18949 /**
18950 * The height of the Container, setting this will actually modify the scale to achieve the value set
18951 *
18952 * @member {number}
18953 */
18954 height: number;
18955 /**
18956 * Container default updateTransform, does update children of container.
18957 * Will crash if there's no parent element.
18958 *
18959 * @memberof PIXI.Container#
18960 * @function containerUpdateTransform
18961 */
18962 containerUpdateTransform(): void;
18963 /**
18964 * Returns the display object in the container.
18965 *
18966 * Recursive searches are done in a preorder traversal.
18967 *
18968 * @method getChildByName
18969 * @memberof PIXI.Container#
18970 * @param {string} name - Instance name.
18971 * @param {boolean}[deep=false] - Whether to search recursively
18972 * @return {PIXI.DisplayObject} The child with the specified name.
18973 */
18974 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
18975 /**
18976 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
18977 * shadow div with attributes set
18978 *
18979 * @member {boolean}
18980 * @memberof PIXI.DisplayObject#
18981 */
18982 accessible: boolean;
18983 /**
18984 * Sets the title attribute of the shadow div
18985 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
18986 *
18987 * @member {?string}
18988 * @memberof PIXI.DisplayObject#
18989 */
18990 accessibleTitle: string;
18991 /**
18992 * Sets the aria-label attribute of the shadow div
18993 *
18994 * @member {string}
18995 * @memberof PIXI.DisplayObject#
18996 */
18997 accessibleHint: string;
18998 /**
18999 * @member {boolean}
19000 * @memberof PIXI.DisplayObject#
19001 * @todo Needs docs.
19002 */
19003 _accessibleActive: boolean;
19004 /**
19005 * @member {boolean}
19006 * @memberof PIXI.DisplayObject#
19007 * @todo Needs docs.
19008 */
19009 _accessibleDiv: boolean;
19010 /**
19011 * Specify the type of div the accessible layer is. Screen readers treat the element differently
19012 * depending on this type. Defaults to button.
19013 *
19014 * @member {string}
19015 * @memberof PIXI.DisplayObject#
19016 * @default 'button'
19017 */
19018 accessibleType: string;
19019 /**
19020 * Specify the pointer-events the accessible div will use
19021 * Defaults to auto.
19022 *
19023 * @member {string}
19024 * @memberof PIXI.DisplayObject#
19025 * @default 'auto'
19026 */
19027 accessiblePointerEvents: string;
19028 /**
19029 * Setting to false will prevent any children inside this container to
19030 * be accessible. Defaults to true.
19031 *
19032 * @member {boolean}
19033 * @memberof PIXI.DisplayObject#
19034 * @default true
19035 */
19036 accessibleChildren: boolean;
19037 /**
19038 * World transform and local transform of this object.
19039 * This will become read-only later, please do not assign anything there unless you know what are you doing.
19040 *
19041 * @member {PIXI.Transform} PIXI.DisplayObject#transform
19042 */
19043 transform: PIXI.Transform;
19044 /**
19045 * The opacity of the object.
19046 *
19047 * @member {number} PIXI.DisplayObject#alpha
19048 */
19049 alpha: number;
19050 /**
19051 * The visibility of the object. If false the object will not be drawn, and
19052 * the updateTransform function will not be called.
19053 *
19054 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
19055 *
19056 * @member {boolean} PIXI.DisplayObject#visible
19057 */
19058 visible: boolean;
19059 /**
19060 * Can this object be rendered, if false the object will not be drawn but the updateTransform
19061 * methods will still be called.
19062 *
19063 * Only affects recursive calls from parent. You can ask for bounds manually.
19064 *
19065 * @member {boolean} PIXI.DisplayObject#renderable
19066 */
19067 renderable: boolean;
19068 /**
19069 * The display object container that contains this display object.
19070 *
19071 * @member {PIXI.Container} PIXI.DisplayObject#parent
19072 */
19073 parent: PIXI.Container;
19074 /**
19075 * The multiplied alpha of the displayObject.
19076 *
19077 * @member {number} PIXI.DisplayObject#worldAlpha
19078 * @readonly
19079 */
19080 readonly worldAlpha: number;
19081 /**
19082 * Which index in the children array the display component was before the previous zIndex sort.
19083 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
19084 *
19085 * @member {number} PIXI.DisplayObject#_lastSortedIndex
19086 * @protected
19087 */
19088 protected _lastSortedIndex: number;
19089 /**
19090 * The zIndex of the displayObject.
19091 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
19092 *
19093 * @member {number} PIXI.DisplayObject#_zIndex
19094 * @protected
19095 */
19096 protected _zIndex: number;
19097 /**
19098 * The area the filter is applied to. This is used as more of an optimization
19099 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
19100 *
19101 * Also works as an interaction mask.
19102 *
19103 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
19104 */
19105 filterArea: PIXI.Rectangle;
19106 /**
19107 * Sets the filters for the displayObject.
19108 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
19109 * To remove filters simply set this property to `'null'`.
19110 *
19111 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
19112 */
19113 filters: PIXI.Filter[];
19114 /**
19115 * Currently enabled filters
19116 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
19117 * @protected
19118 */
19119 protected _enabledFilters: PIXI.Filter[];
19120 /**
19121 * The bounds object, this is used to calculate and store the bounds of the displayObject.
19122 *
19123 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
19124 */
19125 _bounds: PIXI.Bounds;
19126 /**
19127 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
19128 *
19129 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
19130 */
19131 _localBounds: PIXI.Bounds;
19132 /**
19133 * Flags the cached bounds as dirty.
19134 *
19135 * @member {number} PIXI.DisplayObject#_boundsID
19136 * @protected
19137 */
19138 protected _boundsID: number;
19139 /**
19140 * Cache of this display-object's bounds-rectangle.
19141 *
19142 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
19143 * @protected
19144 */
19145 protected _boundsRect: PIXI.Bounds;
19146 /**
19147 * Cache of this display-object's local-bounds rectangle.
19148 *
19149 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
19150 * @protected
19151 */
19152 protected _localBoundsRect: PIXI.Bounds;
19153 /**
19154 * The original, cached mask of the object.
19155 *
19156 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
19157 * @protected
19158 */
19159 protected _mask: PIXI.Container | PIXI.MaskData | null;
19160 /**
19161 * If the object has been destroyed via destroy(). If true, it should not be used.
19162 *
19163 * @member {boolean} PIXI.DisplayObject#_destroyed
19164 * @protected
19165 */
19166 protected _destroyed: boolean;
19167 /**
19168 * used to fast check if a sprite is.. a sprite!
19169 * @member {boolean} PIXI.DisplayObject#isSprite
19170 */
19171 isSprite: boolean;
19172 /**
19173 * Does any other displayObject use this object as a mask?
19174 * @member {boolean} PIXI.DisplayObject#isMask
19175 */
19176 isMask: boolean;
19177 /**
19178 * Recursively updates transform of all objects from the root to this one
19179 * internal function for toLocal()
19180 */
19181 _recursivePostUpdateTransform(): void;
19182 /**
19183 * Retrieves the bounds of the displayObject as a rectangle object.
19184 *
19185 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
19186 * being updated. This means the calculation returned MAY be out of date BUT will give you a
19187 * nice performance boost.
19188 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
19189 * @return {PIXI.Rectangle} The rectangular bounding area.
19190 */
19191 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
19192 /**
19193 * Calculates the global position of the display object.
19194 *
19195 * @param {PIXI.IPointData} position - The world origin to calculate from.
19196 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
19197 * (otherwise will create a new Point).
19198 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
19199 * @return {PIXI.Point} A point object representing the position of this object.
19200 */
19201 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
19202 /**
19203 * Calculates the local position of the display object relative to another point.
19204 *
19205 * @param {PIXI.IPointData} position - The world origin to calculate from.
19206 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
19207 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
19208 * (otherwise will create a new Point).
19209 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
19210 * @return {PIXI.Point} A point object representing the position of this object
19211 */
19212 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
19213 /**
19214 * Set the parent Container of this DisplayObject.
19215 *
19216 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
19217 * @return {PIXI.Container} The Container that this DisplayObject was added to.
19218 */
19219 setParent(container: PIXI.Container): PIXI.Container;
19220 /**
19221 * Convenience function to set the position, scale, skew and pivot at once.
19222 *
19223 * @param {number} [x=0] - The X position
19224 * @param {number} [y=0] - The Y position
19225 * @param {number} [scaleX=1] - The X scale value
19226 * @param {number} [scaleY=1] - The Y scale value
19227 * @param {number} [rotation=0] - The rotation
19228 * @param {number} [skewX=0] - The X skew value
19229 * @param {number} [skewY=0] - The Y skew value
19230 * @param {number} [pivotX=0] - The X pivot value
19231 * @param {number} [pivotY=0] - The Y pivot value
19232 * @return {PIXI.DisplayObject} The DisplayObject instance
19233 */
19234 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
19235 /**
19236 * @protected
19237 * @member {PIXI.Container}
19238 */
19239 protected _tempDisplayObjectParent: PIXI.Container;
19240 /**
19241 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
19242 *
19243 * ```
19244 * const cacheParent = elem.enableTempParent();
19245 * elem.updateTransform();
19246 * elem.disableTempParent(cacheParent);
19247 * ```
19248 *
19249 * @returns {PIXI.DisplayObject} current parent
19250 */
19251 enableTempParent(): PIXI.DisplayObject;
19252 /**
19253 * Pair method for `enableTempParent`
19254 * @param {PIXI.DisplayObject} cacheParent actual parent of element
19255 */
19256 disableTempParent(cacheParent: PIXI.DisplayObject): void;
19257 /**
19258 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
19259 * An alias to position.x
19260 *
19261 * @member {number}
19262 */
19263 x: number;
19264 /**
19265 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
19266 * An alias to position.y
19267 *
19268 * @member {number}
19269 */
19270 y: number;
19271 /**
19272 * Current transform of the object based on world (parent) factors.
19273 *
19274 * @member {PIXI.Matrix}
19275 * @readonly
19276 */
19277 readonly worldTransform: PIXI.Matrix;
19278 /**
19279 * Current transform of the object based on local factors: position, scale, other stuff.
19280 *
19281 * @member {PIXI.Matrix}
19282 * @readonly
19283 */
19284 readonly localTransform: PIXI.Matrix;
19285 /**
19286 * The coordinate of the object relative to the local coordinates of the parent.
19287 * Assignment by value since pixi-v4.
19288 *
19289 * @member {PIXI.ObservablePoint}
19290 */
19291 position: PIXI.ObservablePoint;
19292 /**
19293 * The scale factor of the object.
19294 * Assignment by value since pixi-v4.
19295 *
19296 * @member {PIXI.ObservablePoint}
19297 */
19298 scale: PIXI.ObservablePoint;
19299 /**
19300 * The pivot point of the displayObject that it rotates around.
19301 * Assignment by value since pixi-v4.
19302 *
19303 * @member {PIXI.ObservablePoint}
19304 */
19305 pivot: PIXI.ObservablePoint;
19306 /**
19307 * The skew factor for the object in radians.
19308 * Assignment by value since pixi-v4.
19309 *
19310 * @member {PIXI.ObservablePoint}
19311 */
19312 skew: PIXI.ObservablePoint;
19313 /**
19314 * The rotation of the object in radians.
19315 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
19316 *
19317 * @member {number}
19318 */
19319 rotation: number;
19320 /**
19321 * The angle of the object in degrees.
19322 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
19323 *
19324 * @member {number}
19325 */
19326 angle: number;
19327 /**
19328 * The zIndex of the displayObject.
19329 * If a container has the sortableChildren property set to true, children will be automatically
19330 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
19331 * and thus rendered on top of other displayObjects within the same container.
19332 *
19333 * @member {number}
19334 */
19335 zIndex: number;
19336 /**
19337 * Indicates if the object is globally visible.
19338 *
19339 * @member {boolean}
19340 * @readonly
19341 */
19342 readonly worldVisible: boolean;
19343 /**
19344 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
19345 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
19346 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
19347 * utilities shape clipping. To remove a mask, set this property to `null`.
19348 *
19349 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
19350 * @example
19351 * const graphics = new PIXI.Graphics();
19352 * graphics.beginFill(0xFF3300);
19353 * graphics.drawRect(50, 250, 100, 100);
19354 * graphics.endFill();
19355 *
19356 * const sprite = new PIXI.Sprite(texture);
19357 * sprite.mask = graphics;
19358 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
19359 *
19360 * @member {PIXI.Container|PIXI.MaskData|null}
19361 */
19362 mask: PIXI.Container | PIXI.MaskData | null;
19363 /**
19364 * DisplayObject default updateTransform, does not update children of container.
19365 * Will crash if there's no parent element.
19366 *
19367 * @memberof PIXI.DisplayObject#
19368 * @function displayObjectUpdateTransform
19369 */
19370 displayObjectUpdateTransform(): void;
19371 /**
19372 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
19373 * events will not be emitted unless `interactive` is set to `true`.
19374 *
19375 * @example
19376 * const sprite = new PIXI.Sprite(texture);
19377 * sprite.interactive = true;
19378 * sprite.on('tap', (event) => {
19379 * //handle event
19380 * });
19381 * @member {boolean}
19382 * @memberof PIXI.DisplayObject#
19383 */
19384 interactive: boolean;
19385 /**
19386 * Interaction shape. Children will be hit first, then this shape will be checked.
19387 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
19388 *
19389 * @example
19390 * const sprite = new PIXI.Sprite(texture);
19391 * sprite.interactive = true;
19392 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
19393 * @member {PIXI.IHitArea}
19394 * @memberof PIXI.DisplayObject#
19395 */
19396 hitArea: PIXI.IHitArea;
19397 /**
19398 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
19399 * Setting this changes the 'cursor' property to `'pointer'`.
19400 *
19401 * @example
19402 * const sprite = new PIXI.Sprite(texture);
19403 * sprite.interactive = true;
19404 * sprite.buttonMode = true;
19405 * @member {boolean}
19406 * @memberof PIXI.DisplayObject#
19407 */
19408 buttonMode: boolean;
19409 /**
19410 * This defines what cursor mode is used when the mouse cursor
19411 * is hovered over the displayObject.
19412 *
19413 * @example
19414 * const sprite = new PIXI.Sprite(texture);
19415 * sprite.interactive = true;
19416 * sprite.cursor = 'wait';
19417 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
19418 *
19419 * @member {string}
19420 * @memberof PIXI.DisplayObject#
19421 */
19422 cursor: string;
19423 /**
19424 * Set this to true if you want this display object to be cached as a bitmap.
19425 * This basically takes a snap shot of the display object as it is at that moment. It can
19426 * provide a performance benefit for complex static displayObjects.
19427 * To remove simply set this property to `false`
19428 *
19429 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
19430 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
19431 *
19432 * @member {boolean}
19433 * @memberof PIXI.DisplayObject#
19434 */
19435 cacheAsBitmap: boolean;
19436 /**
19437 * The instance name of the object.
19438 *
19439 * @memberof PIXI.DisplayObject#
19440 * @member {string} name
19441 */
19442 name: string;
19443 /**
19444 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
19445 *
19446 * @method getGlobalPosition
19447 * @memberof PIXI.DisplayObject#
19448 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
19449 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
19450 * being updated. This means the calculation returned MAY be out of date BUT will give you a
19451 * nice performance boost.
19452 * @return {PIXI.Point} The updated point.
19453 */
19454 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
19455 }
19456 /**
19457 * Renderer for Particles that is designer for speed over feature set.
19458 *
19459 * @class
19460 * @memberof PIXI
19461 */
19462 class ParticleRenderer {
19463 constructor(renderer: PIXI.Renderer);
19464 /**
19465 * The default shader that is used if a sprite doesn't have a more specific one.
19466 *
19467 * @member {PIXI.Shader} PIXI.ParticleRenderer#shader
19468 */
19469 shader: PIXI.Shader;
19470 /**
19471 * The WebGL state in which this renderer will work.
19472 *
19473 * @member {PIXI.State} PIXI.ParticleRenderer#state
19474 * @readonly
19475 */
19476 readonly state: PIXI.State;
19477 /**
19478 * Renders the particle container object.
19479 *
19480 * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer
19481 */
19482 render(container: PIXI.ParticleContainer): void;
19483 /**
19484 * Uploads the vertices.
19485 *
19486 * @param {PIXI.DisplayObject[]} children - the array of display objects to render
19487 * @param {number} startIndex - the index to start from in the children array
19488 * @param {number} amount - the amount of children that will have their vertices uploaded
19489 * @param {number[]} array - The vertices to upload.
19490 * @param {number} stride - Stride to use for iteration.
19491 * @param {number} offset - Offset to start at.
19492 */
19493 uploadVertices(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void;
19494 /**
19495 * Uploads the position.
19496 *
19497 * @param {PIXI.DisplayObject[]} children - the array of display objects to render
19498 * @param {number} startIndex - the index to start from in the children array
19499 * @param {number} amount - the amount of children that will have their positions uploaded
19500 * @param {number[]} array - The vertices to upload.
19501 * @param {number} stride - Stride to use for iteration.
19502 * @param {number} offset - Offset to start at.
19503 */
19504 uploadPosition(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void;
19505 /**
19506 * Uploads the rotation.
19507 *
19508 * @param {PIXI.DisplayObject[]} children - the array of display objects to render
19509 * @param {number} startIndex - the index to start from in the children array
19510 * @param {number} amount - the amount of children that will have their rotation uploaded
19511 * @param {number[]} array - The vertices to upload.
19512 * @param {number} stride - Stride to use for iteration.
19513 * @param {number} offset - Offset to start at.
19514 */
19515 uploadRotation(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void;
19516 /**
19517 * Uploads the Uvs
19518 *
19519 * @param {PIXI.DisplayObject[]} children - the array of display objects to render
19520 * @param {number} startIndex - the index to start from in the children array
19521 * @param {number} amount - the amount of children that will have their rotation uploaded
19522 * @param {number[]} array - The vertices to upload.
19523 * @param {number} stride - Stride to use for iteration.
19524 * @param {number} offset - Offset to start at.
19525 */
19526 uploadUvs(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void;
19527 /**
19528 * Uploads the tint.
19529 *
19530 * @param {PIXI.DisplayObject[]} children - the array of display objects to render
19531 * @param {number} startIndex - the index to start from in the children array
19532 * @param {number} amount - the amount of children that will have their rotation uploaded
19533 * @param {number[]} array - The vertices to upload.
19534 * @param {number} stride - Stride to use for iteration.
19535 * @param {number} offset - Offset to start at.
19536 */
19537 uploadTint(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void;
19538 /**
19539 * Destroys the ParticleRenderer.
19540 */
19541 destroy(): void;
19542 }
19543 /**
19544 * The prepare manager provides functionality to upload content to the GPU.
19545 *
19546 * BasePrepare handles basic queuing functionality and is extended by
19547 * {@link PIXI.Prepare} and {@link PIXI.CanvasPrepare}
19548 * to provide preparation capabilities specific to their respective renderers.
19549 *
19550 * @example
19551 * // Create a sprite
19552 * const sprite = PIXI.Sprite.from('something.png');
19553 *
19554 * // Load object into GPU
19555 * app.renderer.plugins.prepare.upload(sprite, () => {
19556 *
19557 * //Texture(s) has been uploaded to GPU
19558 * app.stage.addChild(sprite);
19559 *
19560 * })
19561 *
19562 * @abstract
19563 * @class
19564 * @memberof PIXI
19565 */
19566 class BasePrepare {
19567 constructor(renderer: PIXI.AbstractRenderer);
19568 /**
19569 * The limiter to be used to control how quickly items are prepared.
19570 * @type {PIXI.CountLimiter|PIXI.TimeLimiter}
19571 */
19572 limiter: PIXI.CountLimiter | PIXI.TimeLimiter;
19573 /**
19574 * Reference to the renderer.
19575 * @type {PIXI.AbstractRenderer}
19576 * @protected
19577 */
19578 protected renderer: PIXI.AbstractRenderer;
19579 /**
19580 * The only real difference between CanvasPrepare and Prepare is what they pass
19581 * to upload hooks. That different parameter is stored here.
19582 * @type {object}
19583 * @protected
19584 */
19585 protected uploadHookHelper: any;
19586 /**
19587 * Upload all the textures and graphics to the GPU.
19588 *
19589 * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item -
19590 * Either the container or display object to search for items to upload, the items to upload themselves,
19591 * or the callback function, if items have been added using `prepare.add`.
19592 * @param {Function} [done] - Optional callback when all queued uploads have completed
19593 */
19594 upload(item: ((...params: any[]) => any) | PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text, done?: (...params: any[]) => any): void;
19595 /**
19596 * Adds hooks for finding items.
19597 *
19598 * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`
19599 * function must return `true` if it was able to add item to the queue.
19600 * @return {this} Instance of plugin for chaining.
19601 */
19602 registerFindHook(addHook: (...params: any[]) => any): this;
19603 /**
19604 * Adds hooks for uploading items.
19605 *
19606 * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and
19607 * function must return `true` if it was able to handle upload of item.
19608 * @return {this} Instance of plugin for chaining.
19609 */
19610 registerUploadHook(uploadHook: (...params: any[]) => any): this;
19611 /**
19612 * Manually add an item to the uploading queue.
19613 *
19614 * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to
19615 * add to the queue
19616 * @return {this} Instance of plugin for chaining.
19617 */
19618 add(item: PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | any): this;
19619 /**
19620 * Destroys the plugin, don't use after this.
19621 *
19622 */
19623 destroy(): void;
19624 }
19625 /**
19626 * CountLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified
19627 * number of items per frame.
19628 *
19629 * @class
19630 * @memberof PIXI
19631 */
19632 class CountLimiter {
19633 constructor(maxItemsPerFrame: number);
19634 /**
19635 * Resets any counting properties to start fresh on a new frame.
19636 */
19637 beginFrame(): void;
19638 /**
19639 * Checks to see if another item can be uploaded. This should only be called once per item.
19640 * @return {boolean} If the item is allowed to be uploaded.
19641 */
19642 allowedToUpload(): boolean;
19643 }
19644 /**
19645 * The prepare plugin provides renderer-specific plugins for pre-rendering DisplayObjects. These plugins are useful for
19646 * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.
19647 *
19648 * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.
19649 * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.
19650 * @example
19651 * // Create a new application
19652 * const app = new PIXI.Application();
19653 * document.body.appendChild(app.view);
19654 *
19655 * // Don't start rendering right away
19656 * app.stop();
19657 *
19658 * // create a display object
19659 * const rect = new PIXI.Graphics()
19660 * .beginFill(0x00ff00)
19661 * .drawRect(40, 40, 200, 200);
19662 *
19663 * // Add to the stage
19664 * app.stage.addChild(rect);
19665 *
19666 * // Don't start rendering until the graphic is uploaded to the GPU
19667 * app.renderer.plugins.prepare.upload(app.stage, () => {
19668 * app.start();
19669 * });
19670 *
19671 * @class
19672 * @extends PIXI.BasePrepare
19673 * @memberof PIXI
19674 */
19675 class Prepare extends PIXI.BasePrepare {
19676 constructor(renderer: PIXI.Renderer);
19677 /**
19678 * The limiter to be used to control how quickly items are prepared.
19679 * @type {PIXI.CountLimiter|PIXI.TimeLimiter}
19680 */
19681 limiter: PIXI.CountLimiter | PIXI.TimeLimiter;
19682 /**
19683 * Reference to the renderer.
19684 * @type {PIXI.AbstractRenderer}
19685 * @protected
19686 */
19687 protected renderer: PIXI.AbstractRenderer;
19688 /**
19689 * The only real difference between CanvasPrepare and Prepare is what they pass
19690 * to upload hooks. That different parameter is stored here.
19691 * @type {object}
19692 * @protected
19693 */
19694 protected uploadHookHelper: any;
19695 /**
19696 * Upload all the textures and graphics to the GPU.
19697 *
19698 * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item -
19699 * Either the container or display object to search for items to upload, the items to upload themselves,
19700 * or the callback function, if items have been added using `prepare.add`.
19701 * @param {Function} [done] - Optional callback when all queued uploads have completed
19702 */
19703 upload(item: ((...params: any[]) => any) | PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text, done?: (...params: any[]) => any): void;
19704 /**
19705 * Adds hooks for finding items.
19706 *
19707 * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`
19708 * function must return `true` if it was able to add item to the queue.
19709 * @return {this} Instance of plugin for chaining.
19710 */
19711 registerFindHook(addHook: (...params: any[]) => any): this;
19712 /**
19713 * Adds hooks for uploading items.
19714 *
19715 * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and
19716 * function must return `true` if it was able to handle upload of item.
19717 * @return {this} Instance of plugin for chaining.
19718 */
19719 registerUploadHook(uploadHook: (...params: any[]) => any): this;
19720 /**
19721 * Manually add an item to the uploading queue.
19722 *
19723 * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to
19724 * add to the queue
19725 * @return {this} Instance of plugin for chaining.
19726 */
19727 add(item: PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | any): this;
19728 /**
19729 * Destroys the plugin, don't use after this.
19730 *
19731 */
19732 destroy(): void;
19733 }
19734 /**
19735 * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified
19736 * number of milliseconds per frame.
19737 *
19738 * @class
19739 * @memberof PIXI
19740 */
19741 class TimeLimiter {
19742 constructor(maxMilliseconds: number);
19743 /**
19744 * Resets any counting properties to start fresh on a new frame.
19745 */
19746 beginFrame(): void;
19747 /**
19748 * Checks to see if another item can be uploaded. This should only be called once per item.
19749 * @return {boolean} If the item is allowed to be uploaded.
19750 */
19751 allowedToUpload(): boolean;
19752 }
19753 /**
19754 * A Runner is a highly performant and simple alternative to signals. Best used in situations
19755 * where events are dispatched to many objects at high frequency (say every frame!)
19756 *
19757 *
19758 * like a signal..
19759 * ```
19760 * import { Runner } from '@pixi/runner';
19761 *
19762 * const myObject = {
19763 * loaded: new Runner('loaded')
19764 * }
19765 *
19766 * const listener = {
19767 * loaded: function(){
19768 * // thin
19769 * }
19770 * }
19771 *
19772 * myObject.update.add(listener);
19773 *
19774 * myObject.loaded.emit();
19775 * ```
19776 *
19777 * Or for handling calling the same function on many items
19778 * ```
19779 * import { Runner } from '@pixi/runner';
19780 *
19781 * const myGame = {
19782 * update: new Runner('update')
19783 * }
19784 *
19785 * const gameObject = {
19786 * update: function(time){
19787 * // update my gamey state
19788 * }
19789 * }
19790 *
19791 * myGame.update.add(gameObject1);
19792 *
19793 * myGame.update.emit(time);
19794 * ```
19795 * @class
19796 * @memberof PIXI
19797 */
19798 class Runner {
19799 constructor(name: string);
19800 /**
19801 * Dispatch/Broadcast Runner to all listeners added to the queue.
19802 * @param {...any} params - optional parameters to pass to each listener
19803 * @return {PIXI.Runner}
19804 */
19805 emit(...params: any[]): PIXI.Runner;
19806 /**
19807 * Add a listener to the Runner
19808 *
19809 * Runners do not need to have scope or functions passed to them.
19810 * All that is required is to pass the listening object and ensure that it has contains a function that has the same name
19811 * as the name provided to the Runner when it was created.
19812 *
19813 * Eg A listener passed to this Runner will require a 'complete' function.
19814 *
19815 * ```
19816 * import { Runner } from '@pixi/runner';
19817 *
19818 * const complete = new Runner('complete');
19819 * ```
19820 *
19821 * The scope used will be the object itself.
19822 *
19823 * @param {any} item - The object that will be listening.
19824 * @return {PIXI.Runner}
19825 */
19826 add(item: any): PIXI.Runner;
19827 /**
19828 * Remove a single listener from the dispatch queue.
19829 * @param {any} item - The listenr that you would like to remove.
19830 * @return {PIXI.Runner}
19831 */
19832 remove(item: any): PIXI.Runner;
19833 /**
19834 * Check to see if the listener is already in the Runner
19835 * @param {any} item - The listener that you would like to check.
19836 */
19837 contains(item: any): void;
19838 /**
19839 * Remove all listeners from the Runner
19840 * @return {PIXI.Runner}
19841 */
19842 removeAll(): PIXI.Runner;
19843 /**
19844 * Remove all references, don't use after this.
19845 */
19846 destroy(): void;
19847 /**
19848 * `true` if there are no this Runner contains no listeners
19849 *
19850 * @member {boolean}
19851 * @readonly
19852 */
19853 readonly empty: boolean;
19854 /**
19855 * The name of the runner.
19856 *
19857 * @member {string}
19858 * @readonly
19859 */
19860 readonly name: string;
19861 /**
19862 * Alias for `emit`
19863 * @memberof PIXI.Runner#
19864 * @method dispatch
19865 * @see PIXI.Runner#emit
19866 */
19867 dispatch(): void;
19868 /**
19869 * Alias for `emit`
19870 * @memberof PIXI.Runner#
19871 * @method run
19872 * @see PIXI.Runner#emit
19873 */
19874 run(): void;
19875 }
19876 /**
19877 * User's customizable globals for overriding the default PIXI settings, such
19878 * as a renderer's default resolution, framerate, float precision, etc.
19879 * @example
19880 * // Use the native window resolution as the default resolution
19881 * // will support high-density displays when rendering
19882 * PIXI.settings.RESOLUTION = window.devicePixelRatio;
19883 *
19884 * // Disable interpolation when scaling, will make texture be pixelated
19885 * PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;
19886 * @namespace PIXI.settings
19887 */
19888 namespace settings {
19889 /**
19890 * Default `canvasPadding` for canvas-based Mesh rendering.
19891 *
19892 * @see PIXI.Mesh2d#canvasPadding
19893 * @static
19894 * @name MESH_CANVAS_PADDING
19895 * @memberof PIXI.settings
19896 * @type {number}
19897 * @default 0
19898 */
19899 var MESH_CANVAS_PADDING: number;
19900 /**
19901 * The maximum support for using WebGL. If a device does not
19902 * support WebGL version, for instance WebGL 2, it will still
19903 * attempt to fallback support to WebGL 1. If you want to
19904 * explicitly remove feature support to target a more stable
19905 * baseline, prefer a lower environment.
19906 *
19907 * Due to {@link https://bugs.chromium.org/p/chromium/issues/detail?id=934823|bug in chromium}
19908 * we disable webgl2 by default for all non-apple mobile devices.
19909 *
19910 * @static
19911 * @name PREFER_ENV
19912 * @memberof PIXI.settings
19913 * @type {number}
19914 * @default PIXI.ENV.WEBGL2
19915 */
19916 var PREFER_ENV: number;
19917 /**
19918 * If set to `true`, *only* Textures and BaseTexture objects stored
19919 * in the caches ({@link PIXI.utils.TextureCache TextureCache} and
19920 * {@link PIXI.utils.BaseTextureCache BaseTextureCache}) can be
19921 * used when calling {@link PIXI.Texture.from Texture.from} or
19922 * {@link PIXI.BaseTexture.from BaseTexture.from}.
19923 * Otherwise, these `from` calls throw an exception. Using this property
19924 * can be useful if you want to enforce preloading all assets with
19925 * {@link PIXI.Loader Loader}.
19926 *
19927 * @static
19928 * @name STRICT_TEXTURE_CACHE
19929 * @memberof PIXI.settings
19930 * @type {boolean}
19931 * @default false
19932 */
19933 var STRICT_TEXTURE_CACHE: boolean;
19934 /**
19935 * Sets the default value for the container property 'sortableChildren'.
19936 * If set to true, the container will sort its children by zIndex value
19937 * when updateTransform() is called, or manually if sortChildren() is called.
19938 *
19939 * This actually changes the order of elements in the array, so should be treated
19940 * as a basic solution that is not performant compared to other solutions,
19941 * such as @link https://github.com/pixijs/pixi-display
19942 *
19943 * Also be aware of that this may not work nicely with the addChildAt() function,
19944 * as the zIndex sorting may cause the child to automatically sorted to another position.
19945 *
19946 * @static
19947 * @constant
19948 * @name SORTABLE_CHILDREN
19949 * @memberof PIXI.settings
19950 * @type {boolean}
19951 * @default false
19952 */
19953 var SORTABLE_CHILDREN: boolean;
19954 /**
19955 * Default number of uploads per frame using prepare plugin.
19956 *
19957 * @static
19958 * @memberof PIXI.settings
19959 * @name UPLOADS_PER_FRAME
19960 * @type {number}
19961 * @default 4
19962 */
19963 var UPLOADS_PER_FRAME: number;
19964 /**
19965 * If set to true WebGL will attempt make textures mimpaped by default.
19966 * Mipmapping will only succeed if the base texture uploaded has power of two dimensions.
19967 *
19968 * @static
19969 * @name MIPMAP_TEXTURES
19970 * @memberof PIXI.settings
19971 * @type {PIXI.MIPMAP_MODES}
19972 * @default PIXI.MIPMAP_MODES.POW2
19973 */
19974 var MIPMAP_TEXTURES: PIXI.MIPMAP_MODES;
19975 /**
19976 * Default anisotropic filtering level of textures.
19977 * Usually from 0 to 16
19978 *
19979 * @static
19980 * @name ANISOTROPIC_LEVEL
19981 * @memberof PIXI.settings
19982 * @type {number}
19983 * @default 0
19984 */
19985 var ANISOTROPIC_LEVEL: number;
19986 /**
19987 * Default resolution / device pixel ratio of the renderer.
19988 *
19989 * @static
19990 * @name RESOLUTION
19991 * @memberof PIXI.settings
19992 * @type {number}
19993 * @default 1
19994 */
19995 var RESOLUTION: number;
19996 /**
19997 * Default filter resolution.
19998 *
19999 * @static
20000 * @name FILTER_RESOLUTION
20001 * @memberof PIXI.settings
20002 * @type {number}
20003 * @default 1
20004 */
20005 var FILTER_RESOLUTION: number;
20006 /**
20007 * The maximum textures that this device supports.
20008 *
20009 * @static
20010 * @name SPRITE_MAX_TEXTURES
20011 * @memberof PIXI.settings
20012 * @type {number}
20013 * @default 32
20014 */
20015 var SPRITE_MAX_TEXTURES: number;
20016 /**
20017 * The default sprite batch size.
20018 *
20019 * The default aims to balance desktop and mobile devices.
20020 *
20021 * @static
20022 * @name SPRITE_BATCH_SIZE
20023 * @memberof PIXI.settings
20024 * @type {number}
20025 * @default 4096
20026 */
20027 var SPRITE_BATCH_SIZE: number;
20028 /**
20029 * The default render options if none are supplied to {@link PIXI.Renderer}
20030 * or {@link PIXI.CanvasRenderer}.
20031 *
20032 * @static
20033 * @name RENDER_OPTIONS
20034 * @memberof PIXI.settings
20035 * @type {object}
20036 * @property {HTMLCanvasElement} view=null
20037 * @property {number} resolution=1
20038 * @property {boolean} antialias=false
20039 * @property {boolean} autoDensity=false
20040 * @property {boolean} transparent=false
20041 * @property {number} backgroundColor=0x000000
20042 * @property {boolean} clearBeforeRender=true
20043 * @property {boolean} preserveDrawingBuffer=false
20044 * @property {number} width=800
20045 * @property {number} height=600
20046 * @property {boolean} legacy=false
20047 */
20048 var RENDER_OPTIONS: {
20049 view: HTMLCanvasElement;
20050 resolution: number;
20051 antialias: boolean;
20052 autoDensity: boolean;
20053 transparent: boolean;
20054 backgroundColor: number;
20055 clearBeforeRender: boolean;
20056 preserveDrawingBuffer: boolean;
20057 width: number;
20058 height: number;
20059 legacy: boolean;
20060 };
20061 /**
20062 * Default Garbage Collection mode.
20063 *
20064 * @static
20065 * @name GC_MODE
20066 * @memberof PIXI.settings
20067 * @type {PIXI.GC_MODES}
20068 * @default PIXI.GC_MODES.AUTO
20069 */
20070 var GC_MODE: PIXI.GC_MODES;
20071 /**
20072 * Default Garbage Collection max idle.
20073 *
20074 * @static
20075 * @name GC_MAX_IDLE
20076 * @memberof PIXI.settings
20077 * @type {number}
20078 * @default 3600
20079 */
20080 var GC_MAX_IDLE: number;
20081 /**
20082 * Default Garbage Collection maximum check count.
20083 *
20084 * @static
20085 * @name GC_MAX_CHECK_COUNT
20086 * @memberof PIXI.settings
20087 * @type {number}
20088 * @default 600
20089 */
20090 var GC_MAX_CHECK_COUNT: number;
20091 /**
20092 * Default wrap modes that are supported by pixi.
20093 *
20094 * @static
20095 * @name WRAP_MODE
20096 * @memberof PIXI.settings
20097 * @type {PIXI.WRAP_MODES}
20098 * @default PIXI.WRAP_MODES.CLAMP
20099 */
20100 var WRAP_MODE: PIXI.WRAP_MODES;
20101 /**
20102 * Default scale mode for textures.
20103 *
20104 * @static
20105 * @name SCALE_MODE
20106 * @memberof PIXI.settings
20107 * @type {PIXI.SCALE_MODES}
20108 * @default PIXI.SCALE_MODES.LINEAR
20109 */
20110 var SCALE_MODE: PIXI.SCALE_MODES;
20111 /**
20112 * Default specify float precision in vertex shader.
20113 *
20114 * @static
20115 * @name PRECISION_VERTEX
20116 * @memberof PIXI.settings
20117 * @type {PIXI.PRECISION}
20118 * @default PIXI.PRECISION.HIGH
20119 */
20120 var PRECISION_VERTEX: PIXI.PRECISION;
20121 /**
20122 * Default specify float precision in fragment shader.
20123 * iOS is best set at highp due to https://github.com/pixijs/pixi.js/issues/3742
20124 *
20125 * @static
20126 * @name PRECISION_FRAGMENT
20127 * @memberof PIXI.settings
20128 * @type {PIXI.PRECISION}
20129 * @default PIXI.PRECISION.MEDIUM
20130 */
20131 var PRECISION_FRAGMENT: PIXI.PRECISION;
20132 /**
20133 * Can we upload the same buffer in a single frame?
20134 *
20135 * @static
20136 * @name CAN_UPLOAD_SAME_BUFFER
20137 * @memberof PIXI.settings
20138 * @type {boolean}
20139 */
20140 var CAN_UPLOAD_SAME_BUFFER: boolean;
20141 /**
20142 * Enables bitmap creation before image load. This feature is experimental.
20143 *
20144 * @static
20145 * @name CREATE_IMAGE_BITMAP
20146 * @memberof PIXI.settings
20147 * @type {boolean}
20148 * @default false
20149 */
20150 var CREATE_IMAGE_BITMAP: boolean;
20151 /**
20152 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
20153 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
20154 * The main disadvantage is movement of objects may appear less smooth.
20155 *
20156 * @static
20157 * @constant
20158 * @memberof PIXI.settings
20159 * @type {boolean}
20160 * @default false
20161 */
20162 var ROUND_PIXELS: boolean;
20163 /**
20164 * Target frames per millisecond.
20165 *
20166 * @static
20167 * @name TARGET_FPMS
20168 * @memberof PIXI.settings
20169 * @type {number}
20170 * @default 0.06
20171 */
20172 var TARGET_FPMS: number;
20173 /**
20174 * The prefix that denotes a URL is for a retina asset.
20175 *
20176 * @static
20177 * @name RETINA_PREFIX
20178 * @memberof PIXI.settings
20179 * @type {RegExp}
20180 * @default /@([0-9\.]+)x/
20181 * @example `@2x`
20182 */
20183 var RETINA_PREFIX: RegExp;
20184 /**
20185 * Should the `failIfMajorPerformanceCaveat` flag be enabled as a context option used in the `isWebGLSupported` function.
20186 * For most scenarios this should be left as true, as otherwise the user may have a poor experience.
20187 * However, it can be useful to disable under certain scenarios, such as headless unit tests.
20188 *
20189 * @static
20190 * @name FAIL_IF_MAJOR_PERFORMANCE_CAVEAT
20191 * @memberof PIXI.settings
20192 * @type {boolean}
20193 * @default true
20194 */
20195 var FAIL_IF_MAJOR_PERFORMANCE_CAVEAT: boolean;
20196 }
20197 /**
20198 * The Sprite object is the base for all textured objects that are rendered to the screen
20199 *
20200 * A sprite can be created directly from an image like this:
20201 *
20202 * ```js
20203 * let sprite = PIXI.Sprite.from('assets/image.png');
20204 * ```
20205 *
20206 * The more efficient way to create sprites is using a {@link PIXI.Spritesheet},
20207 * as swapping base textures when rendering to the screen is inefficient.
20208 *
20209 * ```js
20210 * PIXI.Loader.shared.add("assets/spritesheet.json").load(setup);
20211 *
20212 * function setup() {
20213 * let sheet = PIXI.Loader.shared.resources["assets/spritesheet.json"].spritesheet;
20214 * let sprite = new PIXI.Sprite(sheet.textures["image.png"]);
20215 * ...
20216 * }
20217 * ```
20218 *
20219 * @class
20220 * @extends PIXI.Container
20221 * @memberof PIXI
20222 */
20223 class Sprite extends PIXI.Container {
20224 constructor(texture?: PIXI.Texture);
20225 /**
20226 * Cached tinted texture.
20227 * @memberof PIXI.Sprite#
20228 * @member {HTMLCanvasElement} _tintedCanvas
20229 * @protected
20230 */
20231 protected _tintedCanvas: HTMLCanvasElement;
20232 /**
20233 * The width of the sprite (this is initially set by the texture)
20234 *
20235 * @protected
20236 * @member {number} PIXI.Sprite#_width
20237 */
20238 protected _width: number;
20239 /**
20240 * The height of the sprite (this is initially set by the texture)
20241 *
20242 * @protected
20243 * @member {number} PIXI.Sprite#_height
20244 */
20245 protected _height: number;
20246 /**
20247 * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
20248 *
20249 * @member {number} PIXI.Sprite#blendMode
20250 * @default PIXI.BLEND_MODES.NORMAL
20251 * @see PIXI.BLEND_MODES
20252 */
20253 blendMode: number;
20254 /**
20255 * Cached tint value so we can tell when the tint is changed.
20256 * Value is used for 2d CanvasRenderer.
20257 *
20258 * @protected
20259 * @member {number} PIXI.Sprite#_cachedTint
20260 * @default 0xFFFFFF
20261 */
20262 protected _cachedTint: number;
20263 /**
20264 * Plugin that is responsible for rendering this element.
20265 * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods.
20266 *
20267 * @member {string} PIXI.Sprite#pluginName
20268 * @default 'batch'
20269 */
20270 pluginName: string;
20271 /**
20272 * used to fast check if a sprite is.. a sprite!
20273 * @member {boolean} PIXI.Sprite#isSprite
20274 */
20275 isSprite: boolean;
20276 /**
20277 * When the texture is updated, this event will fire to update the scale and frame
20278 *
20279 * @protected
20280 */
20281 protected _onTextureUpdate(): void;
20282 /**
20283 * calculates worldTransform * vertices, store it in vertexData
20284 */
20285 calculateVertices(): void;
20286 /**
20287 * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData
20288 * This is used to ensure that the true width and height of a trimmed texture is respected
20289 */
20290 calculateTrimmedVertices(): void;
20291 /**
20292 *
20293 * Renders the object using the WebGL renderer
20294 *
20295 * @protected
20296 * @param {PIXI.Renderer} renderer - The webgl renderer to use.
20297 */
20298 protected _render(renderer: PIXI.Renderer): void;
20299 /**
20300 * Updates the bounds of the sprite.
20301 *
20302 * @protected
20303 */
20304 protected _calculateBounds(): void;
20305 /**
20306 * Gets the local bounds of the sprite object.
20307 *
20308 * @param {PIXI.Rectangle} [rect] - The output rectangle.
20309 * @return {PIXI.Rectangle} The bounds.
20310 */
20311 getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle;
20312 /**
20313 * Tests if a point is inside this sprite
20314 *
20315 * @param {PIXI.IPointData} point - the point to test
20316 * @return {boolean} the result of the test
20317 */
20318 containsPoint(point: PIXI.IPointData): boolean;
20319 /**
20320 * Destroys this sprite and optionally its texture and children
20321 *
20322 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
20323 * have been set to that value
20324 * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy
20325 * method called as well. 'options' will be passed on to those calls.
20326 * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well
20327 * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well
20328 */
20329 destroy(options?: {
20330 children?: boolean;
20331 texture?: boolean;
20332 baseTexture?: boolean;
20333 }): void;
20334 /**
20335 * Helper function that creates a new sprite based on the source you provide.
20336 * The source can be - frame id, image url, video url, canvas element, video element, base texture
20337 *
20338 * @static
20339 * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from
20340 * @param {object} [options] - See {@link PIXI.BaseTexture}'s constructor for options.
20341 * @return {PIXI.Sprite} The newly created sprite
20342 */
20343 static from(source: string | PIXI.Texture | HTMLCanvasElement | HTMLVideoElement, options?: any): PIXI.Sprite;
20344 /**
20345 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
20346 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
20347 * The main disadvantage is movement of objects may appear less smooth.
20348 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
20349 *
20350 * @member {boolean}
20351 * @default false
20352 */
20353 roundPixels: boolean;
20354 /**
20355 * The width of the sprite, setting this will actually modify the scale to achieve the value set
20356 *
20357 * @member {number}
20358 */
20359 width: number;
20360 /**
20361 * The height of the sprite, setting this will actually modify the scale to achieve the value set
20362 *
20363 * @member {number}
20364 */
20365 height: number;
20366 /**
20367 * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}
20368 * and passed to the constructor.
20369 *
20370 * The default is `(0,0)`, this means the sprite's origin is the top left.
20371 *
20372 * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.
20373 *
20374 * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.
20375 *
20376 * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.
20377 *
20378 * @example
20379 * const sprite = new PIXI.Sprite(texture);
20380 * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).
20381 *
20382 * @member {PIXI.ObservablePoint}
20383 */
20384 anchor: PIXI.ObservablePoint;
20385 /**
20386 * The tint applied to the sprite. This is a hex value.
20387 * A value of 0xFFFFFF will remove any tint effect.
20388 *
20389 * @member {number}
20390 * @default 0xFFFFFF
20391 */
20392 tint: number;
20393 /**
20394 * The texture that the sprite is using
20395 *
20396 * @member {PIXI.Texture}
20397 */
20398 texture: PIXI.Texture;
20399 /**
20400 * Renders the object using the Canvas renderer
20401 * @method renderCanvas
20402 * @memberof PIXI.Container#
20403 * @param {PIXI.CanvasRenderer} renderer - The renderer
20404 */
20405 renderCanvas(renderer: PIXI.CanvasRenderer): void;
20406 /**
20407 * The array of children of this container.
20408 *
20409 * @member {PIXI.DisplayObject[]} PIXI.Container#children
20410 * @readonly
20411 */
20412 readonly children: PIXI.DisplayObject[];
20413 /**
20414 * If set to true, the container will sort its children by zIndex value
20415 * when updateTransform() is called, or manually if sortChildren() is called.
20416 *
20417 * This actually changes the order of elements in the array, so should be treated
20418 * as a basic solution that is not performant compared to other solutions,
20419 * such as @link https://github.com/pixijs/pixi-display
20420 *
20421 * Also be aware of that this may not work nicely with the addChildAt() function,
20422 * as the zIndex sorting may cause the child to automatically sorted to another position.
20423 *
20424 * @see PIXI.settings.SORTABLE_CHILDREN
20425 *
20426 * @member {boolean} PIXI.Container#sortableChildren
20427 */
20428 sortableChildren: boolean;
20429 /**
20430 * Should children be sorted by zIndex at the next updateTransform call.
20431 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
20432 *
20433 * @member {boolean} PIXI.Container#sortDirty
20434 */
20435 sortDirty: boolean;
20436 /**
20437 * Overridable method that can be used by Container subclasses whenever the children array is modified
20438 *
20439 * @protected
20440 */
20441 protected onChildrenChange(): void;
20442 /**
20443 * Adds one or more children to the container.
20444 *
20445 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
20446 *
20447 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
20448 * @return {PIXI.DisplayObject} The first child that was added.
20449 */
20450 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
20451 /**
20452 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
20453 *
20454 * @param {PIXI.DisplayObject} child - The child to add
20455 * @param {number} index - The index to place the child in
20456 * @return {PIXI.DisplayObject} The child that was added.
20457 */
20458 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
20459 /**
20460 * Swaps the position of 2 Display Objects within this container.
20461 *
20462 * @param {PIXI.DisplayObject} child - First display object to swap
20463 * @param {PIXI.DisplayObject} child2 - Second display object to swap
20464 */
20465 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
20466 /**
20467 * Returns the index position of a child DisplayObject instance
20468 *
20469 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
20470 * @return {number} The index position of the child display object to identify
20471 */
20472 getChildIndex(child: PIXI.DisplayObject): number;
20473 /**
20474 * Changes the position of an existing child in the display object container
20475 *
20476 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
20477 * @param {number} index - The resulting index number for the child display object
20478 */
20479 setChildIndex(child: PIXI.DisplayObject, index: number): void;
20480 /**
20481 * Returns the child at the specified index
20482 *
20483 * @param {number} index - The index to get the child at
20484 * @return {PIXI.DisplayObject} The child at the given index, if any.
20485 */
20486 getChildAt(index: number): PIXI.DisplayObject;
20487 /**
20488 * Removes one or more children from the container.
20489 *
20490 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
20491 * @return {PIXI.DisplayObject} The first child that was removed.
20492 */
20493 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
20494 /**
20495 * Removes a child from the specified index position.
20496 *
20497 * @param {number} index - The index to get the child from
20498 * @return {PIXI.DisplayObject} The child that was removed.
20499 */
20500 removeChildAt(index: number): PIXI.DisplayObject;
20501 /**
20502 * Removes all children from this container that are within the begin and end indexes.
20503 *
20504 * @param {number} [beginIndex=0] - The beginning position.
20505 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
20506 * @returns {PIXI.DisplayObject[]} List of removed children
20507 */
20508 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
20509 /**
20510 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
20511 */
20512 sortChildren(): void;
20513 /**
20514 * Updates the transform on all children of this container for rendering
20515 */
20516 updateTransform(): void;
20517 /**
20518 * Recalculates the bounds of the container.
20519 *
20520 */
20521 calculateBounds(): void;
20522 /**
20523 * Renders the object using the WebGL renderer
20524 *
20525 * @param {PIXI.Renderer} renderer - The renderer
20526 */
20527 render(renderer: PIXI.Renderer): void;
20528 /**
20529 * Render the object using the WebGL renderer and advanced features.
20530 *
20531 * @protected
20532 * @param {PIXI.Renderer} renderer - The renderer
20533 */
20534 protected renderAdvanced(renderer: PIXI.Renderer): void;
20535 /**
20536 * Container default updateTransform, does update children of container.
20537 * Will crash if there's no parent element.
20538 *
20539 * @memberof PIXI.Container#
20540 * @function containerUpdateTransform
20541 */
20542 containerUpdateTransform(): void;
20543 /**
20544 * Determines if the children to the displayObject can be clicked/touched
20545 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
20546 *
20547 * @member {boolean}
20548 * @memberof PIXI.Container#
20549 */
20550 interactiveChildren: boolean;
20551 /**
20552 * Returns the display object in the container.
20553 *
20554 * Recursive searches are done in a preorder traversal.
20555 *
20556 * @method getChildByName
20557 * @memberof PIXI.Container#
20558 * @param {string} name - Instance name.
20559 * @param {boolean}[deep=false] - Whether to search recursively
20560 * @return {PIXI.DisplayObject} The child with the specified name.
20561 */
20562 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
20563 /**
20564 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
20565 * shadow div with attributes set
20566 *
20567 * @member {boolean}
20568 * @memberof PIXI.DisplayObject#
20569 */
20570 accessible: boolean;
20571 /**
20572 * Sets the title attribute of the shadow div
20573 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
20574 *
20575 * @member {?string}
20576 * @memberof PIXI.DisplayObject#
20577 */
20578 accessibleTitle: string;
20579 /**
20580 * Sets the aria-label attribute of the shadow div
20581 *
20582 * @member {string}
20583 * @memberof PIXI.DisplayObject#
20584 */
20585 accessibleHint: string;
20586 /**
20587 * @member {boolean}
20588 * @memberof PIXI.DisplayObject#
20589 * @todo Needs docs.
20590 */
20591 _accessibleActive: boolean;
20592 /**
20593 * @member {boolean}
20594 * @memberof PIXI.DisplayObject#
20595 * @todo Needs docs.
20596 */
20597 _accessibleDiv: boolean;
20598 /**
20599 * Specify the type of div the accessible layer is. Screen readers treat the element differently
20600 * depending on this type. Defaults to button.
20601 *
20602 * @member {string}
20603 * @memberof PIXI.DisplayObject#
20604 * @default 'button'
20605 */
20606 accessibleType: string;
20607 /**
20608 * Specify the pointer-events the accessible div will use
20609 * Defaults to auto.
20610 *
20611 * @member {string}
20612 * @memberof PIXI.DisplayObject#
20613 * @default 'auto'
20614 */
20615 accessiblePointerEvents: string;
20616 /**
20617 * Setting to false will prevent any children inside this container to
20618 * be accessible. Defaults to true.
20619 *
20620 * @member {boolean}
20621 * @memberof PIXI.DisplayObject#
20622 * @default true
20623 */
20624 accessibleChildren: boolean;
20625 /**
20626 * World transform and local transform of this object.
20627 * This will become read-only later, please do not assign anything there unless you know what are you doing.
20628 *
20629 * @member {PIXI.Transform} PIXI.DisplayObject#transform
20630 */
20631 transform: PIXI.Transform;
20632 /**
20633 * The opacity of the object.
20634 *
20635 * @member {number} PIXI.DisplayObject#alpha
20636 */
20637 alpha: number;
20638 /**
20639 * The visibility of the object. If false the object will not be drawn, and
20640 * the updateTransform function will not be called.
20641 *
20642 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
20643 *
20644 * @member {boolean} PIXI.DisplayObject#visible
20645 */
20646 visible: boolean;
20647 /**
20648 * Can this object be rendered, if false the object will not be drawn but the updateTransform
20649 * methods will still be called.
20650 *
20651 * Only affects recursive calls from parent. You can ask for bounds manually.
20652 *
20653 * @member {boolean} PIXI.DisplayObject#renderable
20654 */
20655 renderable: boolean;
20656 /**
20657 * The display object container that contains this display object.
20658 *
20659 * @member {PIXI.Container} PIXI.DisplayObject#parent
20660 */
20661 parent: PIXI.Container;
20662 /**
20663 * The multiplied alpha of the displayObject.
20664 *
20665 * @member {number} PIXI.DisplayObject#worldAlpha
20666 * @readonly
20667 */
20668 readonly worldAlpha: number;
20669 /**
20670 * Which index in the children array the display component was before the previous zIndex sort.
20671 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
20672 *
20673 * @member {number} PIXI.DisplayObject#_lastSortedIndex
20674 * @protected
20675 */
20676 protected _lastSortedIndex: number;
20677 /**
20678 * The zIndex of the displayObject.
20679 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
20680 *
20681 * @member {number} PIXI.DisplayObject#_zIndex
20682 * @protected
20683 */
20684 protected _zIndex: number;
20685 /**
20686 * The area the filter is applied to. This is used as more of an optimization
20687 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
20688 *
20689 * Also works as an interaction mask.
20690 *
20691 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
20692 */
20693 filterArea: PIXI.Rectangle;
20694 /**
20695 * Sets the filters for the displayObject.
20696 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
20697 * To remove filters simply set this property to `'null'`.
20698 *
20699 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
20700 */
20701 filters: PIXI.Filter[];
20702 /**
20703 * Currently enabled filters
20704 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
20705 * @protected
20706 */
20707 protected _enabledFilters: PIXI.Filter[];
20708 /**
20709 * The bounds object, this is used to calculate and store the bounds of the displayObject.
20710 *
20711 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
20712 */
20713 _bounds: PIXI.Bounds;
20714 /**
20715 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
20716 *
20717 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
20718 */
20719 _localBounds: PIXI.Bounds;
20720 /**
20721 * Flags the cached bounds as dirty.
20722 *
20723 * @member {number} PIXI.DisplayObject#_boundsID
20724 * @protected
20725 */
20726 protected _boundsID: number;
20727 /**
20728 * Cache of this display-object's bounds-rectangle.
20729 *
20730 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
20731 * @protected
20732 */
20733 protected _boundsRect: PIXI.Bounds;
20734 /**
20735 * Cache of this display-object's local-bounds rectangle.
20736 *
20737 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
20738 * @protected
20739 */
20740 protected _localBoundsRect: PIXI.Bounds;
20741 /**
20742 * The original, cached mask of the object.
20743 *
20744 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
20745 * @protected
20746 */
20747 protected _mask: PIXI.Container | PIXI.MaskData | null;
20748 /**
20749 * If the object has been destroyed via destroy(). If true, it should not be used.
20750 *
20751 * @member {boolean} PIXI.DisplayObject#_destroyed
20752 * @protected
20753 */
20754 protected _destroyed: boolean;
20755 /**
20756 * Does any other displayObject use this object as a mask?
20757 * @member {boolean} PIXI.DisplayObject#isMask
20758 */
20759 isMask: boolean;
20760 /**
20761 * Recursively updates transform of all objects from the root to this one
20762 * internal function for toLocal()
20763 */
20764 _recursivePostUpdateTransform(): void;
20765 /**
20766 * Retrieves the bounds of the displayObject as a rectangle object.
20767 *
20768 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
20769 * being updated. This means the calculation returned MAY be out of date BUT will give you a
20770 * nice performance boost.
20771 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
20772 * @return {PIXI.Rectangle} The rectangular bounding area.
20773 */
20774 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
20775 /**
20776 * Calculates the global position of the display object.
20777 *
20778 * @param {PIXI.IPointData} position - The world origin to calculate from.
20779 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
20780 * (otherwise will create a new Point).
20781 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
20782 * @return {PIXI.Point} A point object representing the position of this object.
20783 */
20784 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
20785 /**
20786 * Calculates the local position of the display object relative to another point.
20787 *
20788 * @param {PIXI.IPointData} position - The world origin to calculate from.
20789 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
20790 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
20791 * (otherwise will create a new Point).
20792 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
20793 * @return {PIXI.Point} A point object representing the position of this object
20794 */
20795 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
20796 /**
20797 * Set the parent Container of this DisplayObject.
20798 *
20799 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
20800 * @return {PIXI.Container} The Container that this DisplayObject was added to.
20801 */
20802 setParent(container: PIXI.Container): PIXI.Container;
20803 /**
20804 * Convenience function to set the position, scale, skew and pivot at once.
20805 *
20806 * @param {number} [x=0] - The X position
20807 * @param {number} [y=0] - The Y position
20808 * @param {number} [scaleX=1] - The X scale value
20809 * @param {number} [scaleY=1] - The Y scale value
20810 * @param {number} [rotation=0] - The rotation
20811 * @param {number} [skewX=0] - The X skew value
20812 * @param {number} [skewY=0] - The Y skew value
20813 * @param {number} [pivotX=0] - The X pivot value
20814 * @param {number} [pivotY=0] - The Y pivot value
20815 * @return {PIXI.DisplayObject} The DisplayObject instance
20816 */
20817 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
20818 /**
20819 * @protected
20820 * @member {PIXI.Container}
20821 */
20822 protected _tempDisplayObjectParent: PIXI.Container;
20823 /**
20824 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
20825 *
20826 * ```
20827 * const cacheParent = elem.enableTempParent();
20828 * elem.updateTransform();
20829 * elem.disableTempParent(cacheParent);
20830 * ```
20831 *
20832 * @returns {PIXI.DisplayObject} current parent
20833 */
20834 enableTempParent(): PIXI.DisplayObject;
20835 /**
20836 * Pair method for `enableTempParent`
20837 * @param {PIXI.DisplayObject} cacheParent actual parent of element
20838 */
20839 disableTempParent(cacheParent: PIXI.DisplayObject): void;
20840 /**
20841 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
20842 * An alias to position.x
20843 *
20844 * @member {number}
20845 */
20846 x: number;
20847 /**
20848 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
20849 * An alias to position.y
20850 *
20851 * @member {number}
20852 */
20853 y: number;
20854 /**
20855 * Current transform of the object based on world (parent) factors.
20856 *
20857 * @member {PIXI.Matrix}
20858 * @readonly
20859 */
20860 readonly worldTransform: PIXI.Matrix;
20861 /**
20862 * Current transform of the object based on local factors: position, scale, other stuff.
20863 *
20864 * @member {PIXI.Matrix}
20865 * @readonly
20866 */
20867 readonly localTransform: PIXI.Matrix;
20868 /**
20869 * The coordinate of the object relative to the local coordinates of the parent.
20870 * Assignment by value since pixi-v4.
20871 *
20872 * @member {PIXI.ObservablePoint}
20873 */
20874 position: PIXI.ObservablePoint;
20875 /**
20876 * The scale factor of the object.
20877 * Assignment by value since pixi-v4.
20878 *
20879 * @member {PIXI.ObservablePoint}
20880 */
20881 scale: PIXI.ObservablePoint;
20882 /**
20883 * The pivot point of the displayObject that it rotates around.
20884 * Assignment by value since pixi-v4.
20885 *
20886 * @member {PIXI.ObservablePoint}
20887 */
20888 pivot: PIXI.ObservablePoint;
20889 /**
20890 * The skew factor for the object in radians.
20891 * Assignment by value since pixi-v4.
20892 *
20893 * @member {PIXI.ObservablePoint}
20894 */
20895 skew: PIXI.ObservablePoint;
20896 /**
20897 * The rotation of the object in radians.
20898 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
20899 *
20900 * @member {number}
20901 */
20902 rotation: number;
20903 /**
20904 * The angle of the object in degrees.
20905 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
20906 *
20907 * @member {number}
20908 */
20909 angle: number;
20910 /**
20911 * The zIndex of the displayObject.
20912 * If a container has the sortableChildren property set to true, children will be automatically
20913 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
20914 * and thus rendered on top of other displayObjects within the same container.
20915 *
20916 * @member {number}
20917 */
20918 zIndex: number;
20919 /**
20920 * Indicates if the object is globally visible.
20921 *
20922 * @member {boolean}
20923 * @readonly
20924 */
20925 readonly worldVisible: boolean;
20926 /**
20927 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
20928 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
20929 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
20930 * utilities shape clipping. To remove a mask, set this property to `null`.
20931 *
20932 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
20933 * @example
20934 * const graphics = new PIXI.Graphics();
20935 * graphics.beginFill(0xFF3300);
20936 * graphics.drawRect(50, 250, 100, 100);
20937 * graphics.endFill();
20938 *
20939 * const sprite = new PIXI.Sprite(texture);
20940 * sprite.mask = graphics;
20941 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
20942 *
20943 * @member {PIXI.Container|PIXI.MaskData|null}
20944 */
20945 mask: PIXI.Container | PIXI.MaskData | null;
20946 /**
20947 * DisplayObject default updateTransform, does not update children of container.
20948 * Will crash if there's no parent element.
20949 *
20950 * @memberof PIXI.DisplayObject#
20951 * @function displayObjectUpdateTransform
20952 */
20953 displayObjectUpdateTransform(): void;
20954 /**
20955 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
20956 * events will not be emitted unless `interactive` is set to `true`.
20957 *
20958 * @example
20959 * const sprite = new PIXI.Sprite(texture);
20960 * sprite.interactive = true;
20961 * sprite.on('tap', (event) => {
20962 * //handle event
20963 * });
20964 * @member {boolean}
20965 * @memberof PIXI.DisplayObject#
20966 */
20967 interactive: boolean;
20968 /**
20969 * Interaction shape. Children will be hit first, then this shape will be checked.
20970 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
20971 *
20972 * @example
20973 * const sprite = new PIXI.Sprite(texture);
20974 * sprite.interactive = true;
20975 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
20976 * @member {PIXI.IHitArea}
20977 * @memberof PIXI.DisplayObject#
20978 */
20979 hitArea: PIXI.IHitArea;
20980 /**
20981 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
20982 * Setting this changes the 'cursor' property to `'pointer'`.
20983 *
20984 * @example
20985 * const sprite = new PIXI.Sprite(texture);
20986 * sprite.interactive = true;
20987 * sprite.buttonMode = true;
20988 * @member {boolean}
20989 * @memberof PIXI.DisplayObject#
20990 */
20991 buttonMode: boolean;
20992 /**
20993 * This defines what cursor mode is used when the mouse cursor
20994 * is hovered over the displayObject.
20995 *
20996 * @example
20997 * const sprite = new PIXI.Sprite(texture);
20998 * sprite.interactive = true;
20999 * sprite.cursor = 'wait';
21000 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
21001 *
21002 * @member {string}
21003 * @memberof PIXI.DisplayObject#
21004 */
21005 cursor: string;
21006 /**
21007 * Set this to true if you want this display object to be cached as a bitmap.
21008 * This basically takes a snap shot of the display object as it is at that moment. It can
21009 * provide a performance benefit for complex static displayObjects.
21010 * To remove simply set this property to `false`
21011 *
21012 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
21013 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
21014 *
21015 * @member {boolean}
21016 * @memberof PIXI.DisplayObject#
21017 */
21018 cacheAsBitmap: boolean;
21019 /**
21020 * The instance name of the object.
21021 *
21022 * @memberof PIXI.DisplayObject#
21023 * @member {string} name
21024 */
21025 name: string;
21026 /**
21027 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
21028 *
21029 * @method getGlobalPosition
21030 * @memberof PIXI.DisplayObject#
21031 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
21032 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
21033 * being updated. This means the calculation returned MAY be out of date BUT will give you a
21034 * nice performance boost.
21035 * @return {PIXI.Point} The updated point.
21036 */
21037 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
21038 }
21039 module AnimatedSprite {
21040 /**
21041 * @memberof PIXI.AnimatedSprite
21042 * @typedef {object} FrameObject
21043 * @type {object}
21044 * @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame
21045 * @property {number} time - the duration of the frame in ms
21046 */
21047 type FrameObject = {
21048 texture: PIXI.Texture;
21049 time: number;
21050 };
21051 }
21052 /**
21053 * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.
21054 *
21055 * ```js
21056 * let alienImages = ["image_sequence_01.png","image_sequence_02.png","image_sequence_03.png","image_sequence_04.png"];
21057 * let textureArray = [];
21058 *
21059 * for (let i=0; i < 4; i++)
21060 * {
21061 * let texture = PIXI.Texture.from(alienImages[i]);
21062 * textureArray.push(texture);
21063 * };
21064 *
21065 * let animatedSprite = new PIXI.AnimatedSprite(textureArray);
21066 * ```
21067 *
21068 * The more efficient and simpler way to create an animated sprite is using a {@link PIXI.Spritesheet}
21069 * containing the animation definitions:
21070 *
21071 * ```js
21072 * PIXI.Loader.shared.add("assets/spritesheet.json").load(setup);
21073 *
21074 * function setup() {
21075 * let sheet = PIXI.Loader.shared.resources["assets/spritesheet.json"].spritesheet;
21076 * animatedSprite = new PIXI.AnimatedSprite(sheet.animations["image_sequence"]);
21077 * ...
21078 * }
21079 * ```
21080 *
21081 * @class
21082 * @extends PIXI.Sprite
21083 * @memberof PIXI
21084 */
21085 class AnimatedSprite extends PIXI.Sprite {
21086 constructor(textures: PIXI.Texture[] | PIXI.AnimatedSprite.FrameObject[], autoUpdate?: boolean);
21087 /**
21088 * The speed that the AnimatedSprite will play at. Higher is faster, lower is slower.
21089 *
21090 * @member {number} PIXI.AnimatedSprite#animationSpeed
21091 * @default 1
21092 */
21093 animationSpeed: number;
21094 /**
21095 * Whether or not the animate sprite repeats after playing.
21096 *
21097 * @member {boolean} PIXI.AnimatedSprite#loop
21098 * @default true
21099 */
21100 loop: boolean;
21101 /**
21102 * Update anchor to [Texture's defaultAnchor]{@link PIXI.Texture#defaultAnchor} when frame changes.
21103 *
21104 * Useful with [sprite sheet animations]{@link PIXI.Spritesheet#animations} created with tools.
21105 * Changing anchor for each frame allows to pin sprite origin to certain moving feature
21106 * of the frame (e.g. left foot).
21107 *
21108 * Note: Enabling this will override any previously set `anchor` on each frame change.
21109 *
21110 * @member {boolean} PIXI.AnimatedSprite#updateAnchor
21111 * @default false
21112 */
21113 updateAnchor: boolean;
21114 /**
21115 * User-assigned function to call when an AnimatedSprite finishes playing.
21116 *
21117 * @example
21118 * animation.onComplete = function () {
21119 * // finished!
21120 * };
21121 * @member {Function} PIXI.AnimatedSprite#onComplete
21122 */
21123 onComplete: (...params: any[]) => any;
21124 /**
21125 * User-assigned function to call when an AnimatedSprite changes which texture is being rendered.
21126 *
21127 * @example
21128 * animation.onFrameChange = function () {
21129 * // updated!
21130 * };
21131 * @member {Function} PIXI.AnimatedSprite#onFrameChange
21132 */
21133 onFrameChange: (...params: any[]) => any;
21134 /**
21135 * User-assigned function to call when `loop` is true, and an AnimatedSprite is played and
21136 * loops around to start again.
21137 *
21138 * @example
21139 * animation.onLoop = function () {
21140 * // looped!
21141 * };
21142 * @member {Function} PIXI.AnimatedSprite#onLoop
21143 */
21144 onLoop: (...params: any[]) => any;
21145 /**
21146 * Stops the AnimatedSprite.
21147 *
21148 */
21149 stop(): void;
21150 /**
21151 * Plays the AnimatedSprite.
21152 *
21153 */
21154 play(): void;
21155 /**
21156 * Stops the AnimatedSprite and goes to a specific frame.
21157 *
21158 * @param {number} frameNumber - Frame index to stop at.
21159 */
21160 gotoAndStop(frameNumber: number): void;
21161 /**
21162 * Goes to a specific frame and begins playing the AnimatedSprite.
21163 *
21164 * @param {number} frameNumber - Frame index to start at.
21165 */
21166 gotoAndPlay(frameNumber: number): void;
21167 /**
21168 * Updates the object transform for rendering.
21169 *
21170 * @param {number} deltaTime - Time since last tick.
21171 */
21172 update(deltaTime: number): void;
21173 /**
21174 * Stops the AnimatedSprite and destroys it.
21175 *
21176 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
21177 * have been set to that value.
21178 * @param {boolean} [options.children=false] - If set to true, all the children will have their destroy
21179 * method called as well. 'options' will be passed on to those calls.
21180 * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well.
21181 * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well.
21182 */
21183 destroy(options?: {
21184 children?: boolean;
21185 texture?: boolean;
21186 baseTexture?: boolean;
21187 }): void;
21188 /**
21189 * A short hand way of creating an AnimatedSprite from an array of frame ids.
21190 *
21191 * @static
21192 * @param {string[]} frames - The array of frames ids the AnimatedSprite will use as its texture frames.
21193 * @return {PIXI.AnimatedSprite} The new animated sprite with the specified frames.
21194 */
21195 static fromFrames(frames: string[]): PIXI.AnimatedSprite;
21196 /**
21197 * A short hand way of creating an AnimatedSprite from an array of image ids.
21198 *
21199 * @static
21200 * @param {string[]} images - The array of image urls the AnimatedSprite will use as its texture frames.
21201 * @return {PIXI.AnimatedSprite} The new animate sprite with the specified images as frames.
21202 */
21203 static fromImages(images: string[]): PIXI.AnimatedSprite;
21204 /**
21205 * The total number of frames in the AnimatedSprite. This is the same as number of textures
21206 * assigned to the AnimatedSprite.
21207 *
21208 * @readonly
21209 * @member {number}
21210 * @default 0
21211 */
21212 readonly totalFrames: number;
21213 /**
21214 * The array of textures used for this AnimatedSprite.
21215 *
21216 * @member {PIXI.Texture[]|PIXI.AnimatedSprite.FrameObject[]}
21217 */
21218 textures: PIXI.Texture[] | PIXI.AnimatedSprite.FrameObject[];
21219 /**
21220 * The AnimatedSprites current frame index.
21221 *
21222 * @member {number}
21223 * @readonly
21224 */
21225 readonly currentFrame: number;
21226 /**
21227 * Indicates if the AnimatedSprite is currently playing.
21228 *
21229 * @member {boolean}
21230 * @readonly
21231 */
21232 readonly playing: boolean;
21233 /**
21234 * Whether to use PIXI.Ticker.shared to auto update animation time
21235 *
21236 * @member {boolean}
21237 */
21238 autoUpdate: boolean;
21239 /**
21240 * Cached tinted texture.
21241 * @memberof PIXI.Sprite#
21242 * @member {HTMLCanvasElement} _tintedCanvas
21243 * @protected
21244 */
21245 protected _tintedCanvas: HTMLCanvasElement;
21246 /**
21247 * The width of the sprite (this is initially set by the texture)
21248 *
21249 * @protected
21250 * @member {number} PIXI.Sprite#_width
21251 */
21252 protected _width: number;
21253 /**
21254 * The height of the sprite (this is initially set by the texture)
21255 *
21256 * @protected
21257 * @member {number} PIXI.Sprite#_height
21258 */
21259 protected _height: number;
21260 /**
21261 * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
21262 *
21263 * @member {number} PIXI.Sprite#blendMode
21264 * @default PIXI.BLEND_MODES.NORMAL
21265 * @see PIXI.BLEND_MODES
21266 */
21267 blendMode: number;
21268 /**
21269 * Cached tint value so we can tell when the tint is changed.
21270 * Value is used for 2d CanvasRenderer.
21271 *
21272 * @protected
21273 * @member {number} PIXI.Sprite#_cachedTint
21274 * @default 0xFFFFFF
21275 */
21276 protected _cachedTint: number;
21277 /**
21278 * Plugin that is responsible for rendering this element.
21279 * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods.
21280 *
21281 * @member {string} PIXI.Sprite#pluginName
21282 * @default 'batch'
21283 */
21284 pluginName: string;
21285 /**
21286 * used to fast check if a sprite is.. a sprite!
21287 * @member {boolean} PIXI.Sprite#isSprite
21288 */
21289 isSprite: boolean;
21290 /**
21291 * When the texture is updated, this event will fire to update the scale and frame
21292 *
21293 * @protected
21294 */
21295 protected _onTextureUpdate(): void;
21296 /**
21297 * calculates worldTransform * vertices, store it in vertexData
21298 */
21299 calculateVertices(): void;
21300 /**
21301 * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData
21302 * This is used to ensure that the true width and height of a trimmed texture is respected
21303 */
21304 calculateTrimmedVertices(): void;
21305 /**
21306 *
21307 * Renders the object using the WebGL renderer
21308 *
21309 * @protected
21310 * @param {PIXI.Renderer} renderer - The webgl renderer to use.
21311 */
21312 protected _render(renderer: PIXI.Renderer): void;
21313 /**
21314 * Updates the bounds of the sprite.
21315 *
21316 * @protected
21317 */
21318 protected _calculateBounds(): void;
21319 /**
21320 * Gets the local bounds of the sprite object.
21321 *
21322 * @param {PIXI.Rectangle} [rect] - The output rectangle.
21323 * @return {PIXI.Rectangle} The bounds.
21324 */
21325 getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle;
21326 /**
21327 * Tests if a point is inside this sprite
21328 *
21329 * @param {PIXI.IPointData} point - the point to test
21330 * @return {boolean} the result of the test
21331 */
21332 containsPoint(point: PIXI.IPointData): boolean;
21333 /**
21334 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
21335 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
21336 * The main disadvantage is movement of objects may appear less smooth.
21337 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
21338 *
21339 * @member {boolean}
21340 * @default false
21341 */
21342 roundPixels: boolean;
21343 /**
21344 * The width of the sprite, setting this will actually modify the scale to achieve the value set
21345 *
21346 * @member {number}
21347 */
21348 width: number;
21349 /**
21350 * The height of the sprite, setting this will actually modify the scale to achieve the value set
21351 *
21352 * @member {number}
21353 */
21354 height: number;
21355 /**
21356 * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}
21357 * and passed to the constructor.
21358 *
21359 * The default is `(0,0)`, this means the sprite's origin is the top left.
21360 *
21361 * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.
21362 *
21363 * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.
21364 *
21365 * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.
21366 *
21367 * @example
21368 * const sprite = new PIXI.Sprite(texture);
21369 * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).
21370 *
21371 * @member {PIXI.ObservablePoint}
21372 */
21373 anchor: PIXI.ObservablePoint;
21374 /**
21375 * The tint applied to the sprite. This is a hex value.
21376 * A value of 0xFFFFFF will remove any tint effect.
21377 *
21378 * @member {number}
21379 * @default 0xFFFFFF
21380 */
21381 tint: number;
21382 /**
21383 * The texture that the sprite is using
21384 *
21385 * @member {PIXI.Texture}
21386 */
21387 texture: PIXI.Texture;
21388 /**
21389 * Renders the object using the Canvas renderer
21390 * @method renderCanvas
21391 * @memberof PIXI.Container#
21392 * @param {PIXI.CanvasRenderer} renderer - The renderer
21393 */
21394 renderCanvas(renderer: PIXI.CanvasRenderer): void;
21395 /**
21396 * The array of children of this container.
21397 *
21398 * @member {PIXI.DisplayObject[]} PIXI.Container#children
21399 * @readonly
21400 */
21401 readonly children: PIXI.DisplayObject[];
21402 /**
21403 * If set to true, the container will sort its children by zIndex value
21404 * when updateTransform() is called, or manually if sortChildren() is called.
21405 *
21406 * This actually changes the order of elements in the array, so should be treated
21407 * as a basic solution that is not performant compared to other solutions,
21408 * such as @link https://github.com/pixijs/pixi-display
21409 *
21410 * Also be aware of that this may not work nicely with the addChildAt() function,
21411 * as the zIndex sorting may cause the child to automatically sorted to another position.
21412 *
21413 * @see PIXI.settings.SORTABLE_CHILDREN
21414 *
21415 * @member {boolean} PIXI.Container#sortableChildren
21416 */
21417 sortableChildren: boolean;
21418 /**
21419 * Should children be sorted by zIndex at the next updateTransform call.
21420 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
21421 *
21422 * @member {boolean} PIXI.Container#sortDirty
21423 */
21424 sortDirty: boolean;
21425 /**
21426 * Overridable method that can be used by Container subclasses whenever the children array is modified
21427 *
21428 * @protected
21429 */
21430 protected onChildrenChange(): void;
21431 /**
21432 * Adds one or more children to the container.
21433 *
21434 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
21435 *
21436 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
21437 * @return {PIXI.DisplayObject} The first child that was added.
21438 */
21439 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
21440 /**
21441 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
21442 *
21443 * @param {PIXI.DisplayObject} child - The child to add
21444 * @param {number} index - The index to place the child in
21445 * @return {PIXI.DisplayObject} The child that was added.
21446 */
21447 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
21448 /**
21449 * Swaps the position of 2 Display Objects within this container.
21450 *
21451 * @param {PIXI.DisplayObject} child - First display object to swap
21452 * @param {PIXI.DisplayObject} child2 - Second display object to swap
21453 */
21454 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
21455 /**
21456 * Returns the index position of a child DisplayObject instance
21457 *
21458 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
21459 * @return {number} The index position of the child display object to identify
21460 */
21461 getChildIndex(child: PIXI.DisplayObject): number;
21462 /**
21463 * Changes the position of an existing child in the display object container
21464 *
21465 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
21466 * @param {number} index - The resulting index number for the child display object
21467 */
21468 setChildIndex(child: PIXI.DisplayObject, index: number): void;
21469 /**
21470 * Returns the child at the specified index
21471 *
21472 * @param {number} index - The index to get the child at
21473 * @return {PIXI.DisplayObject} The child at the given index, if any.
21474 */
21475 getChildAt(index: number): PIXI.DisplayObject;
21476 /**
21477 * Removes one or more children from the container.
21478 *
21479 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
21480 * @return {PIXI.DisplayObject} The first child that was removed.
21481 */
21482 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
21483 /**
21484 * Removes a child from the specified index position.
21485 *
21486 * @param {number} index - The index to get the child from
21487 * @return {PIXI.DisplayObject} The child that was removed.
21488 */
21489 removeChildAt(index: number): PIXI.DisplayObject;
21490 /**
21491 * Removes all children from this container that are within the begin and end indexes.
21492 *
21493 * @param {number} [beginIndex=0] - The beginning position.
21494 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
21495 * @returns {PIXI.DisplayObject[]} List of removed children
21496 */
21497 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
21498 /**
21499 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
21500 */
21501 sortChildren(): void;
21502 /**
21503 * Updates the transform on all children of this container for rendering
21504 */
21505 updateTransform(): void;
21506 /**
21507 * Recalculates the bounds of the container.
21508 *
21509 */
21510 calculateBounds(): void;
21511 /**
21512 * Renders the object using the WebGL renderer
21513 *
21514 * @param {PIXI.Renderer} renderer - The renderer
21515 */
21516 render(renderer: PIXI.Renderer): void;
21517 /**
21518 * Render the object using the WebGL renderer and advanced features.
21519 *
21520 * @protected
21521 * @param {PIXI.Renderer} renderer - The renderer
21522 */
21523 protected renderAdvanced(renderer: PIXI.Renderer): void;
21524 /**
21525 * Container default updateTransform, does update children of container.
21526 * Will crash if there's no parent element.
21527 *
21528 * @memberof PIXI.Container#
21529 * @function containerUpdateTransform
21530 */
21531 containerUpdateTransform(): void;
21532 /**
21533 * Determines if the children to the displayObject can be clicked/touched
21534 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
21535 *
21536 * @member {boolean}
21537 * @memberof PIXI.Container#
21538 */
21539 interactiveChildren: boolean;
21540 /**
21541 * Returns the display object in the container.
21542 *
21543 * Recursive searches are done in a preorder traversal.
21544 *
21545 * @method getChildByName
21546 * @memberof PIXI.Container#
21547 * @param {string} name - Instance name.
21548 * @param {boolean}[deep=false] - Whether to search recursively
21549 * @return {PIXI.DisplayObject} The child with the specified name.
21550 */
21551 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
21552 /**
21553 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
21554 * shadow div with attributes set
21555 *
21556 * @member {boolean}
21557 * @memberof PIXI.DisplayObject#
21558 */
21559 accessible: boolean;
21560 /**
21561 * Sets the title attribute of the shadow div
21562 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
21563 *
21564 * @member {?string}
21565 * @memberof PIXI.DisplayObject#
21566 */
21567 accessibleTitle: string;
21568 /**
21569 * Sets the aria-label attribute of the shadow div
21570 *
21571 * @member {string}
21572 * @memberof PIXI.DisplayObject#
21573 */
21574 accessibleHint: string;
21575 /**
21576 * @member {boolean}
21577 * @memberof PIXI.DisplayObject#
21578 * @todo Needs docs.
21579 */
21580 _accessibleActive: boolean;
21581 /**
21582 * @member {boolean}
21583 * @memberof PIXI.DisplayObject#
21584 * @todo Needs docs.
21585 */
21586 _accessibleDiv: boolean;
21587 /**
21588 * Specify the type of div the accessible layer is. Screen readers treat the element differently
21589 * depending on this type. Defaults to button.
21590 *
21591 * @member {string}
21592 * @memberof PIXI.DisplayObject#
21593 * @default 'button'
21594 */
21595 accessibleType: string;
21596 /**
21597 * Specify the pointer-events the accessible div will use
21598 * Defaults to auto.
21599 *
21600 * @member {string}
21601 * @memberof PIXI.DisplayObject#
21602 * @default 'auto'
21603 */
21604 accessiblePointerEvents: string;
21605 /**
21606 * Setting to false will prevent any children inside this container to
21607 * be accessible. Defaults to true.
21608 *
21609 * @member {boolean}
21610 * @memberof PIXI.DisplayObject#
21611 * @default true
21612 */
21613 accessibleChildren: boolean;
21614 /**
21615 * World transform and local transform of this object.
21616 * This will become read-only later, please do not assign anything there unless you know what are you doing.
21617 *
21618 * @member {PIXI.Transform} PIXI.DisplayObject#transform
21619 */
21620 transform: PIXI.Transform;
21621 /**
21622 * The opacity of the object.
21623 *
21624 * @member {number} PIXI.DisplayObject#alpha
21625 */
21626 alpha: number;
21627 /**
21628 * The visibility of the object. If false the object will not be drawn, and
21629 * the updateTransform function will not be called.
21630 *
21631 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
21632 *
21633 * @member {boolean} PIXI.DisplayObject#visible
21634 */
21635 visible: boolean;
21636 /**
21637 * Can this object be rendered, if false the object will not be drawn but the updateTransform
21638 * methods will still be called.
21639 *
21640 * Only affects recursive calls from parent. You can ask for bounds manually.
21641 *
21642 * @member {boolean} PIXI.DisplayObject#renderable
21643 */
21644 renderable: boolean;
21645 /**
21646 * The display object container that contains this display object.
21647 *
21648 * @member {PIXI.Container} PIXI.DisplayObject#parent
21649 */
21650 parent: PIXI.Container;
21651 /**
21652 * The multiplied alpha of the displayObject.
21653 *
21654 * @member {number} PIXI.DisplayObject#worldAlpha
21655 * @readonly
21656 */
21657 readonly worldAlpha: number;
21658 /**
21659 * Which index in the children array the display component was before the previous zIndex sort.
21660 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
21661 *
21662 * @member {number} PIXI.DisplayObject#_lastSortedIndex
21663 * @protected
21664 */
21665 protected _lastSortedIndex: number;
21666 /**
21667 * The zIndex of the displayObject.
21668 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
21669 *
21670 * @member {number} PIXI.DisplayObject#_zIndex
21671 * @protected
21672 */
21673 protected _zIndex: number;
21674 /**
21675 * The area the filter is applied to. This is used as more of an optimization
21676 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
21677 *
21678 * Also works as an interaction mask.
21679 *
21680 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
21681 */
21682 filterArea: PIXI.Rectangle;
21683 /**
21684 * Sets the filters for the displayObject.
21685 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
21686 * To remove filters simply set this property to `'null'`.
21687 *
21688 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
21689 */
21690 filters: PIXI.Filter[];
21691 /**
21692 * Currently enabled filters
21693 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
21694 * @protected
21695 */
21696 protected _enabledFilters: PIXI.Filter[];
21697 /**
21698 * The bounds object, this is used to calculate and store the bounds of the displayObject.
21699 *
21700 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
21701 */
21702 _bounds: PIXI.Bounds;
21703 /**
21704 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
21705 *
21706 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
21707 */
21708 _localBounds: PIXI.Bounds;
21709 /**
21710 * Flags the cached bounds as dirty.
21711 *
21712 * @member {number} PIXI.DisplayObject#_boundsID
21713 * @protected
21714 */
21715 protected _boundsID: number;
21716 /**
21717 * Cache of this display-object's bounds-rectangle.
21718 *
21719 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
21720 * @protected
21721 */
21722 protected _boundsRect: PIXI.Bounds;
21723 /**
21724 * Cache of this display-object's local-bounds rectangle.
21725 *
21726 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
21727 * @protected
21728 */
21729 protected _localBoundsRect: PIXI.Bounds;
21730 /**
21731 * The original, cached mask of the object.
21732 *
21733 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
21734 * @protected
21735 */
21736 protected _mask: PIXI.Container | PIXI.MaskData | null;
21737 /**
21738 * If the object has been destroyed via destroy(). If true, it should not be used.
21739 *
21740 * @member {boolean} PIXI.DisplayObject#_destroyed
21741 * @protected
21742 */
21743 protected _destroyed: boolean;
21744 /**
21745 * Does any other displayObject use this object as a mask?
21746 * @member {boolean} PIXI.DisplayObject#isMask
21747 */
21748 isMask: boolean;
21749 /**
21750 * Recursively updates transform of all objects from the root to this one
21751 * internal function for toLocal()
21752 */
21753 _recursivePostUpdateTransform(): void;
21754 /**
21755 * Retrieves the bounds of the displayObject as a rectangle object.
21756 *
21757 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
21758 * being updated. This means the calculation returned MAY be out of date BUT will give you a
21759 * nice performance boost.
21760 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
21761 * @return {PIXI.Rectangle} The rectangular bounding area.
21762 */
21763 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
21764 /**
21765 * Calculates the global position of the display object.
21766 *
21767 * @param {PIXI.IPointData} position - The world origin to calculate from.
21768 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
21769 * (otherwise will create a new Point).
21770 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
21771 * @return {PIXI.Point} A point object representing the position of this object.
21772 */
21773 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
21774 /**
21775 * Calculates the local position of the display object relative to another point.
21776 *
21777 * @param {PIXI.IPointData} position - The world origin to calculate from.
21778 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
21779 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
21780 * (otherwise will create a new Point).
21781 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
21782 * @return {PIXI.Point} A point object representing the position of this object
21783 */
21784 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
21785 /**
21786 * Set the parent Container of this DisplayObject.
21787 *
21788 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
21789 * @return {PIXI.Container} The Container that this DisplayObject was added to.
21790 */
21791 setParent(container: PIXI.Container): PIXI.Container;
21792 /**
21793 * Convenience function to set the position, scale, skew and pivot at once.
21794 *
21795 * @param {number} [x=0] - The X position
21796 * @param {number} [y=0] - The Y position
21797 * @param {number} [scaleX=1] - The X scale value
21798 * @param {number} [scaleY=1] - The Y scale value
21799 * @param {number} [rotation=0] - The rotation
21800 * @param {number} [skewX=0] - The X skew value
21801 * @param {number} [skewY=0] - The Y skew value
21802 * @param {number} [pivotX=0] - The X pivot value
21803 * @param {number} [pivotY=0] - The Y pivot value
21804 * @return {PIXI.DisplayObject} The DisplayObject instance
21805 */
21806 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
21807 /**
21808 * @protected
21809 * @member {PIXI.Container}
21810 */
21811 protected _tempDisplayObjectParent: PIXI.Container;
21812 /**
21813 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
21814 *
21815 * ```
21816 * const cacheParent = elem.enableTempParent();
21817 * elem.updateTransform();
21818 * elem.disableTempParent(cacheParent);
21819 * ```
21820 *
21821 * @returns {PIXI.DisplayObject} current parent
21822 */
21823 enableTempParent(): PIXI.DisplayObject;
21824 /**
21825 * Pair method for `enableTempParent`
21826 * @param {PIXI.DisplayObject} cacheParent actual parent of element
21827 */
21828 disableTempParent(cacheParent: PIXI.DisplayObject): void;
21829 /**
21830 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
21831 * An alias to position.x
21832 *
21833 * @member {number}
21834 */
21835 x: number;
21836 /**
21837 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
21838 * An alias to position.y
21839 *
21840 * @member {number}
21841 */
21842 y: number;
21843 /**
21844 * Current transform of the object based on world (parent) factors.
21845 *
21846 * @member {PIXI.Matrix}
21847 * @readonly
21848 */
21849 readonly worldTransform: PIXI.Matrix;
21850 /**
21851 * Current transform of the object based on local factors: position, scale, other stuff.
21852 *
21853 * @member {PIXI.Matrix}
21854 * @readonly
21855 */
21856 readonly localTransform: PIXI.Matrix;
21857 /**
21858 * The coordinate of the object relative to the local coordinates of the parent.
21859 * Assignment by value since pixi-v4.
21860 *
21861 * @member {PIXI.ObservablePoint}
21862 */
21863 position: PIXI.ObservablePoint;
21864 /**
21865 * The scale factor of the object.
21866 * Assignment by value since pixi-v4.
21867 *
21868 * @member {PIXI.ObservablePoint}
21869 */
21870 scale: PIXI.ObservablePoint;
21871 /**
21872 * The pivot point of the displayObject that it rotates around.
21873 * Assignment by value since pixi-v4.
21874 *
21875 * @member {PIXI.ObservablePoint}
21876 */
21877 pivot: PIXI.ObservablePoint;
21878 /**
21879 * The skew factor for the object in radians.
21880 * Assignment by value since pixi-v4.
21881 *
21882 * @member {PIXI.ObservablePoint}
21883 */
21884 skew: PIXI.ObservablePoint;
21885 /**
21886 * The rotation of the object in radians.
21887 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
21888 *
21889 * @member {number}
21890 */
21891 rotation: number;
21892 /**
21893 * The angle of the object in degrees.
21894 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
21895 *
21896 * @member {number}
21897 */
21898 angle: number;
21899 /**
21900 * The zIndex of the displayObject.
21901 * If a container has the sortableChildren property set to true, children will be automatically
21902 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
21903 * and thus rendered on top of other displayObjects within the same container.
21904 *
21905 * @member {number}
21906 */
21907 zIndex: number;
21908 /**
21909 * Indicates if the object is globally visible.
21910 *
21911 * @member {boolean}
21912 * @readonly
21913 */
21914 readonly worldVisible: boolean;
21915 /**
21916 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
21917 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
21918 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
21919 * utilities shape clipping. To remove a mask, set this property to `null`.
21920 *
21921 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
21922 * @example
21923 * const graphics = new PIXI.Graphics();
21924 * graphics.beginFill(0xFF3300);
21925 * graphics.drawRect(50, 250, 100, 100);
21926 * graphics.endFill();
21927 *
21928 * const sprite = new PIXI.Sprite(texture);
21929 * sprite.mask = graphics;
21930 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
21931 *
21932 * @member {PIXI.Container|PIXI.MaskData|null}
21933 */
21934 mask: PIXI.Container | PIXI.MaskData | null;
21935 /**
21936 * DisplayObject default updateTransform, does not update children of container.
21937 * Will crash if there's no parent element.
21938 *
21939 * @memberof PIXI.DisplayObject#
21940 * @function displayObjectUpdateTransform
21941 */
21942 displayObjectUpdateTransform(): void;
21943 /**
21944 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
21945 * events will not be emitted unless `interactive` is set to `true`.
21946 *
21947 * @example
21948 * const sprite = new PIXI.Sprite(texture);
21949 * sprite.interactive = true;
21950 * sprite.on('tap', (event) => {
21951 * //handle event
21952 * });
21953 * @member {boolean}
21954 * @memberof PIXI.DisplayObject#
21955 */
21956 interactive: boolean;
21957 /**
21958 * Interaction shape. Children will be hit first, then this shape will be checked.
21959 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
21960 *
21961 * @example
21962 * const sprite = new PIXI.Sprite(texture);
21963 * sprite.interactive = true;
21964 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
21965 * @member {PIXI.IHitArea}
21966 * @memberof PIXI.DisplayObject#
21967 */
21968 hitArea: PIXI.IHitArea;
21969 /**
21970 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
21971 * Setting this changes the 'cursor' property to `'pointer'`.
21972 *
21973 * @example
21974 * const sprite = new PIXI.Sprite(texture);
21975 * sprite.interactive = true;
21976 * sprite.buttonMode = true;
21977 * @member {boolean}
21978 * @memberof PIXI.DisplayObject#
21979 */
21980 buttonMode: boolean;
21981 /**
21982 * This defines what cursor mode is used when the mouse cursor
21983 * is hovered over the displayObject.
21984 *
21985 * @example
21986 * const sprite = new PIXI.Sprite(texture);
21987 * sprite.interactive = true;
21988 * sprite.cursor = 'wait';
21989 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
21990 *
21991 * @member {string}
21992 * @memberof PIXI.DisplayObject#
21993 */
21994 cursor: string;
21995 /**
21996 * Set this to true if you want this display object to be cached as a bitmap.
21997 * This basically takes a snap shot of the display object as it is at that moment. It can
21998 * provide a performance benefit for complex static displayObjects.
21999 * To remove simply set this property to `false`
22000 *
22001 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
22002 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
22003 *
22004 * @member {boolean}
22005 * @memberof PIXI.DisplayObject#
22006 */
22007 cacheAsBitmap: boolean;
22008 /**
22009 * The instance name of the object.
22010 *
22011 * @memberof PIXI.DisplayObject#
22012 * @member {string} name
22013 */
22014 name: string;
22015 /**
22016 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
22017 *
22018 * @method getGlobalPosition
22019 * @memberof PIXI.DisplayObject#
22020 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
22021 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
22022 * being updated. This means the calculation returned MAY be out of date BUT will give you a
22023 * nice performance boost.
22024 * @return {PIXI.Point} The updated point.
22025 */
22026 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
22027 }
22028 /**
22029 * A tiling sprite is a fast way of rendering a tiling image
22030 *
22031 * @class
22032 * @extends PIXI.Sprite
22033 * @memberof PIXI
22034 */
22035 class TilingSprite extends PIXI.Sprite {
22036 static from(source: number | string | PIXI.Texture | HTMLCanvasElement | HTMLVideoElement, options?: any): PIXI.Sprite;
22037 static fromFrame(): PIXI.Sprite;
22038 static fromImage(): PIXI.Sprite;
22039 constructor(texture: PIXI.Texture, width?: number, height?: number);
22040 /**
22041 * Renders the object using the Canvas renderer
22042 *
22043 * @protected
22044 * @function _renderCanvas
22045 * @memberof PIXI.TilingSprite#
22046 * @param {PIXI.CanvasRenderer} renderer - a reference to the canvas renderer
22047 */
22048 protected _renderCanvas(renderer: PIXI.CanvasRenderer): void;
22049 /**
22050 * Tile transform
22051 *
22052 * @member {PIXI.Transform} PIXI.TilingSprite#tileTransform
22053 */
22054 tileTransform: PIXI.Transform;
22055 /**
22056 * matrix that is applied to UV to get the coords in Texture normalized space to coords in BaseTexture space
22057 *
22058 * @member {PIXI.TextureMatrix} PIXI.TilingSprite#uvMatrix
22059 */
22060 uvMatrix: PIXI.TextureMatrix;
22061 /**
22062 * Plugin that is responsible for rendering this element.
22063 * Allows to customize the rendering process without overriding '_render' method.
22064 *
22065 * @member {string} PIXI.TilingSprite#pluginName
22066 * @default 'tilingSprite'
22067 */
22068 pluginName: string;
22069 /**
22070 * Whether or not anchor affects uvs
22071 *
22072 * @member {boolean} PIXI.TilingSprite#uvRespectAnchor
22073 * @default false
22074 */
22075 uvRespectAnchor: boolean;
22076 /**
22077 * Changes frame clamping in corresponding textureTransform, shortcut
22078 * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas
22079 *
22080 * @default 0.5
22081 * @member {number}
22082 */
22083 clampMargin: number;
22084 /**
22085 * The scaling of the image that is being tiled
22086 *
22087 * @member {PIXI.ObservablePoint}
22088 */
22089 tileScale: PIXI.ObservablePoint;
22090 /**
22091 * The offset of the image that is being tiled
22092 *
22093 * @member {PIXI.ObservablePoint}
22094 */
22095 tilePosition: PIXI.ObservablePoint;
22096 /**
22097 * @protected
22098 */
22099 protected _onTextureUpdate(): void;
22100 /**
22101 * Renders the object using the WebGL renderer
22102 *
22103 * @protected
22104 * @param {PIXI.Renderer} renderer - The renderer
22105 */
22106 protected _render(renderer: PIXI.Renderer): void;
22107 /**
22108 * Updates the bounds of the tiling sprite.
22109 *
22110 * @protected
22111 */
22112 protected _calculateBounds(): void;
22113 /**
22114 * Gets the local bounds of the sprite object.
22115 *
22116 * @param {PIXI.Rectangle} rect - The output rectangle.
22117 * @return {PIXI.Rectangle} The bounds.
22118 */
22119 getLocalBounds(rect: PIXI.Rectangle): PIXI.Rectangle;
22120 /**
22121 * Checks if a point is inside this tiling sprite.
22122 *
22123 * @param {PIXI.IPointData} point - the point to check
22124 * @return {boolean} Whether or not the sprite contains the point.
22125 */
22126 containsPoint(point: PIXI.IPointData): boolean;
22127 /**
22128 * Destroys this sprite and optionally its texture and children
22129 *
22130 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
22131 * have been set to that value
22132 * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy
22133 * method called as well. 'options' will be passed on to those calls.
22134 * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well
22135 * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well
22136 */
22137 destroy(options?: {
22138 children?: boolean;
22139 texture?: boolean;
22140 baseTexture?: boolean;
22141 }): void;
22142 /**
22143 * Helper function that creates a new tiling sprite based on the source you provide.
22144 * The source can be - frame id, image url, video url, canvas element, video element, base texture
22145 *
22146 * @static
22147 * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from
22148 * @param {Object} options - See {@link PIXI.BaseTexture}'s constructor for options.
22149 * @param {number} options.width - required width of the tiling sprite
22150 * @param {number} options.height - required height of the tiling sprite
22151 * @return {PIXI.TilingSprite} The newly created texture
22152 */
22153 static from(source: string | PIXI.Texture | HTMLCanvasElement | HTMLVideoElement, options: {
22154 width: number;
22155 height: number;
22156 }): PIXI.TilingSprite;
22157 /**
22158 * The width of the sprite, setting this will actually modify the scale to achieve the value set
22159 *
22160 * @member {number}
22161 */
22162 width: number;
22163 /**
22164 * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set
22165 *
22166 * @member {number}
22167 */
22168 height: number;
22169 /**
22170 * Cached tinted texture.
22171 * @memberof PIXI.Sprite#
22172 * @member {HTMLCanvasElement} _tintedCanvas
22173 * @protected
22174 */
22175 protected _tintedCanvas: HTMLCanvasElement;
22176 /**
22177 * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
22178 *
22179 * @member {number} PIXI.Sprite#blendMode
22180 * @default PIXI.BLEND_MODES.NORMAL
22181 * @see PIXI.BLEND_MODES
22182 */
22183 blendMode: number;
22184 /**
22185 * Cached tint value so we can tell when the tint is changed.
22186 * Value is used for 2d CanvasRenderer.
22187 *
22188 * @protected
22189 * @member {number} PIXI.Sprite#_cachedTint
22190 * @default 0xFFFFFF
22191 */
22192 protected _cachedTint: number;
22193 /**
22194 * used to fast check if a sprite is.. a sprite!
22195 * @member {boolean} PIXI.Sprite#isSprite
22196 */
22197 isSprite: boolean;
22198 /**
22199 * calculates worldTransform * vertices, store it in vertexData
22200 */
22201 calculateVertices(): void;
22202 /**
22203 * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData
22204 * This is used to ensure that the true width and height of a trimmed texture is respected
22205 */
22206 calculateTrimmedVertices(): void;
22207 /**
22208 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
22209 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
22210 * The main disadvantage is movement of objects may appear less smooth.
22211 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
22212 *
22213 * @member {boolean}
22214 * @default false
22215 */
22216 roundPixels: boolean;
22217 /**
22218 * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}
22219 * and passed to the constructor.
22220 *
22221 * The default is `(0,0)`, this means the sprite's origin is the top left.
22222 *
22223 * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.
22224 *
22225 * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.
22226 *
22227 * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.
22228 *
22229 * @example
22230 * const sprite = new PIXI.Sprite(texture);
22231 * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).
22232 *
22233 * @member {PIXI.ObservablePoint}
22234 */
22235 anchor: PIXI.ObservablePoint;
22236 /**
22237 * The tint applied to the sprite. This is a hex value.
22238 * A value of 0xFFFFFF will remove any tint effect.
22239 *
22240 * @member {number}
22241 * @default 0xFFFFFF
22242 */
22243 tint: number;
22244 /**
22245 * The texture that the sprite is using
22246 *
22247 * @member {PIXI.Texture}
22248 */
22249 texture: PIXI.Texture;
22250 /**
22251 * Renders the object using the Canvas renderer
22252 * @method renderCanvas
22253 * @memberof PIXI.Container#
22254 * @param {PIXI.CanvasRenderer} renderer - The renderer
22255 */
22256 renderCanvas(renderer: PIXI.CanvasRenderer): void;
22257 /**
22258 * The array of children of this container.
22259 *
22260 * @member {PIXI.DisplayObject[]} PIXI.Container#children
22261 * @readonly
22262 */
22263 readonly children: PIXI.DisplayObject[];
22264 /**
22265 * If set to true, the container will sort its children by zIndex value
22266 * when updateTransform() is called, or manually if sortChildren() is called.
22267 *
22268 * This actually changes the order of elements in the array, so should be treated
22269 * as a basic solution that is not performant compared to other solutions,
22270 * such as @link https://github.com/pixijs/pixi-display
22271 *
22272 * Also be aware of that this may not work nicely with the addChildAt() function,
22273 * as the zIndex sorting may cause the child to automatically sorted to another position.
22274 *
22275 * @see PIXI.settings.SORTABLE_CHILDREN
22276 *
22277 * @member {boolean} PIXI.Container#sortableChildren
22278 */
22279 sortableChildren: boolean;
22280 /**
22281 * Should children be sorted by zIndex at the next updateTransform call.
22282 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
22283 *
22284 * @member {boolean} PIXI.Container#sortDirty
22285 */
22286 sortDirty: boolean;
22287 /**
22288 * Overridable method that can be used by Container subclasses whenever the children array is modified
22289 *
22290 * @protected
22291 */
22292 protected onChildrenChange(): void;
22293 /**
22294 * Adds one or more children to the container.
22295 *
22296 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
22297 *
22298 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
22299 * @return {PIXI.DisplayObject} The first child that was added.
22300 */
22301 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
22302 /**
22303 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
22304 *
22305 * @param {PIXI.DisplayObject} child - The child to add
22306 * @param {number} index - The index to place the child in
22307 * @return {PIXI.DisplayObject} The child that was added.
22308 */
22309 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
22310 /**
22311 * Swaps the position of 2 Display Objects within this container.
22312 *
22313 * @param {PIXI.DisplayObject} child - First display object to swap
22314 * @param {PIXI.DisplayObject} child2 - Second display object to swap
22315 */
22316 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
22317 /**
22318 * Returns the index position of a child DisplayObject instance
22319 *
22320 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
22321 * @return {number} The index position of the child display object to identify
22322 */
22323 getChildIndex(child: PIXI.DisplayObject): number;
22324 /**
22325 * Changes the position of an existing child in the display object container
22326 *
22327 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
22328 * @param {number} index - The resulting index number for the child display object
22329 */
22330 setChildIndex(child: PIXI.DisplayObject, index: number): void;
22331 /**
22332 * Returns the child at the specified index
22333 *
22334 * @param {number} index - The index to get the child at
22335 * @return {PIXI.DisplayObject} The child at the given index, if any.
22336 */
22337 getChildAt(index: number): PIXI.DisplayObject;
22338 /**
22339 * Removes one or more children from the container.
22340 *
22341 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
22342 * @return {PIXI.DisplayObject} The first child that was removed.
22343 */
22344 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
22345 /**
22346 * Removes a child from the specified index position.
22347 *
22348 * @param {number} index - The index to get the child from
22349 * @return {PIXI.DisplayObject} The child that was removed.
22350 */
22351 removeChildAt(index: number): PIXI.DisplayObject;
22352 /**
22353 * Removes all children from this container that are within the begin and end indexes.
22354 *
22355 * @param {number} [beginIndex=0] - The beginning position.
22356 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
22357 * @returns {PIXI.DisplayObject[]} List of removed children
22358 */
22359 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
22360 /**
22361 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
22362 */
22363 sortChildren(): void;
22364 /**
22365 * Updates the transform on all children of this container for rendering
22366 */
22367 updateTransform(): void;
22368 /**
22369 * Recalculates the bounds of the container.
22370 *
22371 */
22372 calculateBounds(): void;
22373 /**
22374 * Renders the object using the WebGL renderer
22375 *
22376 * @param {PIXI.Renderer} renderer - The renderer
22377 */
22378 render(renderer: PIXI.Renderer): void;
22379 /**
22380 * Render the object using the WebGL renderer and advanced features.
22381 *
22382 * @protected
22383 * @param {PIXI.Renderer} renderer - The renderer
22384 */
22385 protected renderAdvanced(renderer: PIXI.Renderer): void;
22386 /**
22387 * Container default updateTransform, does update children of container.
22388 * Will crash if there's no parent element.
22389 *
22390 * @memberof PIXI.Container#
22391 * @function containerUpdateTransform
22392 */
22393 containerUpdateTransform(): void;
22394 /**
22395 * Determines if the children to the displayObject can be clicked/touched
22396 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
22397 *
22398 * @member {boolean}
22399 * @memberof PIXI.Container#
22400 */
22401 interactiveChildren: boolean;
22402 /**
22403 * Returns the display object in the container.
22404 *
22405 * Recursive searches are done in a preorder traversal.
22406 *
22407 * @method getChildByName
22408 * @memberof PIXI.Container#
22409 * @param {string} name - Instance name.
22410 * @param {boolean}[deep=false] - Whether to search recursively
22411 * @return {PIXI.DisplayObject} The child with the specified name.
22412 */
22413 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
22414 /**
22415 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
22416 * shadow div with attributes set
22417 *
22418 * @member {boolean}
22419 * @memberof PIXI.DisplayObject#
22420 */
22421 accessible: boolean;
22422 /**
22423 * Sets the title attribute of the shadow div
22424 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
22425 *
22426 * @member {?string}
22427 * @memberof PIXI.DisplayObject#
22428 */
22429 accessibleTitle: string;
22430 /**
22431 * Sets the aria-label attribute of the shadow div
22432 *
22433 * @member {string}
22434 * @memberof PIXI.DisplayObject#
22435 */
22436 accessibleHint: string;
22437 /**
22438 * @member {boolean}
22439 * @memberof PIXI.DisplayObject#
22440 * @todo Needs docs.
22441 */
22442 _accessibleActive: boolean;
22443 /**
22444 * @member {boolean}
22445 * @memberof PIXI.DisplayObject#
22446 * @todo Needs docs.
22447 */
22448 _accessibleDiv: boolean;
22449 /**
22450 * Specify the type of div the accessible layer is. Screen readers treat the element differently
22451 * depending on this type. Defaults to button.
22452 *
22453 * @member {string}
22454 * @memberof PIXI.DisplayObject#
22455 * @default 'button'
22456 */
22457 accessibleType: string;
22458 /**
22459 * Specify the pointer-events the accessible div will use
22460 * Defaults to auto.
22461 *
22462 * @member {string}
22463 * @memberof PIXI.DisplayObject#
22464 * @default 'auto'
22465 */
22466 accessiblePointerEvents: string;
22467 /**
22468 * Setting to false will prevent any children inside this container to
22469 * be accessible. Defaults to true.
22470 *
22471 * @member {boolean}
22472 * @memberof PIXI.DisplayObject#
22473 * @default true
22474 */
22475 accessibleChildren: boolean;
22476 /**
22477 * World transform and local transform of this object.
22478 * This will become read-only later, please do not assign anything there unless you know what are you doing.
22479 *
22480 * @member {PIXI.Transform} PIXI.DisplayObject#transform
22481 */
22482 transform: PIXI.Transform;
22483 /**
22484 * The opacity of the object.
22485 *
22486 * @member {number} PIXI.DisplayObject#alpha
22487 */
22488 alpha: number;
22489 /**
22490 * The visibility of the object. If false the object will not be drawn, and
22491 * the updateTransform function will not be called.
22492 *
22493 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
22494 *
22495 * @member {boolean} PIXI.DisplayObject#visible
22496 */
22497 visible: boolean;
22498 /**
22499 * Can this object be rendered, if false the object will not be drawn but the updateTransform
22500 * methods will still be called.
22501 *
22502 * Only affects recursive calls from parent. You can ask for bounds manually.
22503 *
22504 * @member {boolean} PIXI.DisplayObject#renderable
22505 */
22506 renderable: boolean;
22507 /**
22508 * The display object container that contains this display object.
22509 *
22510 * @member {PIXI.Container} PIXI.DisplayObject#parent
22511 */
22512 parent: PIXI.Container;
22513 /**
22514 * The multiplied alpha of the displayObject.
22515 *
22516 * @member {number} PIXI.DisplayObject#worldAlpha
22517 * @readonly
22518 */
22519 readonly worldAlpha: number;
22520 /**
22521 * Which index in the children array the display component was before the previous zIndex sort.
22522 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
22523 *
22524 * @member {number} PIXI.DisplayObject#_lastSortedIndex
22525 * @protected
22526 */
22527 protected _lastSortedIndex: number;
22528 /**
22529 * The zIndex of the displayObject.
22530 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
22531 *
22532 * @member {number} PIXI.DisplayObject#_zIndex
22533 * @protected
22534 */
22535 protected _zIndex: number;
22536 /**
22537 * The area the filter is applied to. This is used as more of an optimization
22538 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
22539 *
22540 * Also works as an interaction mask.
22541 *
22542 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
22543 */
22544 filterArea: PIXI.Rectangle;
22545 /**
22546 * Sets the filters for the displayObject.
22547 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
22548 * To remove filters simply set this property to `'null'`.
22549 *
22550 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
22551 */
22552 filters: PIXI.Filter[];
22553 /**
22554 * Currently enabled filters
22555 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
22556 * @protected
22557 */
22558 protected _enabledFilters: PIXI.Filter[];
22559 /**
22560 * The bounds object, this is used to calculate and store the bounds of the displayObject.
22561 *
22562 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
22563 */
22564 _bounds: PIXI.Bounds;
22565 /**
22566 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
22567 *
22568 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
22569 */
22570 _localBounds: PIXI.Bounds;
22571 /**
22572 * Flags the cached bounds as dirty.
22573 *
22574 * @member {number} PIXI.DisplayObject#_boundsID
22575 * @protected
22576 */
22577 protected _boundsID: number;
22578 /**
22579 * Cache of this display-object's bounds-rectangle.
22580 *
22581 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
22582 * @protected
22583 */
22584 protected _boundsRect: PIXI.Bounds;
22585 /**
22586 * Cache of this display-object's local-bounds rectangle.
22587 *
22588 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
22589 * @protected
22590 */
22591 protected _localBoundsRect: PIXI.Bounds;
22592 /**
22593 * The original, cached mask of the object.
22594 *
22595 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
22596 * @protected
22597 */
22598 protected _mask: PIXI.Container | PIXI.MaskData | null;
22599 /**
22600 * If the object has been destroyed via destroy(). If true, it should not be used.
22601 *
22602 * @member {boolean} PIXI.DisplayObject#_destroyed
22603 * @protected
22604 */
22605 protected _destroyed: boolean;
22606 /**
22607 * Does any other displayObject use this object as a mask?
22608 * @member {boolean} PIXI.DisplayObject#isMask
22609 */
22610 isMask: boolean;
22611 /**
22612 * Recursively updates transform of all objects from the root to this one
22613 * internal function for toLocal()
22614 */
22615 _recursivePostUpdateTransform(): void;
22616 /**
22617 * Retrieves the bounds of the displayObject as a rectangle object.
22618 *
22619 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
22620 * being updated. This means the calculation returned MAY be out of date BUT will give you a
22621 * nice performance boost.
22622 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
22623 * @return {PIXI.Rectangle} The rectangular bounding area.
22624 */
22625 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
22626 /**
22627 * Calculates the global position of the display object.
22628 *
22629 * @param {PIXI.IPointData} position - The world origin to calculate from.
22630 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
22631 * (otherwise will create a new Point).
22632 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
22633 * @return {PIXI.Point} A point object representing the position of this object.
22634 */
22635 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
22636 /**
22637 * Calculates the local position of the display object relative to another point.
22638 *
22639 * @param {PIXI.IPointData} position - The world origin to calculate from.
22640 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
22641 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
22642 * (otherwise will create a new Point).
22643 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
22644 * @return {PIXI.Point} A point object representing the position of this object
22645 */
22646 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
22647 /**
22648 * Set the parent Container of this DisplayObject.
22649 *
22650 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
22651 * @return {PIXI.Container} The Container that this DisplayObject was added to.
22652 */
22653 setParent(container: PIXI.Container): PIXI.Container;
22654 /**
22655 * Convenience function to set the position, scale, skew and pivot at once.
22656 *
22657 * @param {number} [x=0] - The X position
22658 * @param {number} [y=0] - The Y position
22659 * @param {number} [scaleX=1] - The X scale value
22660 * @param {number} [scaleY=1] - The Y scale value
22661 * @param {number} [rotation=0] - The rotation
22662 * @param {number} [skewX=0] - The X skew value
22663 * @param {number} [skewY=0] - The Y skew value
22664 * @param {number} [pivotX=0] - The X pivot value
22665 * @param {number} [pivotY=0] - The Y pivot value
22666 * @return {PIXI.DisplayObject} The DisplayObject instance
22667 */
22668 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
22669 /**
22670 * @protected
22671 * @member {PIXI.Container}
22672 */
22673 protected _tempDisplayObjectParent: PIXI.Container;
22674 /**
22675 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
22676 *
22677 * ```
22678 * const cacheParent = elem.enableTempParent();
22679 * elem.updateTransform();
22680 * elem.disableTempParent(cacheParent);
22681 * ```
22682 *
22683 * @returns {PIXI.DisplayObject} current parent
22684 */
22685 enableTempParent(): PIXI.DisplayObject;
22686 /**
22687 * Pair method for `enableTempParent`
22688 * @param {PIXI.DisplayObject} cacheParent actual parent of element
22689 */
22690 disableTempParent(cacheParent: PIXI.DisplayObject): void;
22691 /**
22692 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
22693 * An alias to position.x
22694 *
22695 * @member {number}
22696 */
22697 x: number;
22698 /**
22699 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
22700 * An alias to position.y
22701 *
22702 * @member {number}
22703 */
22704 y: number;
22705 /**
22706 * Current transform of the object based on world (parent) factors.
22707 *
22708 * @member {PIXI.Matrix}
22709 * @readonly
22710 */
22711 readonly worldTransform: PIXI.Matrix;
22712 /**
22713 * Current transform of the object based on local factors: position, scale, other stuff.
22714 *
22715 * @member {PIXI.Matrix}
22716 * @readonly
22717 */
22718 readonly localTransform: PIXI.Matrix;
22719 /**
22720 * The coordinate of the object relative to the local coordinates of the parent.
22721 * Assignment by value since pixi-v4.
22722 *
22723 * @member {PIXI.ObservablePoint}
22724 */
22725 position: PIXI.ObservablePoint;
22726 /**
22727 * The scale factor of the object.
22728 * Assignment by value since pixi-v4.
22729 *
22730 * @member {PIXI.ObservablePoint}
22731 */
22732 scale: PIXI.ObservablePoint;
22733 /**
22734 * The pivot point of the displayObject that it rotates around.
22735 * Assignment by value since pixi-v4.
22736 *
22737 * @member {PIXI.ObservablePoint}
22738 */
22739 pivot: PIXI.ObservablePoint;
22740 /**
22741 * The skew factor for the object in radians.
22742 * Assignment by value since pixi-v4.
22743 *
22744 * @member {PIXI.ObservablePoint}
22745 */
22746 skew: PIXI.ObservablePoint;
22747 /**
22748 * The rotation of the object in radians.
22749 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
22750 *
22751 * @member {number}
22752 */
22753 rotation: number;
22754 /**
22755 * The angle of the object in degrees.
22756 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
22757 *
22758 * @member {number}
22759 */
22760 angle: number;
22761 /**
22762 * The zIndex of the displayObject.
22763 * If a container has the sortableChildren property set to true, children will be automatically
22764 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
22765 * and thus rendered on top of other displayObjects within the same container.
22766 *
22767 * @member {number}
22768 */
22769 zIndex: number;
22770 /**
22771 * Indicates if the object is globally visible.
22772 *
22773 * @member {boolean}
22774 * @readonly
22775 */
22776 readonly worldVisible: boolean;
22777 /**
22778 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
22779 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
22780 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
22781 * utilities shape clipping. To remove a mask, set this property to `null`.
22782 *
22783 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
22784 * @example
22785 * const graphics = new PIXI.Graphics();
22786 * graphics.beginFill(0xFF3300);
22787 * graphics.drawRect(50, 250, 100, 100);
22788 * graphics.endFill();
22789 *
22790 * const sprite = new PIXI.Sprite(texture);
22791 * sprite.mask = graphics;
22792 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
22793 *
22794 * @member {PIXI.Container|PIXI.MaskData|null}
22795 */
22796 mask: PIXI.Container | PIXI.MaskData | null;
22797 /**
22798 * DisplayObject default updateTransform, does not update children of container.
22799 * Will crash if there's no parent element.
22800 *
22801 * @memberof PIXI.DisplayObject#
22802 * @function displayObjectUpdateTransform
22803 */
22804 displayObjectUpdateTransform(): void;
22805 /**
22806 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
22807 * events will not be emitted unless `interactive` is set to `true`.
22808 *
22809 * @example
22810 * const sprite = new PIXI.Sprite(texture);
22811 * sprite.interactive = true;
22812 * sprite.on('tap', (event) => {
22813 * //handle event
22814 * });
22815 * @member {boolean}
22816 * @memberof PIXI.DisplayObject#
22817 */
22818 interactive: boolean;
22819 /**
22820 * Interaction shape. Children will be hit first, then this shape will be checked.
22821 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
22822 *
22823 * @example
22824 * const sprite = new PIXI.Sprite(texture);
22825 * sprite.interactive = true;
22826 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
22827 * @member {PIXI.IHitArea}
22828 * @memberof PIXI.DisplayObject#
22829 */
22830 hitArea: PIXI.IHitArea;
22831 /**
22832 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
22833 * Setting this changes the 'cursor' property to `'pointer'`.
22834 *
22835 * @example
22836 * const sprite = new PIXI.Sprite(texture);
22837 * sprite.interactive = true;
22838 * sprite.buttonMode = true;
22839 * @member {boolean}
22840 * @memberof PIXI.DisplayObject#
22841 */
22842 buttonMode: boolean;
22843 /**
22844 * This defines what cursor mode is used when the mouse cursor
22845 * is hovered over the displayObject.
22846 *
22847 * @example
22848 * const sprite = new PIXI.Sprite(texture);
22849 * sprite.interactive = true;
22850 * sprite.cursor = 'wait';
22851 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
22852 *
22853 * @member {string}
22854 * @memberof PIXI.DisplayObject#
22855 */
22856 cursor: string;
22857 /**
22858 * Set this to true if you want this display object to be cached as a bitmap.
22859 * This basically takes a snap shot of the display object as it is at that moment. It can
22860 * provide a performance benefit for complex static displayObjects.
22861 * To remove simply set this property to `false`
22862 *
22863 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
22864 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
22865 *
22866 * @member {boolean}
22867 * @memberof PIXI.DisplayObject#
22868 */
22869 cacheAsBitmap: boolean;
22870 /**
22871 * The instance name of the object.
22872 *
22873 * @memberof PIXI.DisplayObject#
22874 * @member {string} name
22875 */
22876 name: string;
22877 /**
22878 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
22879 *
22880 * @method getGlobalPosition
22881 * @memberof PIXI.DisplayObject#
22882 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
22883 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
22884 * being updated. This means the calculation returned MAY be out of date BUT will give you a
22885 * nice performance boost.
22886 * @return {PIXI.Point} The updated point.
22887 */
22888 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
22889 }
22890 /**
22891 * WebGL renderer plugin for tiling sprites
22892 *
22893 * @class
22894 * @memberof PIXI
22895 * @extends PIXI.ObjectRenderer
22896 */
22897 class TilingSpriteRenderer extends PIXI.ObjectRenderer {
22898 constructor(renderer: PIXI.Renderer);
22899 /**
22900 * The WebGL state in which this renderer will work.
22901 *
22902 * @member {PIXI.State} PIXI.TilingSpriteRenderer#state
22903 * @readonly
22904 */
22905 readonly state: PIXI.State;
22906 /**
22907 *
22908 * @param {PIXI.TilingSprite} ts - tilingSprite to be rendered
22909 */
22910 render(ts: PIXI.TilingSprite): void;
22911 /**
22912 * The renderer this manager works for.
22913 *
22914 * @member {PIXI.Renderer} PIXI.ObjectRenderer#renderer
22915 */
22916 renderer: PIXI.Renderer;
22917 /**
22918 * Stub method that should be used to empty the current
22919 * batch by rendering objects now.
22920 */
22921 flush(): void;
22922 /**
22923 * Generic destruction method that frees all resources. This
22924 * should be called by subclasses.
22925 */
22926 destroy(): void;
22927 /**
22928 * Stub method that initializes any state required before
22929 * rendering starts. It is different from the `prerender`
22930 * signal, which occurs every frame, in that it is called
22931 * whenever an object requests _this_ renderer specifically.
22932 */
22933 start(): void;
22934 /**
22935 * Stops the renderer. It should free up any state and
22936 * become dormant.
22937 */
22938 stop(): void;
22939 }
22940 /**
22941 * Utility class for maintaining reference to a collection
22942 * of Textures on a single Spritesheet.
22943 *
22944 * To access a sprite sheet from your code pass its JSON data file to Pixi's loader:
22945 *
22946 * ```js
22947 * PIXI.Loader.shared.add("images/spritesheet.json").load(setup);
22948 *
22949 * function setup() {
22950 * let sheet = PIXI.Loader.shared.resources["images/spritesheet.json"].spritesheet;
22951 * ...
22952 * }
22953 * ```
22954 * With the `sheet.textures` you can create Sprite objects,`sheet.animations` can be used to create an AnimatedSprite.
22955 *
22956 * Sprite sheets can be packed using tools like {@link https://codeandweb.com/texturepacker|TexturePacker},
22957 * {@link https://renderhjs.net/shoebox/|Shoebox} or {@link https://github.com/krzysztof-o/spritesheet.js|Spritesheet.js}.
22958 * Default anchor points (see {@link PIXI.Texture#defaultAnchor}) and grouping of animation sprites are currently only
22959 * supported by TexturePacker.
22960 *
22961 * @class
22962 * @memberof PIXI
22963 */
22964 class Spritesheet {
22965 constructor(baseTexture: PIXI.BaseTexture | PIXI.Texture, data: any, resolutionFilename?: string);
22966 /**
22967 * Reference to ths source texture.
22968 * @type {PIXI.BaseTexture}
22969 */
22970 baseTexture: PIXI.BaseTexture;
22971 /**
22972 * A map containing all textures of the sprite sheet.
22973 * Can be used to create a {@link PIXI.Sprite|Sprite}:
22974 * ```js
22975 * new PIXI.Sprite(sheet.textures["image.png"]);
22976 * ```
22977 * @member {Object} PIXI.Spritesheet#textures
22978 */
22979 textures: any;
22980 /**
22981 * A map containing the textures for each animation.
22982 * Can be used to create an {@link PIXI.AnimatedSprite|AnimatedSprite}:
22983 * ```js
22984 * new PIXI.AnimatedSprite(sheet.animations["anim_name"])
22985 * ```
22986 * @member {Object} PIXI.Spritesheet#animations
22987 */
22988 animations: any;
22989 /**
22990 * Reference to the original JSON data.
22991 * @type {Object}
22992 */
22993 data: any;
22994 /**
22995 * The resolution of the spritesheet.
22996 * @type {number}
22997 */
22998 resolution: number;
22999 /**
23000 * Parser spritesheet from loaded data. This is done asynchronously
23001 * to prevent creating too many Texture within a single process.
23002 *
23003 * @param {Function} callback - Callback when complete returns
23004 * a map of the Textures for this spritesheet.
23005 */
23006 parse(callback: (...params: any[]) => any): void;
23007 /**
23008 * Destroy Spritesheet and don't use after this.
23009 *
23010 * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well
23011 */
23012 destroy(destroyBase?: boolean): void;
23013 /**
23014 * The maximum number of Textures to build per process.
23015 *
23016 * @type {number}
23017 * @default 1000
23018 */
23019 static BATCH_SIZE: number;
23020 }
23021 interface SpritesheetLoader extends PIXI.ILoaderPlugin {
23022 }
23023 /**
23024 * {@link PIXI.Loader Loader} middleware for loading texture atlases that have been created with
23025 * TexturePacker or similar JSON-based spritesheet.
23026 *
23027 * This middleware automatically generates Texture resources.
23028 *
23029 * @class
23030 * @memberof PIXI
23031 * @implements PIXI.ILoaderPlugin
23032 */
23033 class SpritesheetLoader implements PIXI.ILoaderPlugin {
23034 /**
23035 * Called after a resource is loaded.
23036 * @see PIXI.Loader.loaderMiddleware
23037 * @param {PIXI.LoaderResource} resource
23038 * @param {function} next
23039 */
23040 static use(resource: PIXI.LoaderResource, next: (...params: any[]) => any): void;
23041 /**
23042 * Get the spritesheets root path
23043 * @param {PIXI.LoaderResource} resource - Resource to check path
23044 * @param {string} baseUrl - Base root url
23045 */
23046 static getResourcePath(resource: PIXI.LoaderResource, baseUrl: string): void;
23047 }
23048 /**
23049 * A Text Object will create a line or multiple lines of text.
23050 *
23051 * The text is created using the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API).
23052 *
23053 * The primary advantage of this class over BitmapText is that you have great control over the style of the next,
23054 * which you can change at runtime.
23055 *
23056 * The primary disadvantages is that each piece of text has it's own texture, which can use more memory.
23057 * When text changes, this texture has to be re-generated and re-uploaded to the GPU, taking up time.
23058 *
23059 * To split a line you can use '\n' in your text string, or, on the `style` object,
23060 * change its `wordWrap` property to true and and give the `wordWrapWidth` property a value.
23061 *
23062 * A Text can be created directly from a string and a style object,
23063 * which can be generated [here](https://pixijs.io/pixi-text-style).
23064 *
23065 * ```js
23066 * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});
23067 * ```
23068 *
23069 * @class
23070 * @extends PIXI.Sprite
23071 * @memberof PIXI
23072 */
23073 class Text extends PIXI.Sprite {
23074 constructor(text: string, style?: any | PIXI.TextStyle, canvas?: HTMLCanvasElement);
23075 /**
23076 * The canvas element that everything is drawn to
23077 *
23078 * @member {HTMLCanvasElement} PIXI.Text#canvas
23079 */
23080 canvas: HTMLCanvasElement;
23081 /**
23082 * The canvas 2d context that everything is drawn with
23083 * @member {CanvasRenderingContext2D} PIXI.Text#context
23084 */
23085 context: CanvasRenderingContext2D;
23086 /**
23087 * The resolution / device pixel ratio of the canvas.
23088 * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.
23089 * @member {number} PIXI.Text#_resolution
23090 * @default 1
23091 */
23092 _resolution: number;
23093 /**
23094 * Renders text to its canvas, and updates its texture.
23095 * By default this is used internally to ensure the texture is correct before rendering,
23096 * but it can be used called externally, for example from this class to 'pre-generate' the texture from a piece of text,
23097 * and then shared across multiple Sprites.
23098 *
23099 * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.
23100 */
23101 updateText(respectDirty: boolean): void;
23102 /**
23103 * Renders the object using the WebGL renderer
23104 *
23105 * @protected
23106 * @param {PIXI.Renderer} renderer - The renderer
23107 */
23108 protected _render(renderer: PIXI.Renderer): void;
23109 /**
23110 * Gets the local bounds of the text object.
23111 *
23112 * @param {PIXI.Rectangle} rect - The output rectangle.
23113 * @return {PIXI.Rectangle} The bounds.
23114 */
23115 getLocalBounds(rect: PIXI.Rectangle): PIXI.Rectangle;
23116 /**
23117 * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.
23118 * @protected
23119 */
23120 protected _calculateBounds(): void;
23121 /**
23122 * Destroys this text object.
23123 * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as
23124 * the majority of the time the texture will not be shared with any other Sprites.
23125 *
23126 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
23127 * have been set to that value
23128 * @param {boolean} [options.children=false] - if set to true, all the children will have their
23129 * destroy method called as well. 'options' will be passed on to those calls.
23130 * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well
23131 * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well
23132 */
23133 destroy(options?: {
23134 children?: boolean;
23135 texture?: boolean;
23136 baseTexture?: boolean;
23137 }): void;
23138 /**
23139 * The width of the Text, setting this will actually modify the scale to achieve the value set
23140 *
23141 * @member {number}
23142 */
23143 width: number;
23144 /**
23145 * The height of the Text, setting this will actually modify the scale to achieve the value set
23146 *
23147 * @member {number}
23148 */
23149 height: number;
23150 /**
23151 * Set the style of the text. Set up an event listener to listen for changes on the style
23152 * object and mark the text as dirty.
23153 *
23154 * @member {object|PIXI.TextStyle}
23155 */
23156 style: any | PIXI.TextStyle;
23157 /**
23158 * Set the copy for the text object. To split a line you can use '\n'.
23159 *
23160 * @member {string}
23161 */
23162 text: string;
23163 /**
23164 * The resolution / device pixel ratio of the canvas.
23165 * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.
23166 * @member {number}
23167 * @default 1
23168 */
23169 resolution: number;
23170 /**
23171 * Cached tinted texture.
23172 * @memberof PIXI.Sprite#
23173 * @member {HTMLCanvasElement} _tintedCanvas
23174 * @protected
23175 */
23176 protected _tintedCanvas: HTMLCanvasElement;
23177 /**
23178 * The width of the sprite (this is initially set by the texture)
23179 *
23180 * @protected
23181 * @member {number} PIXI.Sprite#_width
23182 */
23183 protected _width: number;
23184 /**
23185 * The height of the sprite (this is initially set by the texture)
23186 *
23187 * @protected
23188 * @member {number} PIXI.Sprite#_height
23189 */
23190 protected _height: number;
23191 /**
23192 * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
23193 *
23194 * @member {number} PIXI.Sprite#blendMode
23195 * @default PIXI.BLEND_MODES.NORMAL
23196 * @see PIXI.BLEND_MODES
23197 */
23198 blendMode: number;
23199 /**
23200 * Cached tint value so we can tell when the tint is changed.
23201 * Value is used for 2d CanvasRenderer.
23202 *
23203 * @protected
23204 * @member {number} PIXI.Sprite#_cachedTint
23205 * @default 0xFFFFFF
23206 */
23207 protected _cachedTint: number;
23208 /**
23209 * Plugin that is responsible for rendering this element.
23210 * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods.
23211 *
23212 * @member {string} PIXI.Sprite#pluginName
23213 * @default 'batch'
23214 */
23215 pluginName: string;
23216 /**
23217 * used to fast check if a sprite is.. a sprite!
23218 * @member {boolean} PIXI.Sprite#isSprite
23219 */
23220 isSprite: boolean;
23221 /**
23222 * When the texture is updated, this event will fire to update the scale and frame
23223 *
23224 * @protected
23225 */
23226 protected _onTextureUpdate(): void;
23227 /**
23228 * calculates worldTransform * vertices, store it in vertexData
23229 */
23230 calculateVertices(): void;
23231 /**
23232 * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData
23233 * This is used to ensure that the true width and height of a trimmed texture is respected
23234 */
23235 calculateTrimmedVertices(): void;
23236 /**
23237 * Tests if a point is inside this sprite
23238 *
23239 * @param {PIXI.IPointData} point - the point to test
23240 * @return {boolean} the result of the test
23241 */
23242 containsPoint(point: PIXI.IPointData): boolean;
23243 /**
23244 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
23245 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
23246 * The main disadvantage is movement of objects may appear less smooth.
23247 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
23248 *
23249 * @member {boolean}
23250 * @default false
23251 */
23252 roundPixels: boolean;
23253 /**
23254 * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}
23255 * and passed to the constructor.
23256 *
23257 * The default is `(0,0)`, this means the sprite's origin is the top left.
23258 *
23259 * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.
23260 *
23261 * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.
23262 *
23263 * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.
23264 *
23265 * @example
23266 * const sprite = new PIXI.Sprite(texture);
23267 * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).
23268 *
23269 * @member {PIXI.ObservablePoint}
23270 */
23271 anchor: PIXI.ObservablePoint;
23272 /**
23273 * The tint applied to the sprite. This is a hex value.
23274 * A value of 0xFFFFFF will remove any tint effect.
23275 *
23276 * @member {number}
23277 * @default 0xFFFFFF
23278 */
23279 tint: number;
23280 /**
23281 * The texture that the sprite is using
23282 *
23283 * @member {PIXI.Texture}
23284 */
23285 texture: PIXI.Texture;
23286 /**
23287 * Renders the object using the Canvas renderer
23288 * @method renderCanvas
23289 * @memberof PIXI.Container#
23290 * @param {PIXI.CanvasRenderer} renderer - The renderer
23291 */
23292 renderCanvas(renderer: PIXI.CanvasRenderer): void;
23293 /**
23294 * The array of children of this container.
23295 *
23296 * @member {PIXI.DisplayObject[]} PIXI.Container#children
23297 * @readonly
23298 */
23299 readonly children: PIXI.DisplayObject[];
23300 /**
23301 * If set to true, the container will sort its children by zIndex value
23302 * when updateTransform() is called, or manually if sortChildren() is called.
23303 *
23304 * This actually changes the order of elements in the array, so should be treated
23305 * as a basic solution that is not performant compared to other solutions,
23306 * such as @link https://github.com/pixijs/pixi-display
23307 *
23308 * Also be aware of that this may not work nicely with the addChildAt() function,
23309 * as the zIndex sorting may cause the child to automatically sorted to another position.
23310 *
23311 * @see PIXI.settings.SORTABLE_CHILDREN
23312 *
23313 * @member {boolean} PIXI.Container#sortableChildren
23314 */
23315 sortableChildren: boolean;
23316 /**
23317 * Should children be sorted by zIndex at the next updateTransform call.
23318 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
23319 *
23320 * @member {boolean} PIXI.Container#sortDirty
23321 */
23322 sortDirty: boolean;
23323 /**
23324 * Overridable method that can be used by Container subclasses whenever the children array is modified
23325 *
23326 * @protected
23327 */
23328 protected onChildrenChange(): void;
23329 /**
23330 * Adds one or more children to the container.
23331 *
23332 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
23333 *
23334 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
23335 * @return {PIXI.DisplayObject} The first child that was added.
23336 */
23337 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
23338 /**
23339 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
23340 *
23341 * @param {PIXI.DisplayObject} child - The child to add
23342 * @param {number} index - The index to place the child in
23343 * @return {PIXI.DisplayObject} The child that was added.
23344 */
23345 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
23346 /**
23347 * Swaps the position of 2 Display Objects within this container.
23348 *
23349 * @param {PIXI.DisplayObject} child - First display object to swap
23350 * @param {PIXI.DisplayObject} child2 - Second display object to swap
23351 */
23352 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
23353 /**
23354 * Returns the index position of a child DisplayObject instance
23355 *
23356 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
23357 * @return {number} The index position of the child display object to identify
23358 */
23359 getChildIndex(child: PIXI.DisplayObject): number;
23360 /**
23361 * Changes the position of an existing child in the display object container
23362 *
23363 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
23364 * @param {number} index - The resulting index number for the child display object
23365 */
23366 setChildIndex(child: PIXI.DisplayObject, index: number): void;
23367 /**
23368 * Returns the child at the specified index
23369 *
23370 * @param {number} index - The index to get the child at
23371 * @return {PIXI.DisplayObject} The child at the given index, if any.
23372 */
23373 getChildAt(index: number): PIXI.DisplayObject;
23374 /**
23375 * Removes one or more children from the container.
23376 *
23377 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
23378 * @return {PIXI.DisplayObject} The first child that was removed.
23379 */
23380 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
23381 /**
23382 * Removes a child from the specified index position.
23383 *
23384 * @param {number} index - The index to get the child from
23385 * @return {PIXI.DisplayObject} The child that was removed.
23386 */
23387 removeChildAt(index: number): PIXI.DisplayObject;
23388 /**
23389 * Removes all children from this container that are within the begin and end indexes.
23390 *
23391 * @param {number} [beginIndex=0] - The beginning position.
23392 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
23393 * @returns {PIXI.DisplayObject[]} List of removed children
23394 */
23395 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
23396 /**
23397 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
23398 */
23399 sortChildren(): void;
23400 /**
23401 * Updates the transform on all children of this container for rendering
23402 */
23403 updateTransform(): void;
23404 /**
23405 * Recalculates the bounds of the container.
23406 *
23407 */
23408 calculateBounds(): void;
23409 /**
23410 * Renders the object using the WebGL renderer
23411 *
23412 * @param {PIXI.Renderer} renderer - The renderer
23413 */
23414 render(renderer: PIXI.Renderer): void;
23415 /**
23416 * Render the object using the WebGL renderer and advanced features.
23417 *
23418 * @protected
23419 * @param {PIXI.Renderer} renderer - The renderer
23420 */
23421 protected renderAdvanced(renderer: PIXI.Renderer): void;
23422 /**
23423 * Container default updateTransform, does update children of container.
23424 * Will crash if there's no parent element.
23425 *
23426 * @memberof PIXI.Container#
23427 * @function containerUpdateTransform
23428 */
23429 containerUpdateTransform(): void;
23430 /**
23431 * Determines if the children to the displayObject can be clicked/touched
23432 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
23433 *
23434 * @member {boolean}
23435 * @memberof PIXI.Container#
23436 */
23437 interactiveChildren: boolean;
23438 /**
23439 * Returns the display object in the container.
23440 *
23441 * Recursive searches are done in a preorder traversal.
23442 *
23443 * @method getChildByName
23444 * @memberof PIXI.Container#
23445 * @param {string} name - Instance name.
23446 * @param {boolean}[deep=false] - Whether to search recursively
23447 * @return {PIXI.DisplayObject} The child with the specified name.
23448 */
23449 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
23450 /**
23451 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
23452 * shadow div with attributes set
23453 *
23454 * @member {boolean}
23455 * @memberof PIXI.DisplayObject#
23456 */
23457 accessible: boolean;
23458 /**
23459 * Sets the title attribute of the shadow div
23460 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
23461 *
23462 * @member {?string}
23463 * @memberof PIXI.DisplayObject#
23464 */
23465 accessibleTitle: string;
23466 /**
23467 * Sets the aria-label attribute of the shadow div
23468 *
23469 * @member {string}
23470 * @memberof PIXI.DisplayObject#
23471 */
23472 accessibleHint: string;
23473 /**
23474 * @member {boolean}
23475 * @memberof PIXI.DisplayObject#
23476 * @todo Needs docs.
23477 */
23478 _accessibleActive: boolean;
23479 /**
23480 * @member {boolean}
23481 * @memberof PIXI.DisplayObject#
23482 * @todo Needs docs.
23483 */
23484 _accessibleDiv: boolean;
23485 /**
23486 * Specify the type of div the accessible layer is. Screen readers treat the element differently
23487 * depending on this type. Defaults to button.
23488 *
23489 * @member {string}
23490 * @memberof PIXI.DisplayObject#
23491 * @default 'button'
23492 */
23493 accessibleType: string;
23494 /**
23495 * Specify the pointer-events the accessible div will use
23496 * Defaults to auto.
23497 *
23498 * @member {string}
23499 * @memberof PIXI.DisplayObject#
23500 * @default 'auto'
23501 */
23502 accessiblePointerEvents: string;
23503 /**
23504 * Setting to false will prevent any children inside this container to
23505 * be accessible. Defaults to true.
23506 *
23507 * @member {boolean}
23508 * @memberof PIXI.DisplayObject#
23509 * @default true
23510 */
23511 accessibleChildren: boolean;
23512 /**
23513 * World transform and local transform of this object.
23514 * This will become read-only later, please do not assign anything there unless you know what are you doing.
23515 *
23516 * @member {PIXI.Transform} PIXI.DisplayObject#transform
23517 */
23518 transform: PIXI.Transform;
23519 /**
23520 * The opacity of the object.
23521 *
23522 * @member {number} PIXI.DisplayObject#alpha
23523 */
23524 alpha: number;
23525 /**
23526 * The visibility of the object. If false the object will not be drawn, and
23527 * the updateTransform function will not be called.
23528 *
23529 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
23530 *
23531 * @member {boolean} PIXI.DisplayObject#visible
23532 */
23533 visible: boolean;
23534 /**
23535 * Can this object be rendered, if false the object will not be drawn but the updateTransform
23536 * methods will still be called.
23537 *
23538 * Only affects recursive calls from parent. You can ask for bounds manually.
23539 *
23540 * @member {boolean} PIXI.DisplayObject#renderable
23541 */
23542 renderable: boolean;
23543 /**
23544 * The display object container that contains this display object.
23545 *
23546 * @member {PIXI.Container} PIXI.DisplayObject#parent
23547 */
23548 parent: PIXI.Container;
23549 /**
23550 * The multiplied alpha of the displayObject.
23551 *
23552 * @member {number} PIXI.DisplayObject#worldAlpha
23553 * @readonly
23554 */
23555 readonly worldAlpha: number;
23556 /**
23557 * Which index in the children array the display component was before the previous zIndex sort.
23558 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
23559 *
23560 * @member {number} PIXI.DisplayObject#_lastSortedIndex
23561 * @protected
23562 */
23563 protected _lastSortedIndex: number;
23564 /**
23565 * The zIndex of the displayObject.
23566 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
23567 *
23568 * @member {number} PIXI.DisplayObject#_zIndex
23569 * @protected
23570 */
23571 protected _zIndex: number;
23572 /**
23573 * The area the filter is applied to. This is used as more of an optimization
23574 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
23575 *
23576 * Also works as an interaction mask.
23577 *
23578 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
23579 */
23580 filterArea: PIXI.Rectangle;
23581 /**
23582 * Sets the filters for the displayObject.
23583 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
23584 * To remove filters simply set this property to `'null'`.
23585 *
23586 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
23587 */
23588 filters: PIXI.Filter[];
23589 /**
23590 * Currently enabled filters
23591 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
23592 * @protected
23593 */
23594 protected _enabledFilters: PIXI.Filter[];
23595 /**
23596 * The bounds object, this is used to calculate and store the bounds of the displayObject.
23597 *
23598 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
23599 */
23600 _bounds: PIXI.Bounds;
23601 /**
23602 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
23603 *
23604 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
23605 */
23606 _localBounds: PIXI.Bounds;
23607 /**
23608 * Flags the cached bounds as dirty.
23609 *
23610 * @member {number} PIXI.DisplayObject#_boundsID
23611 * @protected
23612 */
23613 protected _boundsID: number;
23614 /**
23615 * Cache of this display-object's bounds-rectangle.
23616 *
23617 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
23618 * @protected
23619 */
23620 protected _boundsRect: PIXI.Bounds;
23621 /**
23622 * Cache of this display-object's local-bounds rectangle.
23623 *
23624 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
23625 * @protected
23626 */
23627 protected _localBoundsRect: PIXI.Bounds;
23628 /**
23629 * The original, cached mask of the object.
23630 *
23631 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
23632 * @protected
23633 */
23634 protected _mask: PIXI.Container | PIXI.MaskData | null;
23635 /**
23636 * If the object has been destroyed via destroy(). If true, it should not be used.
23637 *
23638 * @member {boolean} PIXI.DisplayObject#_destroyed
23639 * @protected
23640 */
23641 protected _destroyed: boolean;
23642 /**
23643 * Does any other displayObject use this object as a mask?
23644 * @member {boolean} PIXI.DisplayObject#isMask
23645 */
23646 isMask: boolean;
23647 /**
23648 * Recursively updates transform of all objects from the root to this one
23649 * internal function for toLocal()
23650 */
23651 _recursivePostUpdateTransform(): void;
23652 /**
23653 * Retrieves the bounds of the displayObject as a rectangle object.
23654 *
23655 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
23656 * being updated. This means the calculation returned MAY be out of date BUT will give you a
23657 * nice performance boost.
23658 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
23659 * @return {PIXI.Rectangle} The rectangular bounding area.
23660 */
23661 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
23662 /**
23663 * Calculates the global position of the display object.
23664 *
23665 * @param {PIXI.IPointData} position - The world origin to calculate from.
23666 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
23667 * (otherwise will create a new Point).
23668 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
23669 * @return {PIXI.Point} A point object representing the position of this object.
23670 */
23671 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
23672 /**
23673 * Calculates the local position of the display object relative to another point.
23674 *
23675 * @param {PIXI.IPointData} position - The world origin to calculate from.
23676 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
23677 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
23678 * (otherwise will create a new Point).
23679 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
23680 * @return {PIXI.Point} A point object representing the position of this object
23681 */
23682 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
23683 /**
23684 * Set the parent Container of this DisplayObject.
23685 *
23686 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
23687 * @return {PIXI.Container} The Container that this DisplayObject was added to.
23688 */
23689 setParent(container: PIXI.Container): PIXI.Container;
23690 /**
23691 * Convenience function to set the position, scale, skew and pivot at once.
23692 *
23693 * @param {number} [x=0] - The X position
23694 * @param {number} [y=0] - The Y position
23695 * @param {number} [scaleX=1] - The X scale value
23696 * @param {number} [scaleY=1] - The Y scale value
23697 * @param {number} [rotation=0] - The rotation
23698 * @param {number} [skewX=0] - The X skew value
23699 * @param {number} [skewY=0] - The Y skew value
23700 * @param {number} [pivotX=0] - The X pivot value
23701 * @param {number} [pivotY=0] - The Y pivot value
23702 * @return {PIXI.DisplayObject} The DisplayObject instance
23703 */
23704 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
23705 /**
23706 * @protected
23707 * @member {PIXI.Container}
23708 */
23709 protected _tempDisplayObjectParent: PIXI.Container;
23710 /**
23711 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
23712 *
23713 * ```
23714 * const cacheParent = elem.enableTempParent();
23715 * elem.updateTransform();
23716 * elem.disableTempParent(cacheParent);
23717 * ```
23718 *
23719 * @returns {PIXI.DisplayObject} current parent
23720 */
23721 enableTempParent(): PIXI.DisplayObject;
23722 /**
23723 * Pair method for `enableTempParent`
23724 * @param {PIXI.DisplayObject} cacheParent actual parent of element
23725 */
23726 disableTempParent(cacheParent: PIXI.DisplayObject): void;
23727 /**
23728 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
23729 * An alias to position.x
23730 *
23731 * @member {number}
23732 */
23733 x: number;
23734 /**
23735 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
23736 * An alias to position.y
23737 *
23738 * @member {number}
23739 */
23740 y: number;
23741 /**
23742 * Current transform of the object based on world (parent) factors.
23743 *
23744 * @member {PIXI.Matrix}
23745 * @readonly
23746 */
23747 readonly worldTransform: PIXI.Matrix;
23748 /**
23749 * Current transform of the object based on local factors: position, scale, other stuff.
23750 *
23751 * @member {PIXI.Matrix}
23752 * @readonly
23753 */
23754 readonly localTransform: PIXI.Matrix;
23755 /**
23756 * The coordinate of the object relative to the local coordinates of the parent.
23757 * Assignment by value since pixi-v4.
23758 *
23759 * @member {PIXI.ObservablePoint}
23760 */
23761 position: PIXI.ObservablePoint;
23762 /**
23763 * The scale factor of the object.
23764 * Assignment by value since pixi-v4.
23765 *
23766 * @member {PIXI.ObservablePoint}
23767 */
23768 scale: PIXI.ObservablePoint;
23769 /**
23770 * The pivot point of the displayObject that it rotates around.
23771 * Assignment by value since pixi-v4.
23772 *
23773 * @member {PIXI.ObservablePoint}
23774 */
23775 pivot: PIXI.ObservablePoint;
23776 /**
23777 * The skew factor for the object in radians.
23778 * Assignment by value since pixi-v4.
23779 *
23780 * @member {PIXI.ObservablePoint}
23781 */
23782 skew: PIXI.ObservablePoint;
23783 /**
23784 * The rotation of the object in radians.
23785 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
23786 *
23787 * @member {number}
23788 */
23789 rotation: number;
23790 /**
23791 * The angle of the object in degrees.
23792 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
23793 *
23794 * @member {number}
23795 */
23796 angle: number;
23797 /**
23798 * The zIndex of the displayObject.
23799 * If a container has the sortableChildren property set to true, children will be automatically
23800 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
23801 * and thus rendered on top of other displayObjects within the same container.
23802 *
23803 * @member {number}
23804 */
23805 zIndex: number;
23806 /**
23807 * Indicates if the object is globally visible.
23808 *
23809 * @member {boolean}
23810 * @readonly
23811 */
23812 readonly worldVisible: boolean;
23813 /**
23814 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
23815 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
23816 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
23817 * utilities shape clipping. To remove a mask, set this property to `null`.
23818 *
23819 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
23820 * @example
23821 * const graphics = new PIXI.Graphics();
23822 * graphics.beginFill(0xFF3300);
23823 * graphics.drawRect(50, 250, 100, 100);
23824 * graphics.endFill();
23825 *
23826 * const sprite = new PIXI.Sprite(texture);
23827 * sprite.mask = graphics;
23828 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
23829 *
23830 * @member {PIXI.Container|PIXI.MaskData|null}
23831 */
23832 mask: PIXI.Container | PIXI.MaskData | null;
23833 /**
23834 * DisplayObject default updateTransform, does not update children of container.
23835 * Will crash if there's no parent element.
23836 *
23837 * @memberof PIXI.DisplayObject#
23838 * @function displayObjectUpdateTransform
23839 */
23840 displayObjectUpdateTransform(): void;
23841 /**
23842 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
23843 * events will not be emitted unless `interactive` is set to `true`.
23844 *
23845 * @example
23846 * const sprite = new PIXI.Sprite(texture);
23847 * sprite.interactive = true;
23848 * sprite.on('tap', (event) => {
23849 * //handle event
23850 * });
23851 * @member {boolean}
23852 * @memberof PIXI.DisplayObject#
23853 */
23854 interactive: boolean;
23855 /**
23856 * Interaction shape. Children will be hit first, then this shape will be checked.
23857 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
23858 *
23859 * @example
23860 * const sprite = new PIXI.Sprite(texture);
23861 * sprite.interactive = true;
23862 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
23863 * @member {PIXI.IHitArea}
23864 * @memberof PIXI.DisplayObject#
23865 */
23866 hitArea: PIXI.IHitArea;
23867 /**
23868 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
23869 * Setting this changes the 'cursor' property to `'pointer'`.
23870 *
23871 * @example
23872 * const sprite = new PIXI.Sprite(texture);
23873 * sprite.interactive = true;
23874 * sprite.buttonMode = true;
23875 * @member {boolean}
23876 * @memberof PIXI.DisplayObject#
23877 */
23878 buttonMode: boolean;
23879 /**
23880 * This defines what cursor mode is used when the mouse cursor
23881 * is hovered over the displayObject.
23882 *
23883 * @example
23884 * const sprite = new PIXI.Sprite(texture);
23885 * sprite.interactive = true;
23886 * sprite.cursor = 'wait';
23887 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
23888 *
23889 * @member {string}
23890 * @memberof PIXI.DisplayObject#
23891 */
23892 cursor: string;
23893 /**
23894 * Set this to true if you want this display object to be cached as a bitmap.
23895 * This basically takes a snap shot of the display object as it is at that moment. It can
23896 * provide a performance benefit for complex static displayObjects.
23897 * To remove simply set this property to `false`
23898 *
23899 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
23900 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
23901 *
23902 * @member {boolean}
23903 * @memberof PIXI.DisplayObject#
23904 */
23905 cacheAsBitmap: boolean;
23906 /**
23907 * The instance name of the object.
23908 *
23909 * @memberof PIXI.DisplayObject#
23910 * @member {string} name
23911 */
23912 name: string;
23913 /**
23914 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
23915 *
23916 * @method getGlobalPosition
23917 * @memberof PIXI.DisplayObject#
23918 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
23919 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
23920 * being updated. This means the calculation returned MAY be out of date BUT will give you a
23921 * nice performance boost.
23922 * @return {PIXI.Point} The updated point.
23923 */
23924 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
23925 }
23926 /**
23927 * A number, or a string containing a number.
23928 *
23929 * @memberof PIXI
23930 * @typedef IFontMetrics
23931 * @property {number} ascent - Font ascent
23932 * @property {number} descent - Font descent
23933 * @property {number} fontSize - Font size
23934 */
23935 type IFontMetrics = {
23936 ascent: number;
23937 descent: number;
23938 fontSize: number;
23939 };
23940 /**
23941 * The TextMetrics object represents the measurement of a block of text with a specified style.
23942 *
23943 * ```js
23944 * let style = new PIXI.TextStyle({fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'})
23945 * let textMetrics = PIXI.TextMetrics.measureText('Your text', style)
23946 * ```
23947 *
23948 * @class
23949 * @memberof PIXI
23950 */
23951 class TextMetrics {
23952 constructor(text: string, style: PIXI.TextStyle, width: number, height: number, lines: string[], lineWidths: number[], lineHeight: number, maxLineWidth: number, fontProperties: any);
23953 /**
23954 * The text that was measured
23955 *
23956 * @member {string} PIXI.TextMetrics#text
23957 */
23958 text: string;
23959 /**
23960 * The style that was measured
23961 *
23962 * @member {PIXI.TextStyle} PIXI.TextMetrics#style
23963 */
23964 style: PIXI.TextStyle;
23965 /**
23966 * The measured width of the text
23967 *
23968 * @member {number} PIXI.TextMetrics#width
23969 */
23970 width: number;
23971 /**
23972 * The measured height of the text
23973 *
23974 * @member {number} PIXI.TextMetrics#height
23975 */
23976 height: number;
23977 /**
23978 * An array of lines of the text broken by new lines and wrapping is specified in style
23979 *
23980 * @member {string[]} PIXI.TextMetrics#lines
23981 */
23982 lines: string[];
23983 /**
23984 * An array of the line widths for each line matched to `lines`
23985 *
23986 * @member {number[]} PIXI.TextMetrics#lineWidths
23987 */
23988 lineWidths: number[];
23989 /**
23990 * The measured line height for this style
23991 *
23992 * @member {number} PIXI.TextMetrics#lineHeight
23993 */
23994 lineHeight: number;
23995 /**
23996 * The maximum line width for all measured lines
23997 *
23998 * @member {number} PIXI.TextMetrics#maxLineWidth
23999 */
24000 maxLineWidth: number;
24001 /**
24002 * The font properties object from TextMetrics.measureFont
24003 *
24004 * @member {PIXI.IFontMetrics} PIXI.TextMetrics#fontProperties
24005 */
24006 fontProperties: PIXI.IFontMetrics;
24007 /**
24008 * Measures the supplied string of text and returns a Rectangle.
24009 *
24010 * @param {string} text - the text to measure.
24011 * @param {PIXI.TextStyle} style - the text style to use for measuring
24012 * @param {boolean} [wordWrap] - optional override for if word-wrap should be applied to the text.
24013 * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.
24014 * @return {PIXI.TextMetrics} measured width and height of the text.
24015 */
24016 static measureText(text: string, style: PIXI.TextStyle, wordWrap?: boolean, canvas?: HTMLCanvasElement): PIXI.TextMetrics;
24017 /**
24018 * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.
24019 *
24020 * It allows one to customise which words should break
24021 * Examples are if the token is CJK or numbers.
24022 * It must return a boolean.
24023 *
24024 * @param {string} token - The token
24025 * @param {boolean} breakWords - The style attr break words
24026 * @return {boolean} whether to break word or not
24027 */
24028 static canBreakWords(token: string, breakWords: boolean): boolean;
24029 /**
24030 * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.
24031 *
24032 * It allows one to determine whether a pair of characters
24033 * should be broken by newlines
24034 * For example certain characters in CJK langs or numbers.
24035 * It must return a boolean.
24036 *
24037 * @param {string} char - The character
24038 * @param {string} nextChar - The next character
24039 * @param {string} token - The token/word the characters are from
24040 * @param {number} index - The index in the token of the char
24041 * @param {boolean} breakWords - The style attr break words
24042 * @return {boolean} whether to break word or not
24043 */
24044 static canBreakChars(char: string, nextChar: string, token: string, index: number, breakWords: boolean): boolean;
24045 /**
24046 * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.
24047 *
24048 * It is called when a token (usually a word) has to be split into separate pieces
24049 * in order to determine the point to break a word.
24050 * It must return an array of characters.
24051 *
24052 * @example
24053 * // Correctly splits emojis, eg "🤪🤪" will result in two element array, each with one emoji.
24054 * TextMetrics.wordWrapSplit = (token) => [...token];
24055 *
24056 * @param {string} token - The token to split
24057 * @return {string[]} The characters of the token
24058 */
24059 static wordWrapSplit(token: string): string[];
24060 /**
24061 * Calculates the ascent, descent and fontSize of a given font-style
24062 *
24063 * @static
24064 * @param {string} font - String representing the style of the font
24065 * @return {PIXI.IFontMetrics} Font properties object
24066 */
24067 static measureFont(font: string): PIXI.IFontMetrics;
24068 /**
24069 * Clear font metrics in metrics cache.
24070 *
24071 * @static
24072 * @param {string} [font] - font name. If font name not set then clear cache for all fonts.
24073 */
24074 static clearMetrics(font?: string): void;
24075 /**
24076 * String used for calculate font metrics.
24077 * These characters are all tall to help calculate the height required for text.
24078 *
24079 * @static
24080 * @memberof PIXI.TextMetrics
24081 * @name METRICS_STRING
24082 * @type {string}
24083 * @default |ÉqÅ
24084 */
24085 static METRICS_STRING: string;
24086 /**
24087 * Baseline symbol for calculate font metrics.
24088 *
24089 * @static
24090 * @memberof PIXI.TextMetrics
24091 * @name BASELINE_SYMBOL
24092 * @type {string}
24093 * @default M
24094 */
24095 static BASELINE_SYMBOL: string;
24096 /**
24097 * Baseline multiplier for calculate font metrics.
24098 *
24099 * @static
24100 * @memberof PIXI.TextMetrics
24101 * @name BASELINE_MULTIPLIER
24102 * @type {number}
24103 * @default 1.4
24104 */
24105 static BASELINE_MULTIPLIER: number;
24106 }
24107 /**
24108 * A TextStyle Object contains information to decorate a Text objects.
24109 *
24110 * An instance can be shared between multiple Text objects; then changing the style will update all text objects using it.
24111 *
24112 * A tool can be used to generate a text style [here](https://pixijs.io/pixi-text-style).
24113 *
24114 * @class
24115 * @memberof PIXI
24116 */
24117 class TextStyle {
24118 constructor(style?: {
24119 align?: string;
24120 breakWords?: boolean;
24121 dropShadow?: boolean;
24122 dropShadowAlpha?: number;
24123 dropShadowAngle?: number;
24124 dropShadowBlur?: number;
24125 dropShadowColor?: string | number;
24126 dropShadowDistance?: number;
24127 fill?: string | string[] | number | number[] | CanvasGradient | CanvasPattern;
24128 fillGradientType?: number;
24129 fillGradientStops?: number[];
24130 fontFamily?: string | string[];
24131 fontSize?: number | string;
24132 fontStyle?: string;
24133 fontVariant?: string;
24134 fontWeight?: string;
24135 leading?: number;
24136 letterSpacing?: number;
24137 lineHeight?: number;
24138 lineJoin?: string;
24139 miterLimit?: number;
24140 padding?: number;
24141 stroke?: string | number;
24142 strokeThickness?: number;
24143 trim?: boolean;
24144 textBaseline?: string;
24145 whiteSpace?: string;
24146 wordWrap?: boolean;
24147 wordWrapWidth?: number;
24148 });
24149 /**
24150 * Creates a new TextStyle object with the same values as this one.
24151 * Note that the only the properties of the object are cloned.
24152 *
24153 * @return {PIXI.TextStyle} New cloned TextStyle object
24154 */
24155 clone(): PIXI.TextStyle;
24156 /**
24157 * Resets all properties to the defaults specified in TextStyle.prototype._default
24158 */
24159 reset(): void;
24160 /**
24161 * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
24162 *
24163 * @member {string}
24164 */
24165 align: string;
24166 /**
24167 * Indicates if lines can be wrapped within words, it needs wordWrap to be set to true
24168 *
24169 * @member {boolean}
24170 */
24171 breakWords: boolean;
24172 /**
24173 * Set a drop shadow for the text
24174 *
24175 * @member {boolean}
24176 */
24177 dropShadow: boolean;
24178 /**
24179 * Set alpha for the drop shadow
24180 *
24181 * @member {number}
24182 */
24183 dropShadowAlpha: number;
24184 /**
24185 * Set a angle of the drop shadow
24186 *
24187 * @member {number}
24188 */
24189 dropShadowAngle: number;
24190 /**
24191 * Set a shadow blur radius
24192 *
24193 * @member {number}
24194 */
24195 dropShadowBlur: number;
24196 /**
24197 * A fill style to be used on the dropshadow e.g 'red', '#00FF00'
24198 *
24199 * @member {string|number}
24200 */
24201 dropShadowColor: string | number;
24202 /**
24203 * Set a distance of the drop shadow
24204 *
24205 * @member {number}
24206 */
24207 dropShadowDistance: number;
24208 /**
24209 * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'.
24210 * Can be an array to create a gradient eg ['#000000','#FFFFFF']
24211 * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}
24212 *
24213 * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern}
24214 */
24215 fill: string | string[] | number | number[] | CanvasGradient | CanvasPattern;
24216 /**
24217 * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.
24218 * See {@link PIXI.TEXT_GRADIENT}
24219 *
24220 * @member {number}
24221 */
24222 fillGradientType: number;
24223 /**
24224 * If fill is an array of colours to create a gradient, this array can set the stop points
24225 * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.
24226 *
24227 * @member {number[]}
24228 */
24229 fillGradientStops: number[];
24230 /**
24231 * The font family
24232 *
24233 * @member {string|string[]}
24234 */
24235 fontFamily: string | string[];
24236 /**
24237 * The font size
24238 * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')
24239 *
24240 * @member {number|string}
24241 */
24242 fontSize: number | string;
24243 /**
24244 * The font style
24245 * ('normal', 'italic' or 'oblique')
24246 *
24247 * @member {string}
24248 */
24249 fontStyle: string;
24250 /**
24251 * The font variant
24252 * ('normal' or 'small-caps')
24253 *
24254 * @member {string}
24255 */
24256 fontVariant: string;
24257 /**
24258 * The font weight
24259 * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900')
24260 *
24261 * @member {string}
24262 */
24263 fontWeight: string;
24264 /**
24265 * The amount of spacing between letters, default is 0
24266 *
24267 * @member {number}
24268 */
24269 letterSpacing: number;
24270 /**
24271 * The line height, a number that represents the vertical space that a letter uses
24272 *
24273 * @member {number}
24274 */
24275 lineHeight: number;
24276 /**
24277 * The space between lines
24278 *
24279 * @member {number}
24280 */
24281 leading: number;
24282 /**
24283 * The lineJoin property sets the type of corner created, it can resolve spiked text issues.
24284 * Default is 'miter' (creates a sharp corner).
24285 *
24286 * @member {string}
24287 */
24288 lineJoin: string;
24289 /**
24290 * The miter limit to use when using the 'miter' lineJoin mode
24291 * This can reduce or increase the spikiness of rendered text.
24292 *
24293 * @member {number}
24294 */
24295 miterLimit: number;
24296 /**
24297 * Occasionally some fonts are cropped. Adding some padding will prevent this from happening
24298 * by adding padding to all sides of the text.
24299 *
24300 * @member {number}
24301 */
24302 padding: number;
24303 /**
24304 * A canvas fillstyle that will be used on the text stroke
24305 * e.g 'blue', '#FCFF00'
24306 *
24307 * @member {string|number}
24308 */
24309 stroke: string | number;
24310 /**
24311 * A number that represents the thickness of the stroke.
24312 * Default is 0 (no stroke)
24313 *
24314 * @member {number}
24315 */
24316 strokeThickness: number;
24317 /**
24318 * The baseline of the text that is rendered.
24319 *
24320 * @member {string}
24321 */
24322 textBaseline: string;
24323 /**
24324 * Trim transparent borders
24325 *
24326 * @member {boolean}
24327 */
24328 trim: boolean;
24329 /**
24330 * How newlines and spaces should be handled.
24331 * Default is 'pre' (preserve, preserve).
24332 *
24333 * value | New lines | Spaces
24334 * --- | --- | ---
24335 * 'normal' | Collapse | Collapse
24336 * 'pre' | Preserve | Preserve
24337 * 'pre-line' | Preserve | Collapse
24338 *
24339 * @member {string}
24340 */
24341 whiteSpace: string;
24342 /**
24343 * Indicates if word wrap should be used
24344 *
24345 * @member {boolean}
24346 */
24347 wordWrap: boolean;
24348 /**
24349 * The width at which text will wrap, it needs wordWrap to be set to true
24350 *
24351 * @member {number}
24352 */
24353 wordWrapWidth: number;
24354 /**
24355 * Generates a font style string to use for `TextMetrics.measureFont()`.
24356 *
24357 * @return {string} Font style string, for passing to `TextMetrics.measureFont()`
24358 */
24359 toFontString(): string;
24360 }
24361 /**
24362 * Constants that define the type of gradient on text.
24363 *
24364 * @static
24365 * @constant
24366 * @name TEXT_GRADIENT
24367 * @memberof PIXI
24368 * @type {object}
24369 * @property {number} LINEAR_VERTICAL Vertical gradient
24370 * @property {number} LINEAR_HORIZONTAL Linear gradient
24371 */
24372 var TEXT_GRADIENT: {
24373 LINEAR_VERTICAL: number;
24374 LINEAR_HORIZONTAL: number;
24375 };
24376 /**
24377 * @memberof PIXI
24378 * @interface IBitmapFontOptions
24379 * @property {string | string[] | string[][]} [chars=PIXI.BitmapFont.ALPHANUMERIC] - the character set to generate
24380 * @property {number} [resolution=1] - the resolution for rendering
24381 * @property {number} [padding=4] - the padding between glyphs in the atlas
24382 * @property {number} [textureWidth=512] - the width of the texture atlas
24383 * @property {number} [textureHeight=512] - the height of the texture atlas
24384 */
24385 interface IBitmapFontOptions {
24386 }
24387 /**
24388 * BitmapFont represents a typeface available for use with the BitmapText class. Use the `install`
24389 * method for adding a font to be used.
24390 *
24391 * @class
24392 * @memberof PIXI
24393 */
24394 class BitmapFont {
24395 constructor(data: PIXI.BitmapFontData, textures: PIXI.Texture[] | {
24396 [key: string]: PIXI.Texture;
24397 });
24398 /**
24399 * The name of the font face.
24400 *
24401 * @member {string} PIXI.BitmapFont#font
24402 * @readonly
24403 */
24404 readonly font: string;
24405 /**
24406 * The size of the font face in pixels.
24407 *
24408 * @member {number} PIXI.BitmapFont#size
24409 * @readonly
24410 */
24411 readonly size: number;
24412 /**
24413 * The line-height of the font face in pixels.
24414 *
24415 * @member {number} PIXI.BitmapFont#lineHeight
24416 * @readonly
24417 */
24418 readonly lineHeight: number;
24419 /**
24420 * The map of characters by character code.
24421 *
24422 * @member {object} PIXI.BitmapFont#chars
24423 * @readonly
24424 */
24425 readonly chars: any;
24426 /**
24427 * Remove references to created glyph textures.
24428 */
24429 destroy(): void;
24430 /**
24431 * Register a new bitmap font.
24432 *
24433 * @static
24434 * @param {XMLDocument|string|PIXI.BitmapFontData} data - The
24435 * characters map that could be provided as xml or raw string.
24436 * @param {Object.<string, PIXI.Texture>|PIXI.Texture|PIXI.Texture[]}
24437 * textures - List of textures for each page.
24438 * @return {PIXI.BitmapFont} Result font object with font, size, lineHeight
24439 * and char fields.
24440 */
24441 static install(data: XMLDocument | string | PIXI.BitmapFontData, textures: {
24442 [key: string]: PIXI.Texture;
24443 } | PIXI.Texture | PIXI.Texture[]): PIXI.BitmapFont;
24444 /**
24445 * Remove bitmap font by name.
24446 *
24447 * @static
24448 * @param {string} name
24449 */
24450 static uninstall(name: string): void;
24451 /**
24452 * Generates a bitmap-font for the given style and character set. This does not support
24453 * kernings yet. With `style` properties, only the following non-layout properties are used:
24454 *
24455 * - {@link PIXI.TextStyle#dropShadow|dropShadow}
24456 * - {@link PIXI.TextStyle#dropShadowDistance|dropShadowDistance}
24457 * - {@link PIXI.TextStyle#dropShadowColor|dropShadowColor}
24458 * - {@link PIXI.TextStyle#dropShadowBlur|dropShadowBlur}
24459 * - {@link PIXI.TextStyle#dropShadowAngle|dropShadowAngle}
24460 * - {@link PIXI.TextStyle#fill|fill}
24461 * - {@link PIXI.TextStyle#fillGradientStops|fillGradientStops}
24462 * - {@link PIXI.TextStyle#fillGradientType|fillGradientType}
24463 * - {@link PIXI.TextStyle#fontFamily|fontFamily}
24464 * - {@link PIXI.TextStyle#fontSize|fontSize}
24465 * - {@link PIXI.TextStyle#fontVariant|fontVariant}
24466 * - {@link PIXI.TextStyle#fontWeight|fontWeight}
24467 * - {@link PIXI.TextStyle#lineJoin|lineJoin}
24468 * - {@link PIXI.TextStyle#miterLimit|miterLimit}
24469 * - {@link PIXI.TextStyle#stroke|stroke}
24470 * - {@link PIXI.TextStyle#strokeThickness|strokeThickness}
24471 * - {@link PIXI.TextStyle#textBaseline|textBaseline}
24472 *
24473 * @param {string} name - The name of the custom font to use with BitmapText.
24474 * @param {object|PIXI.TextStyle} [style] - Style options to render with BitmapFont.
24475 * @param {PIXI.IBitmapFontOptions} [options] - Setup options for font or name of the font.
24476 * @param {string|string[]|string[][]} [options.chars=PIXI.BitmapFont.ALPHANUMERIC] - characters included
24477 * in the font set. You can also use ranges. For example, `[['a', 'z'], ['A', 'Z'], "!@#$%^&*()~{}[] "]`.
24478 * Don't forget to include spaces ' ' in your character set!
24479 * @param {number} [options.resolution=1] - Render resolution for glyphs.
24480 * @param {number} [options.textureWidth=512] - Optional width of atlas, smaller values to reduce memory.
24481 * @param {number} [options.textureHeight=512] - Optional height of atlas, smaller values to reduce memory.
24482 * @param {number} [options.padding=4] - Padding between glyphs on texture atlas.
24483 * @return {PIXI.BitmapFont} Font generated by style options.
24484 * @static
24485 * @example
24486 * PIXI.BitmapFont.from("TitleFont", {
24487 * fontFamily: "Arial",
24488 * fontSize: 12,
24489 * strokeThickness: 2,
24490 * fill: "purple"
24491 * });
24492 *
24493 * const title = new PIXI.BitmapText("This is the title", { fontName: "TitleFont" });
24494 */
24495 static from(name: string, style?: any | PIXI.TextStyle, options?: {
24496 chars?: string | string[] | string[][];
24497 resolution?: number;
24498 textureWidth?: number;
24499 textureHeight?: number;
24500 padding?: number;
24501 }): PIXI.BitmapFont;
24502 /**
24503 * This character set includes all the letters in the alphabet (both lower- and upper- case).
24504 * @readonly
24505 * @static
24506 * @member {string[][]}
24507 * @example
24508 * BitmapFont.from("ExampleFont", style, { chars: BitmapFont.ALPHA })
24509 */
24510 static readonly ALPHA: string[][];
24511 /**
24512 * This character set includes all decimal digits (from 0 to 9).
24513 * @readonly
24514 * @static
24515 * @member {string[][]}
24516 * @example
24517 * BitmapFont.from("ExampleFont", style, { chars: BitmapFont.NUMERIC })
24518 */
24519 static readonly NUMERIC: string[][];
24520 /**
24521 * This character set is the union of `BitmapFont.ALPHA` and `BitmapFont.NUMERIC`.
24522 * @readonly
24523 * @static
24524 * @member {string[][]}
24525 */
24526 static readonly ALPHANUMERIC: string[][];
24527 /**
24528 * This character set consists of all the ASCII table.
24529 * @readonly
24530 * @static
24531 * @member {string[][]}
24532 * @see http://www.asciitable.com/
24533 */
24534 static readonly ASCII: string[][];
24535 /**
24536 * Collection of default options when using `BitmapFont.from`.
24537 *
24538 * @readonly
24539 * @static
24540 * @member {PIXI.IBitmapFontOptions}
24541 * @property {number} resolution=1
24542 * @property {number} textureWidth=512
24543 * @property {number} textureHeight=512
24544 * @property {number} padding=4
24545 * @property {string|string[]|string[][]} chars=PIXI.BitmapFont.ALPHANUMERIC
24546 */
24547 static readonly defaultOptions: PIXI.IBitmapFontOptions;
24548 /**
24549 * Collection of available/installed fonts.
24550 *
24551 * @readonly
24552 * @static
24553 * @member {Object.<string, PIXI.BitmapFont>}
24554 */
24555 static readonly available: {
24556 [key: string]: PIXI.BitmapFont;
24557 };
24558 }
24559 /**
24560 * @memberof PIXI
24561 * @typedef {object} IBitmapFontDataInfo
24562 * @property {string} face
24563 * @property {number} size
24564 */
24565 type IBitmapFontDataInfo = {
24566 face: string;
24567 size: number;
24568 };
24569 /**
24570 * @memberof PIXI
24571 * @typedef {object} IBitmapFontDataCommon
24572 * @property {number} lineHeight
24573 */
24574 type IBitmapFontDataCommon = {
24575 lineHeight: number;
24576 };
24577 /**
24578 * @memberof PIXI
24579 * @typedef {object} IBitmapFontDataPage
24580 * @property {number} id
24581 * @property {string} file
24582 */
24583 type IBitmapFontDataPage = {
24584 id: number;
24585 file: string;
24586 };
24587 /**
24588 * @memberof PIXI
24589 * @typedef {object} IBitmapFontDataChar
24590 * @property {string} id
24591 * @property {number} page
24592 * @property {number} x
24593 * @property {number} y
24594 * @property {number} width
24595 * @property {number} height
24596 * @property {number} xoffset
24597 * @property {number} yoffset
24598 * @property {number} xadvance
24599 */
24600 type IBitmapFontDataChar = {
24601 id: string;
24602 page: number;
24603 x: number;
24604 y: number;
24605 width: number;
24606 height: number;
24607 xoffset: number;
24608 yoffset: number;
24609 xadvance: number;
24610 };
24611 /**
24612 * @memberof PIXI
24613 * @typedef {object} IBitmapFontDataKerning
24614 * @property {number} first
24615 * @property {number} second
24616 * @property {number} amount
24617 */
24618 type IBitmapFontDataKerning = {
24619 first: number;
24620 second: number;
24621 amount: number;
24622 };
24623 /**
24624 * Normalized parsed data from .fnt files.
24625 *
24626 * @class
24627 * @memberof PIXI
24628 */
24629 class BitmapFontData {
24630 constructor();
24631 /**
24632 * @member {PIXI.IBitmapFontDataInfo[]} PIXI.BitmapFontData#info
24633 * @readOnly
24634 */
24635 readonly info: PIXI.IBitmapFontDataInfo[];
24636 /**
24637 * @member {PIXI.IBitmapFontDataCommon[]} PIXI.BitmapFontData#common
24638 * @readOnly
24639 */
24640 readonly common: PIXI.IBitmapFontDataCommon[];
24641 /**
24642 * @member {PIXI.IBitmapFontDataPage[]} PIXI.BitmapFontData#page
24643 * @readOnly
24644 */
24645 readonly page: PIXI.IBitmapFontDataPage[];
24646 /**
24647 * @member {PIXI.IBitmapFontDataChar[]} PIXI.BitmapFontData#char
24648 * @readOnly
24649 */
24650 readonly char: PIXI.IBitmapFontDataChar[];
24651 /**
24652 * @member {PIXI.IBitmapFontDataKerning[]} PIXI.BitmapFontData#kerning
24653 * @readOnly
24654 */
24655 readonly kerning: PIXI.IBitmapFontDataKerning[];
24656 }
24657 interface BitmapFontLoader extends PIXI.ILoaderPlugin {
24658 }
24659 /**
24660 * {@link PIXI.Loader Loader} middleware for loading
24661 * bitmap-based fonts suitable for using with {@link PIXI.BitmapText}.
24662 * @class
24663 * @memberof PIXI
24664 * @implements PIXI.ILoaderPlugin
24665 */
24666 class BitmapFontLoader implements PIXI.ILoaderPlugin {
24667 /**
24668 * Called when the plugin is installed.
24669 *
24670 * @see PIXI.Loader.registerPlugin
24671 */
24672 static add(): void;
24673 /**
24674 * Called after a resource is loaded.
24675 * @see PIXI.Loader.loaderMiddleware
24676 * @param {PIXI.LoaderResource} resource
24677 * @param {function} next
24678 */
24679 static use(resource: PIXI.LoaderResource, next: (...params: any[]) => any): void;
24680 }
24681 /**
24682 * A BitmapText object will create a line or multiple lines of text using bitmap font.
24683 *
24684 * The primary advantage of this class over Text is that all of your textures are pre-generated and loading,
24685 * meaning that rendering is fast, and changing text has no performance implications.
24686 *
24687 * Supporting character sets other than latin, such as CJK languages, may be impractical due to the number of characters.
24688 *
24689 * To split a line you can use '\n', '\r' or '\r\n' in your string.
24690 *
24691 * PixiJS can auto-generate fonts on-the-fly using BitmapFont or use fnt files provided by:
24692 * http://www.angelcode.com/products/bmfont/ for Windows or
24693 * http://www.bmglyph.com/ for Mac.
24694 *
24695 * A BitmapText can only be created when the font is loaded.
24696 *
24697 * ```js
24698 * // in this case the font is in a file called 'desyrel.fnt'
24699 * let bitmapText = new PIXI.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"});
24700 * ```
24701 *
24702 * @class
24703 * @extends PIXI.Container
24704 * @memberof PIXI
24705 */
24706 class BitmapText extends PIXI.Container {
24707 constructor(text: string, style: {
24708 fontName: string;
24709 fontSize?: number;
24710 align?: string;
24711 tint?: number;
24712 letterSpacing?: number;
24713 maxWidth?: number;
24714 });
24715 /**
24716 * If true PixiJS will Math.floor() x/y values when rendering
24717 *
24718 * @member {boolean} PIXI.BitmapText#_roundPixels
24719 * @default PIXI.settings.ROUND_PIXELS
24720 */
24721 _roundPixels: boolean;
24722 /**
24723 * Set to `true` if the BitmapText needs to be redrawn.
24724 *
24725 * @member {boolean} PIXI.BitmapText#dirty
24726 */
24727 dirty: boolean;
24728 /**
24729 * Renders text and updates it when needed. This should only be called
24730 * if the BitmapFont is regenerated.
24731 */
24732 updateText(): void;
24733 /**
24734 * Validates text before calling parent's getLocalBounds
24735 *
24736 * @return {PIXI.Rectangle} The rectangular bounding area
24737 */
24738 getLocalBounds(): PIXI.Rectangle;
24739 /**
24740 * The tint of the BitmapText object.
24741 *
24742 * @member {number}
24743 * @default 0xffffff
24744 */
24745 tint: number;
24746 /**
24747 * The alignment of the BitmapText object.
24748 *
24749 * @member {string}
24750 * @default 'left'
24751 */
24752 align: string;
24753 /**
24754 * The name of the BitmapFont.
24755 *
24756 * @member {string}
24757 */
24758 fontName: string;
24759 /**
24760 * The size of the font to display.
24761 *
24762 * @member {number}
24763 */
24764 fontSize: number;
24765 /**
24766 * The anchor sets the origin point of the text.
24767 *
24768 * The default is `(0,0)`, this means the text's origin is the top left.
24769 *
24770 * Setting the anchor to `(0.5,0.5)` means the text's origin is centered.
24771 *
24772 * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner.
24773 *
24774 * @member {PIXI.Point | number}
24775 */
24776 anchor: PIXI.Point | number;
24777 /**
24778 * The text of the BitmapText object.
24779 *
24780 * @member {string}
24781 */
24782 text: string;
24783 /**
24784 * The max width of this bitmap text in pixels. If the text provided is longer than the
24785 * value provided, line breaks will be automatically inserted in the last whitespace.
24786 * Disable by setting the value to 0.
24787 *
24788 * @member {number}
24789 */
24790 maxWidth: number;
24791 /**
24792 * The max line height. This is useful when trying to use the total height of the Text,
24793 * i.e. when trying to vertically align.
24794 *
24795 * @member {number}
24796 * @readonly
24797 */
24798 readonly maxLineHeight: number;
24799 /**
24800 * The width of the overall text, different from fontSize,
24801 * which is defined in the style object.
24802 *
24803 * @member {number}
24804 * @readonly
24805 */
24806 readonly textWidth: number;
24807 /**
24808 * Additional space between characters.
24809 *
24810 * @member {number}
24811 */
24812 letterSpacing: number;
24813 /**
24814 * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
24815 * Advantages can include sharper image quality (like text) and faster rendering on canvas.
24816 * The main disadvantage is movement of objects may appear less smooth.
24817 * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
24818 *
24819 * @member {boolean}
24820 * @default PIXI.settings.ROUND_PIXELS
24821 */
24822 roundPixels: boolean;
24823 /**
24824 * The height of the overall text, different from fontSize,
24825 * which is defined in the style object.
24826 *
24827 * @member {number}
24828 * @readonly
24829 */
24830 readonly textHeight: number;
24831 /**
24832 * Register a bitmap font with data and a texture.
24833 *
24834 * @deprecated since 5.3.0
24835 * @see PIXI.BitmapFont.install
24836 * @static
24837 */
24838 static registerFont(): void;
24839 /**
24840 * Get the list of installed fonts.
24841 *
24842 * @see PIXI.BitmapFont.available
24843 * @deprecated since 5.3.0
24844 * @static
24845 * @readonly
24846 * @member {Object.<string, PIXI.BitmapFont>}
24847 */
24848 static readonly fonts: {
24849 [key: string]: PIXI.BitmapFont;
24850 };
24851 /**
24852 * To be overridden by the subclass
24853 * @method _renderCanvas
24854 * @memberof PIXI.Container#
24855 * @protected
24856 * @param {PIXI.CanvasRenderer} renderer - The renderer
24857 */
24858 protected _renderCanvas(renderer: PIXI.CanvasRenderer): void;
24859 /**
24860 * Renders the object using the Canvas renderer
24861 * @method renderCanvas
24862 * @memberof PIXI.Container#
24863 * @param {PIXI.CanvasRenderer} renderer - The renderer
24864 */
24865 renderCanvas(renderer: PIXI.CanvasRenderer): void;
24866 /**
24867 * The array of children of this container.
24868 *
24869 * @member {PIXI.DisplayObject[]} PIXI.Container#children
24870 * @readonly
24871 */
24872 readonly children: PIXI.DisplayObject[];
24873 /**
24874 * If set to true, the container will sort its children by zIndex value
24875 * when updateTransform() is called, or manually if sortChildren() is called.
24876 *
24877 * This actually changes the order of elements in the array, so should be treated
24878 * as a basic solution that is not performant compared to other solutions,
24879 * such as @link https://github.com/pixijs/pixi-display
24880 *
24881 * Also be aware of that this may not work nicely with the addChildAt() function,
24882 * as the zIndex sorting may cause the child to automatically sorted to another position.
24883 *
24884 * @see PIXI.settings.SORTABLE_CHILDREN
24885 *
24886 * @member {boolean} PIXI.Container#sortableChildren
24887 */
24888 sortableChildren: boolean;
24889 /**
24890 * Should children be sorted by zIndex at the next updateTransform call.
24891 * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
24892 *
24893 * @member {boolean} PIXI.Container#sortDirty
24894 */
24895 sortDirty: boolean;
24896 /**
24897 * Overridable method that can be used by Container subclasses whenever the children array is modified
24898 *
24899 * @protected
24900 */
24901 protected onChildrenChange(): void;
24902 /**
24903 * Adds one or more children to the container.
24904 *
24905 * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
24906 *
24907 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container
24908 * @return {PIXI.DisplayObject} The first child that was added.
24909 */
24910 addChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
24911 /**
24912 * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
24913 *
24914 * @param {PIXI.DisplayObject} child - The child to add
24915 * @param {number} index - The index to place the child in
24916 * @return {PIXI.DisplayObject} The child that was added.
24917 */
24918 addChildAt<T extends PIXI.DisplayObject>(child: T, index: number): T;
24919 /**
24920 * Swaps the position of 2 Display Objects within this container.
24921 *
24922 * @param {PIXI.DisplayObject} child - First display object to swap
24923 * @param {PIXI.DisplayObject} child2 - Second display object to swap
24924 */
24925 swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
24926 /**
24927 * Returns the index position of a child DisplayObject instance
24928 *
24929 * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
24930 * @return {number} The index position of the child display object to identify
24931 */
24932 getChildIndex(child: PIXI.DisplayObject): number;
24933 /**
24934 * Changes the position of an existing child in the display object container
24935 *
24936 * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
24937 * @param {number} index - The resulting index number for the child display object
24938 */
24939 setChildIndex(child: PIXI.DisplayObject, index: number): void;
24940 /**
24941 * Returns the child at the specified index
24942 *
24943 * @param {number} index - The index to get the child at
24944 * @return {PIXI.DisplayObject} The child at the given index, if any.
24945 */
24946 getChildAt(index: number): PIXI.DisplayObject;
24947 /**
24948 * Removes one or more children from the container.
24949 *
24950 * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove
24951 * @return {PIXI.DisplayObject} The first child that was removed.
24952 */
24953 removeChild<TChildren extends PIXI.DisplayObject[]>(...children: TChildren): TChildren[0];
24954 /**
24955 * Removes a child from the specified index position.
24956 *
24957 * @param {number} index - The index to get the child from
24958 * @return {PIXI.DisplayObject} The child that was removed.
24959 */
24960 removeChildAt(index: number): PIXI.DisplayObject;
24961 /**
24962 * Removes all children from this container that are within the begin and end indexes.
24963 *
24964 * @param {number} [beginIndex=0] - The beginning position.
24965 * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
24966 * @returns {PIXI.DisplayObject[]} List of removed children
24967 */
24968 removeChildren(beginIndex?: number, endIndex?: number): PIXI.DisplayObject[];
24969 /**
24970 * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
24971 */
24972 sortChildren(): void;
24973 /**
24974 * Recalculates the bounds of the container.
24975 *
24976 */
24977 calculateBounds(): void;
24978 /**
24979 * Recalculates the bounds of the object. Override this to
24980 * calculate the bounds of the specific object (not including children).
24981 *
24982 * @protected
24983 */
24984 protected _calculateBounds(): void;
24985 /**
24986 * Renders the object using the WebGL renderer
24987 *
24988 * @param {PIXI.Renderer} renderer - The renderer
24989 */
24990 render(renderer: PIXI.Renderer): void;
24991 /**
24992 * Render the object using the WebGL renderer and advanced features.
24993 *
24994 * @protected
24995 * @param {PIXI.Renderer} renderer - The renderer
24996 */
24997 protected renderAdvanced(renderer: PIXI.Renderer): void;
24998 /**
24999 * To be overridden by the subclasses.
25000 *
25001 * @protected
25002 * @param {PIXI.Renderer} renderer - The renderer
25003 */
25004 protected _render(renderer: PIXI.Renderer): void;
25005 /**
25006 * Removes all internal references and listeners as well as removes children from the display list.
25007 * Do not use a Container after calling `destroy`.
25008 *
25009 * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
25010 * have been set to that value
25011 * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy
25012 * method called as well. 'options' will be passed on to those calls.
25013 * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
25014 * Should it destroy the texture of the child sprite
25015 * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
25016 * Should it destroy the base texture of the child sprite
25017 */
25018 destroy(options?: {
25019 children?: boolean;
25020 texture?: boolean;
25021 baseTexture?: boolean;
25022 }): void;
25023 /**
25024 * The width of the Container, setting this will actually modify the scale to achieve the value set
25025 *
25026 * @member {number}
25027 */
25028 width: number;
25029 /**
25030 * The height of the Container, setting this will actually modify the scale to achieve the value set
25031 *
25032 * @member {number}
25033 */
25034 height: number;
25035 /**
25036 * Container default updateTransform, does update children of container.
25037 * Will crash if there's no parent element.
25038 *
25039 * @memberof PIXI.Container#
25040 * @function containerUpdateTransform
25041 */
25042 containerUpdateTransform(): void;
25043 /**
25044 * Determines if the children to the displayObject can be clicked/touched
25045 * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
25046 *
25047 * @member {boolean}
25048 * @memberof PIXI.Container#
25049 */
25050 interactiveChildren: boolean;
25051 /**
25052 * Returns the display object in the container.
25053 *
25054 * Recursive searches are done in a preorder traversal.
25055 *
25056 * @method getChildByName
25057 * @memberof PIXI.Container#
25058 * @param {string} name - Instance name.
25059 * @param {boolean}[deep=false] - Whether to search recursively
25060 * @return {PIXI.DisplayObject} The child with the specified name.
25061 */
25062 getChildByName(name: string, deep?: boolean): PIXI.DisplayObject;
25063 /**
25064 * Flag for if the object is accessible. If true AccessibilityManager will overlay a
25065 * shadow div with attributes set
25066 *
25067 * @member {boolean}
25068 * @memberof PIXI.DisplayObject#
25069 */
25070 accessible: boolean;
25071 /**
25072 * Sets the title attribute of the shadow div
25073 * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
25074 *
25075 * @member {?string}
25076 * @memberof PIXI.DisplayObject#
25077 */
25078 accessibleTitle: string;
25079 /**
25080 * Sets the aria-label attribute of the shadow div
25081 *
25082 * @member {string}
25083 * @memberof PIXI.DisplayObject#
25084 */
25085 accessibleHint: string;
25086 /**
25087 * @member {boolean}
25088 * @memberof PIXI.DisplayObject#
25089 * @todo Needs docs.
25090 */
25091 _accessibleActive: boolean;
25092 /**
25093 * @member {boolean}
25094 * @memberof PIXI.DisplayObject#
25095 * @todo Needs docs.
25096 */
25097 _accessibleDiv: boolean;
25098 /**
25099 * Specify the type of div the accessible layer is. Screen readers treat the element differently
25100 * depending on this type. Defaults to button.
25101 *
25102 * @member {string}
25103 * @memberof PIXI.DisplayObject#
25104 * @default 'button'
25105 */
25106 accessibleType: string;
25107 /**
25108 * Specify the pointer-events the accessible div will use
25109 * Defaults to auto.
25110 *
25111 * @member {string}
25112 * @memberof PIXI.DisplayObject#
25113 * @default 'auto'
25114 */
25115 accessiblePointerEvents: string;
25116 /**
25117 * Setting to false will prevent any children inside this container to
25118 * be accessible. Defaults to true.
25119 *
25120 * @member {boolean}
25121 * @memberof PIXI.DisplayObject#
25122 * @default true
25123 */
25124 accessibleChildren: boolean;
25125 /**
25126 * World transform and local transform of this object.
25127 * This will become read-only later, please do not assign anything there unless you know what are you doing.
25128 *
25129 * @member {PIXI.Transform} PIXI.DisplayObject#transform
25130 */
25131 transform: PIXI.Transform;
25132 /**
25133 * The opacity of the object.
25134 *
25135 * @member {number} PIXI.DisplayObject#alpha
25136 */
25137 alpha: number;
25138 /**
25139 * The visibility of the object. If false the object will not be drawn, and
25140 * the updateTransform function will not be called.
25141 *
25142 * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
25143 *
25144 * @member {boolean} PIXI.DisplayObject#visible
25145 */
25146 visible: boolean;
25147 /**
25148 * Can this object be rendered, if false the object will not be drawn but the updateTransform
25149 * methods will still be called.
25150 *
25151 * Only affects recursive calls from parent. You can ask for bounds manually.
25152 *
25153 * @member {boolean} PIXI.DisplayObject#renderable
25154 */
25155 renderable: boolean;
25156 /**
25157 * The display object container that contains this display object.
25158 *
25159 * @member {PIXI.Container} PIXI.DisplayObject#parent
25160 */
25161 parent: PIXI.Container;
25162 /**
25163 * The multiplied alpha of the displayObject.
25164 *
25165 * @member {number} PIXI.DisplayObject#worldAlpha
25166 * @readonly
25167 */
25168 readonly worldAlpha: number;
25169 /**
25170 * Which index in the children array the display component was before the previous zIndex sort.
25171 * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
25172 *
25173 * @member {number} PIXI.DisplayObject#_lastSortedIndex
25174 * @protected
25175 */
25176 protected _lastSortedIndex: number;
25177 /**
25178 * The zIndex of the displayObject.
25179 * A higher value will mean it will be rendered on top of other displayObjects within the same container.
25180 *
25181 * @member {number} PIXI.DisplayObject#_zIndex
25182 * @protected
25183 */
25184 protected _zIndex: number;
25185 /**
25186 * The area the filter is applied to. This is used as more of an optimization
25187 * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
25188 *
25189 * Also works as an interaction mask.
25190 *
25191 * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
25192 */
25193 filterArea: PIXI.Rectangle;
25194 /**
25195 * Sets the filters for the displayObject.
25196 * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
25197 * To remove filters simply set this property to `'null'`.
25198 *
25199 * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
25200 */
25201 filters: PIXI.Filter[];
25202 /**
25203 * Currently enabled filters
25204 * @member {PIXI.Filter[]} PIXI.DisplayObject#_enabledFilters
25205 * @protected
25206 */
25207 protected _enabledFilters: PIXI.Filter[];
25208 /**
25209 * The bounds object, this is used to calculate and store the bounds of the displayObject.
25210 *
25211 * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
25212 */
25213 _bounds: PIXI.Bounds;
25214 /**
25215 * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.
25216 *
25217 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBounds
25218 */
25219 _localBounds: PIXI.Bounds;
25220 /**
25221 * Flags the cached bounds as dirty.
25222 *
25223 * @member {number} PIXI.DisplayObject#_boundsID
25224 * @protected
25225 */
25226 protected _boundsID: number;
25227 /**
25228 * Cache of this display-object's bounds-rectangle.
25229 *
25230 * @member {PIXI.Bounds} PIXI.DisplayObject#_boundsRect
25231 * @protected
25232 */
25233 protected _boundsRect: PIXI.Bounds;
25234 /**
25235 * Cache of this display-object's local-bounds rectangle.
25236 *
25237 * @member {PIXI.Bounds} PIXI.DisplayObject#_localBoundsRect
25238 * @protected
25239 */
25240 protected _localBoundsRect: PIXI.Bounds;
25241 /**
25242 * The original, cached mask of the object.
25243 *
25244 * @member {PIXI.Container|PIXI.MaskData|null} PIXI.DisplayObject#_mask
25245 * @protected
25246 */
25247 protected _mask: PIXI.Container | PIXI.MaskData | null;
25248 /**
25249 * If the object has been destroyed via destroy(). If true, it should not be used.
25250 *
25251 * @member {boolean} PIXI.DisplayObject#_destroyed
25252 * @protected
25253 */
25254 protected _destroyed: boolean;
25255 /**
25256 * used to fast check if a sprite is.. a sprite!
25257 * @member {boolean} PIXI.DisplayObject#isSprite
25258 */
25259 isSprite: boolean;
25260 /**
25261 * Does any other displayObject use this object as a mask?
25262 * @member {boolean} PIXI.DisplayObject#isMask
25263 */
25264 isMask: boolean;
25265 /**
25266 * Recursively updates transform of all objects from the root to this one
25267 * internal function for toLocal()
25268 */
25269 _recursivePostUpdateTransform(): void;
25270 /**
25271 * Retrieves the bounds of the displayObject as a rectangle object.
25272 *
25273 * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
25274 * being updated. This means the calculation returned MAY be out of date BUT will give you a
25275 * nice performance boost.
25276 * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
25277 * @return {PIXI.Rectangle} The rectangular bounding area.
25278 */
25279 getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
25280 /**
25281 * Calculates the global position of the display object.
25282 *
25283 * @param {PIXI.IPointData} position - The world origin to calculate from.
25284 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
25285 * (otherwise will create a new Point).
25286 * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
25287 * @return {PIXI.Point} A point object representing the position of this object.
25288 */
25289 toGlobal(position: PIXI.IPointData, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
25290 /**
25291 * Calculates the local position of the display object relative to another point.
25292 *
25293 * @param {PIXI.IPointData} position - The world origin to calculate from.
25294 * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
25295 * @param {PIXI.Point} [point] - A Point object in which to store the value, optional
25296 * (otherwise will create a new Point).
25297 * @param {boolean} [skipUpdate=false] - Should we skip the update transform
25298 * @return {PIXI.Point} A point object representing the position of this object
25299 */
25300 toLocal(position: PIXI.IPointData, from?: PIXI.DisplayObject, point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
25301 /**
25302 * Set the parent Container of this DisplayObject.
25303 *
25304 * @param {PIXI.Container} container - The Container to add this DisplayObject to.
25305 * @return {PIXI.Container} The Container that this DisplayObject was added to.
25306 */
25307 setParent(container: PIXI.Container): PIXI.Container;
25308 /**
25309 * Convenience function to set the position, scale, skew and pivot at once.
25310 *
25311 * @param {number} [x=0] - The X position
25312 * @param {number} [y=0] - The Y position
25313 * @param {number} [scaleX=1] - The X scale value
25314 * @param {number} [scaleY=1] - The Y scale value
25315 * @param {number} [rotation=0] - The rotation
25316 * @param {number} [skewX=0] - The X skew value
25317 * @param {number} [skewY=0] - The Y skew value
25318 * @param {number} [pivotX=0] - The X pivot value
25319 * @param {number} [pivotY=0] - The Y pivot value
25320 * @return {PIXI.DisplayObject} The DisplayObject instance
25321 */
25322 setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
25323 /**
25324 * @protected
25325 * @member {PIXI.Container}
25326 */
25327 protected _tempDisplayObjectParent: PIXI.Container;
25328 /**
25329 * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root
25330 *
25331 * ```
25332 * const cacheParent = elem.enableTempParent();
25333 * elem.updateTransform();
25334 * elem.disableTempParent(cacheParent);
25335 * ```
25336 *
25337 * @returns {PIXI.DisplayObject} current parent
25338 */
25339 enableTempParent(): PIXI.DisplayObject;
25340 /**
25341 * Pair method for `enableTempParent`
25342 * @param {PIXI.DisplayObject} cacheParent actual parent of element
25343 */
25344 disableTempParent(cacheParent: PIXI.DisplayObject): void;
25345 /**
25346 * The position of the displayObject on the x axis relative to the local coordinates of the parent.
25347 * An alias to position.x
25348 *
25349 * @member {number}
25350 */
25351 x: number;
25352 /**
25353 * The position of the displayObject on the y axis relative to the local coordinates of the parent.
25354 * An alias to position.y
25355 *
25356 * @member {number}
25357 */
25358 y: number;
25359 /**
25360 * Current transform of the object based on world (parent) factors.
25361 *
25362 * @member {PIXI.Matrix}
25363 * @readonly
25364 */
25365 readonly worldTransform: PIXI.Matrix;
25366 /**
25367 * Current transform of the object based on local factors: position, scale, other stuff.
25368 *
25369 * @member {PIXI.Matrix}
25370 * @readonly
25371 */
25372 readonly localTransform: PIXI.Matrix;
25373 /**
25374 * The coordinate of the object relative to the local coordinates of the parent.
25375 * Assignment by value since pixi-v4.
25376 *
25377 * @member {PIXI.ObservablePoint}
25378 */
25379 position: PIXI.ObservablePoint;
25380 /**
25381 * The scale factor of the object.
25382 * Assignment by value since pixi-v4.
25383 *
25384 * @member {PIXI.ObservablePoint}
25385 */
25386 scale: PIXI.ObservablePoint;
25387 /**
25388 * The pivot point of the displayObject that it rotates around.
25389 * Assignment by value since pixi-v4.
25390 *
25391 * @member {PIXI.ObservablePoint}
25392 */
25393 pivot: PIXI.ObservablePoint;
25394 /**
25395 * The skew factor for the object in radians.
25396 * Assignment by value since pixi-v4.
25397 *
25398 * @member {PIXI.ObservablePoint}
25399 */
25400 skew: PIXI.ObservablePoint;
25401 /**
25402 * The rotation of the object in radians.
25403 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
25404 *
25405 * @member {number}
25406 */
25407 rotation: number;
25408 /**
25409 * The angle of the object in degrees.
25410 * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
25411 *
25412 * @member {number}
25413 */
25414 angle: number;
25415 /**
25416 * The zIndex of the displayObject.
25417 * If a container has the sortableChildren property set to true, children will be automatically
25418 * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
25419 * and thus rendered on top of other displayObjects within the same container.
25420 *
25421 * @member {number}
25422 */
25423 zIndex: number;
25424 /**
25425 * Indicates if the object is globally visible.
25426 *
25427 * @member {boolean}
25428 * @readonly
25429 */
25430 readonly worldVisible: boolean;
25431 /**
25432 * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
25433 * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
25434 * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
25435 * utilities shape clipping. To remove a mask, set this property to `null`.
25436 *
25437 * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
25438 * @example
25439 * const graphics = new PIXI.Graphics();
25440 * graphics.beginFill(0xFF3300);
25441 * graphics.drawRect(50, 250, 100, 100);
25442 * graphics.endFill();
25443 *
25444 * const sprite = new PIXI.Sprite(texture);
25445 * sprite.mask = graphics;
25446 * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
25447 *
25448 * @member {PIXI.Container|PIXI.MaskData|null}
25449 */
25450 mask: PIXI.Container | PIXI.MaskData | null;
25451 /**
25452 * DisplayObject default updateTransform, does not update children of container.
25453 * Will crash if there's no parent element.
25454 *
25455 * @memberof PIXI.DisplayObject#
25456 * @function displayObjectUpdateTransform
25457 */
25458 displayObjectUpdateTransform(): void;
25459 /**
25460 * Enable interaction events for the DisplayObject. Touch, pointer and mouse
25461 * events will not be emitted unless `interactive` is set to `true`.
25462 *
25463 * @example
25464 * const sprite = new PIXI.Sprite(texture);
25465 * sprite.interactive = true;
25466 * sprite.on('tap', (event) => {
25467 * //handle event
25468 * });
25469 * @member {boolean}
25470 * @memberof PIXI.DisplayObject#
25471 */
25472 interactive: boolean;
25473 /**
25474 * Interaction shape. Children will be hit first, then this shape will be checked.
25475 * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
25476 *
25477 * @example
25478 * const sprite = new PIXI.Sprite(texture);
25479 * sprite.interactive = true;
25480 * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
25481 * @member {PIXI.IHitArea}
25482 * @memberof PIXI.DisplayObject#
25483 */
25484 hitArea: PIXI.IHitArea;
25485 /**
25486 * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
25487 * Setting this changes the 'cursor' property to `'pointer'`.
25488 *
25489 * @example
25490 * const sprite = new PIXI.Sprite(texture);
25491 * sprite.interactive = true;
25492 * sprite.buttonMode = true;
25493 * @member {boolean}
25494 * @memberof PIXI.DisplayObject#
25495 */
25496 buttonMode: boolean;
25497 /**
25498 * This defines what cursor mode is used when the mouse cursor
25499 * is hovered over the displayObject.
25500 *
25501 * @example
25502 * const sprite = new PIXI.Sprite(texture);
25503 * sprite.interactive = true;
25504 * sprite.cursor = 'wait';
25505 * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
25506 *
25507 * @member {string}
25508 * @memberof PIXI.DisplayObject#
25509 */
25510 cursor: string;
25511 /**
25512 * Set this to true if you want this display object to be cached as a bitmap.
25513 * This basically takes a snap shot of the display object as it is at that moment. It can
25514 * provide a performance benefit for complex static displayObjects.
25515 * To remove simply set this property to `false`
25516 *
25517 * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
25518 * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
25519 *
25520 * @member {boolean}
25521 * @memberof PIXI.DisplayObject#
25522 */
25523 cacheAsBitmap: boolean;
25524 /**
25525 * The instance name of the object.
25526 *
25527 * @memberof PIXI.DisplayObject#
25528 * @member {string} name
25529 */
25530 name: string;
25531 /**
25532 * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
25533 *
25534 * @method getGlobalPosition
25535 * @memberof PIXI.DisplayObject#
25536 * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.
25537 * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from
25538 * being updated. This means the calculation returned MAY be out of date BUT will give you a
25539 * nice performance boost.
25540 * @return {PIXI.Point} The updated point.
25541 */
25542 getGlobalPosition(point?: PIXI.Point, skipUpdate?: boolean): PIXI.Point;
25543 }
25544 /**
25545 * A Ticker class that runs an update loop that other objects listen to.
25546 *
25547 * This class is composed around listeners meant for execution on the next requested animation frame.
25548 * Animation frames are requested only when necessary, e.g. When the ticker is started and the emitter has listeners.
25549 *
25550 * @class
25551 * @memberof PIXI
25552 */
25553 class Ticker {
25554 constructor();
25555 /**
25556 * Whether or not this ticker should invoke the method
25557 * {@link PIXI.Ticker#start} automatically
25558 * when a listener is added.
25559 *
25560 * @member {boolean} PIXI.Ticker#autoStart
25561 * @default false
25562 */
25563 autoStart: boolean;
25564 /**
25565 * Scalar time value from last frame to this frame.
25566 * This value is capped by setting {@link PIXI.Ticker#minFPS}
25567 * and is scaled with {@link PIXI.Ticker#speed}.
25568 * **Note:** The cap may be exceeded by scaling.
25569 *
25570 * @member {number} PIXI.Ticker#deltaTime
25571 * @default 1
25572 */
25573 deltaTime: number;
25574 /**
25575 * Scaler time elapsed in milliseconds from last frame to this frame.
25576 * This value is capped by setting {@link PIXI.Ticker#minFPS}
25577 * and is scaled with {@link PIXI.Ticker#speed}.
25578 * **Note:** The cap may be exceeded by scaling.
25579 * If the platform supports DOMHighResTimeStamp,
25580 * this value will have a precision of 1 µs.
25581 * Defaults to target frame time
25582 *
25583 * @member {number} PIXI.Ticker#deltaMS
25584 * @default 16.66
25585 */
25586 deltaMS: number;
25587 /**
25588 * Time elapsed in milliseconds from last frame to this frame.
25589 * Opposed to what the scalar {@link PIXI.Ticker#deltaTime}
25590 * is based, this value is neither capped nor scaled.
25591 * If the platform supports DOMHighResTimeStamp,
25592 * this value will have a precision of 1 µs.
25593 * Defaults to target frame time
25594 *
25595 * @member {number} PIXI.Ticker#elapsedMS
25596 * @default 16.66
25597 */
25598 elapsedMS: number;
25599 /**
25600 * The last time {@link PIXI.Ticker#update} was invoked.
25601 * This value is also reset internally outside of invoking
25602 * update, but only when a new animation frame is requested.
25603 * If the platform supports DOMHighResTimeStamp,
25604 * this value will have a precision of 1 µs.
25605 *
25606 * @member {number} PIXI.Ticker#lastTime
25607 * @default -1
25608 */
25609 lastTime: number;
25610 /**
25611 * Factor of current {@link PIXI.Ticker#deltaTime}.
25612 * @example
25613 * // Scales ticker.deltaTime to what would be
25614 * // the equivalent of approximately 120 FPS
25615 * ticker.speed = 2;
25616 *
25617 * @member {number} PIXI.Ticker#speed
25618 * @default 1
25619 */
25620 speed: number;
25621 /**
25622 * Whether or not this ticker has been started.
25623 * `true` if {@link PIXI.Ticker#start} has been called.
25624 * `false` if {@link PIXI.Ticker#stop} has been called.
25625 * While `false`, this value may change to `true` in the
25626 * event of {@link PIXI.Ticker#autoStart} being `true`
25627 * and a listener is added.
25628 *
25629 * @member {boolean} PIXI.Ticker#started
25630 * @default false
25631 */
25632 started: boolean;
25633 /**
25634 * Register a handler for tick events. Calls continuously unless
25635 * it is removed or the ticker is stopped.
25636 *
25637 * @param {Function} fn - The listener function to be added for updates
25638 * @param {*} [context] - The listener context
25639 * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting
25640 * @returns {PIXI.Ticker} This instance of a ticker
25641 */
25642 add(fn: (...params: any[]) => any, context?: any, priority?: number): PIXI.Ticker;
25643 /**
25644 * Add a handler for the tick event which is only execute once.
25645 *
25646 * @param {Function} fn - The listener function to be added for one update
25647 * @param {*} [context] - The listener context
25648 * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting
25649 * @returns {PIXI.Ticker} This instance of a ticker
25650 */
25651 addOnce(fn: (...params: any[]) => any, context?: any, priority?: number): PIXI.Ticker;
25652 /**
25653 * Removes any handlers matching the function and context parameters.
25654 * If no handlers are left after removing, then it cancels the animation frame.
25655 *
25656 * @param {Function} fn - The listener function to be removed
25657 * @param {*} [context] - The listener context to be removed
25658 * @returns {PIXI.Ticker} This instance of a ticker
25659 */
25660 remove(fn: (...params: any[]) => any, context?: any): PIXI.Ticker;
25661 /**
25662 * The number of listeners on this ticker, calculated by walking through linked list
25663 *
25664 * @readonly
25665 * @member {number}
25666 */
25667 readonly count: number;
25668 /**
25669 * Starts the ticker. If the ticker has listeners
25670 * a new animation frame is requested at this point.
25671 */
25672 start(): void;
25673 /**
25674 * Stops the ticker. If the ticker has requested
25675 * an animation frame it is canceled at this point.
25676 */
25677 stop(): void;
25678 /**
25679 * Destroy the ticker and don't use after this. Calling
25680 * this method removes all references to internal events.
25681 */
25682 destroy(): void;
25683 /**
25684 * Triggers an update. An update entails setting the
25685 * current {@link PIXI.Ticker#elapsedMS},
25686 * the current {@link PIXI.Ticker#deltaTime},
25687 * invoking all listeners with current deltaTime,
25688 * and then finally setting {@link PIXI.Ticker#lastTime}
25689 * with the value of currentTime that was provided.
25690 * This method will be called automatically by animation
25691 * frame callbacks if the ticker instance has been started
25692 * and listeners are added.
25693 *
25694 * @param {number} [currentTime=performance.now()] - the current time of execution
25695 */
25696 update(currentTime?: number): void;
25697 /**
25698 * The frames per second at which this ticker is running.
25699 * The default is approximately 60 in most modern browsers.
25700 * **Note:** This does not factor in the value of
25701 * {@link PIXI.Ticker#speed}, which is specific
25702 * to scaling {@link PIXI.Ticker#deltaTime}.
25703 *
25704 * @member {number}
25705 * @readonly
25706 */
25707 readonly FPS: number;
25708 /**
25709 * Manages the maximum amount of milliseconds allowed to
25710 * elapse between invoking {@link PIXI.Ticker#update}.
25711 * This value is used to cap {@link PIXI.Ticker#deltaTime},
25712 * but does not effect the measured value of {@link PIXI.Ticker#FPS}.
25713 * When setting this property it is clamped to a value between
25714 * `0` and `PIXI.settings.TARGET_FPMS * 1000`.
25715 *
25716 * @member {number}
25717 * @default 10
25718 */
25719 minFPS: number;
25720 /**
25721 * Manages the minimum amount of milliseconds required to
25722 * elapse between invoking {@link PIXI.Ticker#update}.
25723 * This will effect the measured value of {@link PIXI.Ticker#FPS}.
25724 * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can.
25725 * Otherwise it will be at least `minFPS`
25726 *
25727 * @member {number}
25728 * @default 0
25729 */
25730 maxFPS: number;
25731 /**
25732 * The shared ticker instance used by {@link PIXI.AnimatedSprite} and by
25733 * {@link PIXI.VideoResource} to update animation frames / video textures.
25734 *
25735 * It may also be used by {@link PIXI.Application} if created with the `sharedTicker` option property set to true.
25736 *
25737 * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.
25738 * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker.
25739 *
25740 * @example
25741 * let ticker = PIXI.Ticker.shared;
25742 * // Set this to prevent starting this ticker when listeners are added.
25743 * // By default this is true only for the PIXI.Ticker.shared instance.
25744 * ticker.autoStart = false;
25745 * // FYI, call this to ensure the ticker is stopped. It should be stopped
25746 * // if you have not attempted to render anything yet.
25747 * ticker.stop();
25748 * // Call this when you are ready for a running shared ticker.
25749 * ticker.start();
25750 *
25751 * @example
25752 * // You may use the shared ticker to render...
25753 * let renderer = PIXI.autoDetectRenderer();
25754 * let stage = new PIXI.Container();
25755 * document.body.appendChild(renderer.view);
25756 * ticker.add(function (time) {
25757 * renderer.render(stage);
25758 * });
25759 *
25760 * @example
25761 * // Or you can just update it manually.
25762 * ticker.autoStart = false;
25763 * ticker.stop();
25764 * function animate(time) {
25765 * ticker.update(time);
25766 * renderer.render(stage);
25767 * requestAnimationFrame(animate);
25768 * }
25769 * animate(performance.now());
25770 *
25771 * @member {PIXI.Ticker}
25772 * @static
25773 */
25774 static shared: PIXI.Ticker;
25775 /**
25776 * The system ticker instance used by {@link PIXI.InteractionManager} and by
25777 * {@link PIXI.BasePrepare} for core timing functionality that shouldn't usually need to be paused,
25778 * unlike the `shared` ticker which drives visual animations and rendering which may want to be paused.
25779 *
25780 * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.
25781 *
25782 * @member {PIXI.Ticker}
25783 * @static
25784 */
25785 static system: PIXI.Ticker;
25786 }
25787 /**
25788 * Middleware for for Application Ticker.
25789 *
25790 * @example
25791 * import {TickerPlugin} from '@pixi/ticker';
25792 * import {Application} from '@pixi/app';
25793 * Application.registerPlugin(TickerPlugin);
25794 *
25795 * @class
25796 * @memberof PIXI
25797 */
25798 class TickerPlugin {
25799 }
25800 /**
25801 * Represents the update priorities used by internal PIXI classes when registered with
25802 * the {@link PIXI.Ticker} object. Higher priority items are updated first and lower
25803 * priority items, such as render, should go later.
25804 *
25805 * @static
25806 * @constant
25807 * @name UPDATE_PRIORITY
25808 * @memberof PIXI
25809 * @enum {number}
25810 * @property {number} INTERACTION=50 Highest priority, used for {@link PIXI.InteractionManager}
25811 * @property {number} HIGH=25 High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.AnimatedSprite}
25812 * @property {number} NORMAL=0 Default priority for ticker events, see {@link PIXI.Ticker#add}.
25813 * @property {number} LOW=-25 Low priority used for {@link PIXI.Application} rendering.
25814 * @property {number} UTILITY=-50 Lowest priority used for {@link PIXI.BasePrepare} utility.
25815 */
25816 enum UPDATE_PRIORITY {
25817 INTERACTION,
25818 HIGH,
25819 NORMAL,
25820 LOW,
25821 UTILITY
25822 }
25823 /**
25824 * Regexp for data URI.
25825 * Based on: {@link https://github.com/ragingwind/data-uri-regex}
25826 *
25827 * @static
25828 * @constant {RegExp|string} DATA_URI
25829 * @memberof PIXI
25830 * @example data:image/png;base64
25831 */
25832 var DATA_URI: RegExp | string;
25833 /**
25834 * Generalized convenience utilities for PIXI.
25835 * @example
25836 * // Extend PIXI's internal Event Emitter.
25837 * class MyEmitter extends PIXI.utils.EventEmitter {
25838 * constructor() {
25839 * super();
25840 * console.log("Emitter created!");
25841 * }
25842 * }
25843 *
25844 * // Get info on current device
25845 * console.log(PIXI.utils.isMobile);
25846 *
25847 * // Convert hex color to string
25848 * console.log(PIXI.utils.hex2string(0xff00ff)); // returns: "#ff00ff"
25849 * @namespace PIXI.utils
25850 */
25851 namespace utils {
25852 /**
25853 * Skips the hello message of renderers that are created after this is run.
25854 *
25855 * @function skipHello
25856 * @memberof PIXI.utils
25857 */
25858 function skipHello(): void;
25859 /**
25860 * Logs out the version and renderer information for this running instance of PIXI.
25861 * If you don't want to see this message you can run `PIXI.utils.skipHello()` before
25862 * creating your renderer. Keep in mind that doing that will forever make you a jerk face.
25863 *
25864 * @static
25865 * @function sayHello
25866 * @memberof PIXI.utils
25867 * @param {string} type - The string renderer type to log.
25868 */
25869 function sayHello(type: string): void;
25870 /**
25871 * Helper for checking for WebGL support.
25872 *
25873 * @memberof PIXI.utils
25874 * @function isWebGLSupported
25875 * @return {boolean} Is WebGL supported.
25876 */
25877 function isWebGLSupported(): boolean;
25878 /**
25879 * Converts a hexadecimal color number to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).
25880 *
25881 * @example
25882 * PIXI.utils.hex2rgb(0xffffff); // returns [1, 1, 1]
25883 * @memberof PIXI.utils
25884 * @function hex2rgb
25885 * @param {number} hex - The hexadecimal number to convert
25886 * @param {number[]} [out=[]] - If supplied, this array will be used rather than returning a new one
25887 * @return {number[]} An array representing the [R, G, B] of the color where all values are floats.
25888 */
25889 function hex2rgb(hex: number, out?: number[]): number[];
25890 /**
25891 * Converts a hexadecimal color number to a string.
25892 *
25893 * @example
25894 * PIXI.utils.hex2string(0xffffff); // returns "#ffffff"
25895 * @memberof PIXI.utils
25896 * @function hex2string
25897 * @param {number} hex - Number in hex (e.g., `0xffffff`)
25898 * @return {string} The string color (e.g., `"#ffffff"`).
25899 */
25900 function hex2string(hex: number): string;
25901 /**
25902 * Converts a hexadecimal string to a hexadecimal color number.
25903 *
25904 * @example
25905 * PIXI.utils.string2hex("#ffffff"); // returns 0xffffff
25906 * @memberof PIXI.utils
25907 * @function string2hex
25908 * @param {string} string - The string color (e.g., `"#ffffff"`)
25909 * @return {number} Number in hexadecimal.
25910 */
25911 function string2hex(string: string): number;
25912 /**
25913 * Converts a color as an [R, G, B] array of normalized floats to a hexadecimal number.
25914 *
25915 * @example
25916 * PIXI.utils.rgb2hex([1, 1, 1]); // returns 0xffffff
25917 * @memberof PIXI.utils
25918 * @function rgb2hex
25919 * @param {number[]} rgb - Array of numbers where all values are normalized floats from 0.0 to 1.0.
25920 * @return {number} Number in hexadecimal.
25921 */
25922 function rgb2hex(rgb: number[]): number;
25923 /**
25924 * maps premultiply flag and blendMode to adjusted blendMode
25925 * @memberof PIXI.utils
25926 * @const premultiplyBlendMode
25927 * @type {Array<number[]>}
25928 */
25929 var premultiplyBlendMode: number[][];
25930 /**
25931 * changes blendMode according to texture format
25932 *
25933 * @memberof PIXI.utils
25934 * @function correctBlendMode
25935 * @param {number} blendMode - supposed blend mode
25936 * @param {boolean} premultiplied - whether source is premultiplied
25937 * @returns {number} true blend mode for this texture
25938 */
25939 function correctBlendMode(blendMode: number, premultiplied: boolean): number;
25940 /**
25941 * combines rgb and alpha to out array
25942 *
25943 * @memberof PIXI.utils
25944 * @function premultiplyRgba
25945 * @param {Float32Array|number[]} rgb - input rgb
25946 * @param {number} alpha - alpha param
25947 * @param {Float32Array} [out] - output
25948 * @param {boolean} [premultiply=true] - do premultiply it
25949 * @returns {Float32Array} vec4 rgba
25950 */
25951 function premultiplyRgba(rgb: Float32Array | number[], alpha: number, out?: Float32Array, premultiply?: boolean): Float32Array;
25952 /**
25953 * premultiplies tint
25954 *
25955 * @memberof PIXI.utils
25956 * @function premultiplyTint
25957 * @param {number} tint - integer RGB
25958 * @param {number} alpha - floating point alpha (0.0-1.0)
25959 * @returns {number} tint multiplied by alpha
25960 */
25961 function premultiplyTint(tint: number, alpha: number): number;
25962 /**
25963 * converts integer tint and float alpha to vec4 form, premultiplies by default
25964 *
25965 * @memberof PIXI.utils
25966 * @function premultiplyTintToRgba
25967 * @param {number} tint - input tint
25968 * @param {number} alpha - alpha param
25969 * @param {Float32Array} [out] output
25970 * @param {boolean} [premultiply=true] - do premultiply it
25971 * @returns {Float32Array} vec4 rgba
25972 */
25973 function premultiplyTintToRgba(tint: number, alpha: number, out?: Float32Array, premultiply?: boolean): Float32Array;
25974 /**
25975 * Generic Mask Stack data structure
25976 *
25977 * @memberof PIXI.utils
25978 * @function createIndicesForQuads
25979 * @param {number} size - Number of quads
25980 * @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size`
25981 * @return {Uint16Array|Uint32Array} - Resulting index buffer
25982 */
25983 function createIndicesForQuads(size: number, outBuffer?: Uint16Array | Uint32Array): Uint16Array | Uint32Array;
25984 /**
25985 * Rounds to next power of two.
25986 *
25987 * @function nextPow2
25988 * @memberof PIXI.utils
25989 * @param {number} v - input value
25990 * @return {number}
25991 */
25992 function nextPow2(v: number): number;
25993 /**
25994 * Checks if a number is a power of two.
25995 *
25996 * @function isPow2
25997 * @memberof PIXI.utils
25998 * @param {number} v - input value
25999 * @return {boolean} `true` if value is power of two
26000 */
26001 function isPow2(v: number): boolean;
26002 /**
26003 * Computes ceil of log base 2
26004 *
26005 * @function log2
26006 * @memberof PIXI.utils
26007 * @param {number} v - input value
26008 * @return {number} logarithm base 2
26009 */
26010 function log2(v: number): number;
26011 /**
26012 * Remove items from a javascript array without generating garbage
26013 *
26014 * @function removeItems
26015 * @memberof PIXI.utils
26016 * @param {Array<any>} arr - Array to remove elements from
26017 * @param {number} startIdx - starting index
26018 * @param {number} removeCount - how many to remove
26019 */
26020 function removeItems(arr: any[], startIdx: number, removeCount: number): void;
26021 /**
26022 * Returns sign of number
26023 *
26024 * @memberof PIXI.utils
26025 * @function sign
26026 * @param {number} n - the number to check the sign of
26027 * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive
26028 */
26029 function sign(n: number): number;
26030 /**
26031 * Gets the next unique identifier
26032 *
26033 * @memberof PIXI.utils
26034 * @function uid
26035 * @return {number} The next unique identifier to use.
26036 */
26037 function uid(): number;
26038 /**
26039 * A simple JS library that detects mobile devices.
26040 *
26041 * @see {@link https://github.com/kaimallea/isMobile}
26042 *
26043 * @memberof PIXI.utils
26044 * @name isMobile
26045 * @type {Object}
26046 * @property {boolean} any - `true` if current platform is tablet or phone device
26047 * @property {boolean} tablet - `true` if current platform large-screen tablet device
26048 * @property {boolean} phone - `true` if current platform small-screen phone device
26049 * @property {object} apple
26050 * @property {boolean} apple.device - `true` if any Apple device
26051 * @property {boolean} apple.tablet - `true` if any Apple iPad
26052 * @property {boolean} apple.phone - `true` if any Apple iPhone
26053 * @property {boolean} apple.ipod - `true` if any iPod
26054 * @property {object} android
26055 * @property {boolean} android.device - `true` if any Android device
26056 * @property {boolean} android.tablet - `true` if any Android tablet
26057 * @property {boolean} android.phone - `true` if any Android phone
26058 * @property {object} amazon
26059 * @property {boolean} amazon.device - `true` if any Silk device
26060 * @property {boolean} amazon.tablet - `true` if any Silk tablet
26061 * @property {boolean} amazon.phone - `true` if any Silk phone
26062 * @property {object} windows
26063 * @property {boolean} windows.device - `true` if any Windows device
26064 * @property {boolean} windows.tablet - `true` if any Windows tablet
26065 * @property {boolean} windows.phone - `true` if any Windows phone
26066 */
26067 var isMobile: {
26068 any: boolean;
26069 tablet: boolean;
26070 phone: boolean;
26071 apple: {
26072 device: boolean;
26073 tablet: boolean;
26074 phone: boolean;
26075 ipod: boolean;
26076 };
26077 android: {
26078 device: boolean;
26079 tablet: boolean;
26080 phone: boolean;
26081 };
26082 amazon: {
26083 device: boolean;
26084 tablet: boolean;
26085 phone: boolean;
26086 };
26087 windows: {
26088 device: boolean;
26089 tablet: boolean;
26090 phone: boolean;
26091 };
26092 };
26093 /**
26094 * A high performance event emitter
26095 *
26096 * @see {@link https://github.com/primus/eventemitter3}
26097 *
26098 * @memberof PIXI.utils
26099 * @class EventEmitter
26100 * @type {EventEmitter}
26101 */
26102 class EventEmitter {
26103 }
26104 /**
26105 * A polygon triangulation library
26106 *
26107 * @see {@link https://github.com/mapbox/earcut}
26108 *
26109 * @memberof PIXI.utils
26110 * @function earcut
26111 * @param {number[]} vertices - A flat array of vertex coordinates
26112 * @param {number[]} [holes] - An array of hole indices
26113 * @param {number} [dimensions=2] - The number of coordinates per vertex in the input array
26114 * @return {number[]} Triangulated polygon
26115 */
26116 function earcut(vertices: number[], holes?: number[], dimensions?: number): number[];
26117 /**
26118 * Node.js compatible URL utilities.
26119 *
26120 * @see https://www.npmjs.com/package/url
26121 *
26122 * @memberof PIXI.utils
26123 * @name url
26124 * @type {object}
26125 */
26126 var url: any;
26127 /**
26128 * Helper for warning developers about deprecated features & settings.
26129 * A stack track for warnings is given; useful for tracking-down where
26130 * deprecated methods/properties/classes are being used within the code.
26131 *
26132 * @memberof PIXI.utils
26133 * @function deprecation
26134 * @param {string} version - The version where the feature became deprecated
26135 * @param {string} message - Message should include what is deprecated, where, and the new solution
26136 * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack
26137 * this is mostly to ignore internal deprecation calls.
26138 */
26139 function deprecation(version: string, message: string, ignoreDepth?: number): void;
26140 /**
26141 * Creates a Canvas element of the given size to be used as a target for rendering to.
26142 *
26143 * @class
26144 * @memberof PIXI.utils
26145 */
26146 class CanvasRenderTarget {
26147 constructor(width: number, height: number, resolution?: number);
26148 /**
26149 * The Canvas object that belongs to this CanvasRenderTarget.
26150 *
26151 * @member {HTMLCanvasElement} PIXI.utils.CanvasRenderTarget#canvas
26152 */
26153 canvas: HTMLCanvasElement;
26154 /**
26155 * A CanvasRenderingContext2D object representing a two-dimensional rendering context.
26156 *
26157 * @member {CanvasRenderingContext2D} PIXI.utils.CanvasRenderTarget#context
26158 */
26159 context: CanvasRenderingContext2D;
26160 /**
26161 * Resizes the canvas to the specified width and height.
26162 *
26163 * @param {number} width - the new width of the canvas
26164 * @param {number} height - the new height of the canvas
26165 */
26166 resize(width: number, height: number): void;
26167 /**
26168 * Destroys this canvas.
26169 *
26170 */
26171 destroy(): void;
26172 /**
26173 * The width of the canvas buffer in pixels.
26174 *
26175 * @member {number}
26176 */
26177 width: number;
26178 /**
26179 * The height of the canvas buffer in pixels.
26180 *
26181 * @member {number}
26182 */
26183 height: number;
26184 }
26185 /**
26186 * @todo Describe property usage
26187 *
26188 * @static
26189 * @name ProgramCache
26190 * @memberof PIXI.utils
26191 * @type {Object}
26192 */
26193 var ProgramCache: any;
26194 /**
26195 * @todo Describe property usage
26196 *
26197 * @static
26198 * @name TextureCache
26199 * @memberof PIXI.utils
26200 * @type {Object}
26201 */
26202 var TextureCache: any;
26203 /**
26204 * @todo Describe property usage
26205 *
26206 * @static
26207 * @name BaseTextureCache
26208 * @memberof PIXI.utils
26209 * @type {Object}
26210 */
26211 var BaseTextureCache: any;
26212 /**
26213 * Destroys all texture in the cache
26214 *
26215 * @memberof PIXI.utils
26216 * @function destroyTextureCache
26217 */
26218 function destroyTextureCache(): void;
26219 /**
26220 * Removes all textures from cache, but does not destroy them
26221 *
26222 * @memberof PIXI.utils
26223 * @function clearTextureCache
26224 */
26225 function clearTextureCache(): void;
26226 /**
26227 * Trim transparent borders from a canvas
26228 *
26229 * @memberof PIXI.utils
26230 * @function trimCanvas
26231 * @param {HTMLCanvasElement} canvas - the canvas to trim
26232 * @returns {object} Trim data
26233 */
26234 function trimCanvas(canvas: HTMLCanvasElement): any;
26235 /**
26236 * @memberof PIXI.utils
26237 * @interface DecomposedDataUri
26238 */
26239 interface DecomposedDataUri {
26240 /**
26241 * type, eg. `image`
26242 * @memberof PIXI.utils.DecomposedDataUri#
26243 * @member {string} mediaType
26244 */
26245 mediaType: string;
26246 /**
26247 * Sub type, eg. `png`
26248 * @memberof PIXI.utils.DecomposedDataUri#
26249 * @member {string} subType
26250 */
26251 subType: string;
26252 /**
26253 * @memberof PIXI.utils.DecomposedDataUri#
26254 * @member {string} charset
26255 */
26256 charset: string;
26257 /**
26258 * Data encoding, eg. `base64`
26259 * @memberof PIXI.utils.DecomposedDataUri#
26260 * @member {string} encoding
26261 */
26262 encoding: string;
26263 /**
26264 * The actual data
26265 * @memberof PIXI.utils.DecomposedDataUri#
26266 * @member {string} data
26267 */
26268 data: string;
26269 }
26270 /**
26271 * Split a data URI into components. Returns undefined if
26272 * parameter `dataUri` is not a valid data URI.
26273 *
26274 * @memberof PIXI.utils
26275 * @function decomposeDataUri
26276 * @param {string} dataUri - the data URI to check
26277 * @return {PIXI.utils.DecomposedDataUri|undefined} The decomposed data uri or undefined
26278 */
26279 function decomposeDataUri(dataUri: string): PIXI.utils.DecomposedDataUri | undefined;
26280 /**
26281 * get the resolution / device pixel ratio of an asset by looking for the prefix
26282 * used by spritesheets and image urls
26283 *
26284 * @memberof PIXI.utils
26285 * @function getResolutionOfUrl
26286 * @param {string} url - the image path
26287 * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set.
26288 * @return {number} resolution / device pixel ratio of an asset
26289 */
26290 function getResolutionOfUrl(url: string, defaultValue?: number): number;
26291 }
26292}
26293
26294/**
26295 * @interface SharedArrayBuffer
26296 */
26297declare interface SharedArrayBuffer {
26298}
26299
26300/**
26301 * @interface OffscreenCanvas
26302 */
26303declare interface OffscreenCanvas {
26304}
26305
26306
26307declare namespace PIXI {
26308 namespace utils {
26309// https://github.com/primus/eventemitter3
26310 export interface EventEmitter {
26311 /**
26312 * Return an array listing the events for which the emitter has registered listeners.
26313 *
26314 * @returns {(string | symbol)[]}
26315 */
26316 eventNames(): Array<(string | symbol)>;
26317
26318 /**
26319 * Return the listeners registered for a given event.
26320 *
26321 * @param {(string | symbol)} event The event name.
26322 * @returns {Function[]}
26323 */
26324 //tslint:disable-next-line:ban-types forbidden-types
26325 listeners(event: string | symbol): Array<Function>;
26326
26327 /**
26328 * Return the number of listeners listening to a given event.
26329 *
26330 * @param {(string | symbol)} event The event name.
26331 * @returns {number}
26332 */
26333 listenerCount(event: string | symbol): number;
26334
26335 /**
26336 * Calls each of the listeners registered for a given event.
26337 *
26338 * @param {(string | symbol)} event The event name.
26339 * @param {...*} args Arguments that are passed to registered listeners
26340 * @returns {boolean} `true` if the event had listeners, else `false`.
26341 */
26342 emit(event: string | symbol, ...args: any[]): boolean;
26343
26344 /**
26345 * Add a listener for a given event.
26346 *
26347 * @param {(string | symbol)} event The event name.
26348 * @param {Function} fn The listener function.
26349 * @param {*} [context=this] The context to invoke the listener with.
26350 * @returns {EventEmitter} `this`.
26351 */
26352 //tslint:disable-next-line:ban-types forbidden-types
26353 on(event: string | symbol, fn: Function, context?: any): this;
26354
26355 /**
26356 * Add a one-time listener for a given event.
26357 *
26358 * @param {(string | symbol)} event The event name.
26359 * @param {Function} fn The listener function.
26360 * @param {*} [context=this] The context to invoke the listener with.
26361 * @returns {EventEmitter} `this`.
26362 */
26363 //tslint:disable-next-line:ban-types forbidden-types
26364 once(event: string | symbol, fn: Function, context?: any): this;
26365
26366 /**
26367 * Remove the listeners of a given event.
26368 *
26369 * @param {(string | symbol)} event The event name.
26370 * @param {Function} fn Only remove the listeners that match this function.
26371 * @param {*} context Only remove the listeners that have this context.
26372 * @param {boolean} once Only remove one-time listeners.
26373 * @returns {EventEmitter} `this`.
26374 */
26375 //tslint:disable-next-line:ban-types forbidden-types
26376 removeListener(event: string | symbol, fn?: Function, context?: any, once?: boolean): this;
26377
26378 /**
26379 * Remove all listeners, or those of the specified event.
26380 *
26381 * @param {(string | symbol)} event The event name.
26382 * @returns {EventEmitter} `this`.
26383 */
26384 removeAllListeners(event?: string | symbol): this;
26385
26386 /**
26387 * Alias method for `removeListener`
26388 */
26389 //tslint:disable-next-line:ban-types forbidden-types
26390 off(event: string | symbol, fn?: Function, context?: any, once?: boolean): this;
26391
26392 /**
26393 * Alias method for `on`
26394 */
26395 //tslint:disable-next-line:ban-types forbidden-types
26396 addListener(event: string | symbol, fn: Function, context?: any): this;
26397 }
26398 }
26399
26400
26401 type InteractionPointerEvents = "pointerdown" | "pointercancel" | "pointerup" | "pointertap" | "pointerupoutside" | "pointermove" | "pointerover" | "pointerout";
26402 type InteractionTouchEvents = "touchstart" | "touchcancel" | "touchend" | "touchendoutside" | "touchmove" | "tap";
26403 type InteractionMouseEvents = "rightdown" | "mousedown" | "rightup" | "mouseup" | "rightclick" | "click" | "rightupoutside" | "mouseupoutside" | "mousemove" | "mouseover" | "mouseout";
26404 type InteractionPixiEvents = "added" | "removed";
26405 type InteractionEventTypes = InteractionPointerEvents | InteractionTouchEvents | InteractionMouseEvents | InteractionPixiEvents;
26406
26407 export interface DisplayObject {
26408 on(event: InteractionEventTypes, fn: (event: InteractionEvent) => void, context?: any): this;
26409 //tslint:disable-next-line:ban-types forbidden-types
26410 on(event: string | symbol, fn: Function, context?: any): this;
26411 once(event: InteractionEventTypes, fn: (event: InteractionEvent) => void, context?: any): this;
26412 //tslint:disable-next-line:ban-types forbidden-types
26413 once(event: string | symbol, fn: Function, context?: any): this;
26414 removeListener(event: InteractionEventTypes, fn?: (event: InteractionEvent) => void, context?: any): this;
26415 //tslint:disable-next-line:ban-types forbidden-types
26416 removeListener(event: string | symbol, fn?: Function, context?: any): this;
26417 removeAllListeners(event?: InteractionEventTypes): this;
26418 removeAllListeners(event?: string | symbol): this;
26419 off(event: InteractionEventTypes, fn?: (event: InteractionEvent) => void, context?: any): this;
26420 //tslint:disable-next-line:ban-types forbidden-types
26421 off(event: string | symbol, fn?: Function, context?: any): this;
26422 addListener(event: InteractionEventTypes, fn: (event: InteractionEvent) => void, context?: any): this;
26423 //tslint:disable-next-line:ban-types forbidden-types
26424 addListener(event: string | symbol, fn: Function, context?: any): this;
26425 }
26426
26427 export interface Container {
26428 once(event: "added" | "removed", fn: (displayObject: DisplayObject) => void, context?: any): this;
26429 //tslint:disable-next-line:ban-types forbidden-types
26430 once(event: string, fn: Function, context?: any): this;
26431 on(event: "added" | "removed", fn: (displayObject: DisplayObject) => void, context?: any): this;
26432 //tslint:disable-next-line:ban-types forbidden-types
26433 on(event: string, fn: Function, context?: any): this;
26434 //tslint:disable-next-line:ban-types forbidden-types
26435 off(event: "added" | "removed" | string, fn?: Function, context?: any): this;
26436 }
26437}
26438
26439declare namespace PIXI {
26440 export interface Loader {
26441 baseUrl: string;
26442 progress: number;
26443 loading: boolean;
26444 defaultQueryString: string;
26445 resources: IResourceDictionary;
26446 concurrency: number;
26447
26448 add(...params: any[]): this;
26449 //tslint:disable-next-line:ban-types forbidden-types
26450 add(name: string, url: string, options?: ILoaderOptions, cb?: Function): this;
26451 //tslint:disable-next-line:ban-types forbidden-types
26452 add(obj: string | any | any[], options?: ILoaderOptions, cb?: Function): this;
26453
26454 //tslint:disable-next-line:ban-types forbidden-types
26455 pre(fn: Function): this;
26456 //tslint:disable-next-line:ban-types forbidden-types
26457 use(fn: Function): this;
26458 reset(): this;
26459 //tslint:disable-next-line:ban-types forbidden-types
26460 load(cb?: (loader: Loader, resources: Partial<Record<string, LoaderResource>>) => void): this;
26461
26462 destroy(): void;
26463 }
26464
26465 export interface IResourceDictionary {
26466 [index: string]: LoaderResource;
26467 }
26468
26469 export interface ITextureDictionary {
26470 [index: string]: Texture;
26471 }
26472
26473 export interface ILoaderOptions {
26474 crossOrigin?: boolean | string;
26475 loadType?: number;
26476 xhrType?: string;
26477 metadata?: {
26478 loadElement?: HTMLImageElement | HTMLAudioElement | HTMLVideoElement;
26479 skipSource?: boolean;
26480 mimeType?: string | string[];
26481 };
26482 }
26483
26484 export interface LoaderResource {
26485 name: string;
26486 url: string;
26487 extension: string;
26488 data: any;
26489 crossOrigin: boolean | string;
26490 loadType: number;
26491 xhrType: string;
26492 metadata: any;
26493 error: Error;
26494 xhr: XMLHttpRequest | null;
26495 children: LoaderResource[];
26496 type: number;
26497 progressChunk: number;
26498 isDataUrl: boolean;
26499 isComplete: boolean;
26500 isLoading: boolean;
26501 complete(): void;
26502 abort(message?: string): void;
26503 //tslint:disable-next-line:ban-types forbidden-types
26504 load(cb?: Function): void;
26505 texture: Texture;
26506 spineAtlas: any;
26507 spineData: any;
26508 spritesheet?: Spritesheet;
26509 textures?: ITextureDictionary;
26510 }
26511
26512 namespace LoaderResource {
26513 function setExtensionLoadType(extname: string, loadType: number): void;
26514 function setExtensionXhrType(extname: string, xhrType: string): void;
26515
26516 export enum STATUS_FLAGS {
26517 NONE = 0,
26518 DATA_URL = (1 << 0),
26519 COMPLETE = (1 << 1),
26520 LOADING = (1 << 2),
26521 }
26522
26523 export enum TYPE {
26524 UNKNOWN = 0,
26525 JSON = 1,
26526 XML = 2,
26527 IMAGE = 3,
26528 AUDIO = 4,
26529 VIDEO = 5,
26530 TEXT = 6,
26531 }
26532
26533 export enum LOAD_TYPE {
26534
26535 /** Uses XMLHttpRequest to load the resource. */
26536 XHR = 1,
26537 /** Uses an `Image` object to load the resource. */
26538 IMAGE = 2,
26539 /** Uses an `Audio` object to load the resource. */
26540 AUDIO = 3,
26541 /** Uses a `Video` object to load the resource. */
26542 VIDEO = 4,
26543 }
26544
26545 export enum XHR_RESPONSE_TYPE {
26546 /** string */
26547 DEFAULT = 'text',
26548 /** ArrayBuffer */
26549 BUFFER = 'arraybuffer',
26550 /** Blob */
26551 BLOB = 'blob',
26552 /** Document */
26553 DOCUMENT = 'document',
26554 /** Object */
26555 JSON = 'json',
26556 /** String */
26557 TEXT = 'text',
26558 }
26559
26560 let EMPTY_GIF: string;
26561 }
26562}
26563
26564declare module "pixi.js-legacy" {
26565 export = PIXI;
26566}
\No newline at end of file