diff --git a/types/phaser.d.ts b/types/phaser.d.ts index b416946fc..dcffb2a88 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -2972,11 +2972,6 @@ declare namespace Phaser { */ ignore(entries: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Layer | Phaser.GameObjects.Layer[]): this; - /** - * Internal preRender step. - */ - protected preRender(): void; - /** * Takes an x value and checks it's within the range of the Camera bounds, adjusting if required. * Do not call this method if you are not using camera bounds. @@ -11242,6 +11237,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -11512,7 +11529,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -12680,6 +12697,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -12950,7 +12989,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -13714,6 +13753,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The Mask this Game Object is using during render. */ @@ -13832,7 +13893,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -14799,6 +14860,24 @@ declare namespace Phaser { * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; } /** @@ -15557,7 +15636,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; } /** @@ -17244,6 +17323,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The Mask this Game Object is using during render. */ @@ -18249,6 +18350,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontal origin of this Game Object. * The origin maps the relationship between the size and position of the Game Object. @@ -18932,6 +19055,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -22027,6 +22172,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The Mask this Game Object is using during render. */ @@ -22145,7 +22312,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -23260,6 +23427,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -23600,7 +23789,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -24789,6 +24978,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The Mask this Game Object is using during render. */ @@ -26151,6 +26362,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The Mask this Game Object is using during render. */ @@ -26269,7 +26502,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -27263,6 +27496,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -27512,7 +27767,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -28960,6 +29215,16 @@ declare namespace Phaser { */ particleClass: Function; + /** + * An internal object holding the configuration for the Emitter. + * + * These are populated as part of the Emitter configuration parsing. + * + * You typically do not access them directly, but instead use the + * `ParticleEmitter.setConfig` or `ParticleEmitter.updateConfig` methods. + */ + config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig; + /** * An internal object holding all of the EmitterOp instances. * @@ -29240,6 +29505,15 @@ declare namespace Phaser { */ setConfig(config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig): this; + /** + * Takes an existing Emitter Configuration file and updates this Emitter. + * Existing properties are overriden while new properties are added. The + * updated configuration is then passed to the `setConfig` method to reset + * the Emitter with the updated configuration. + * @param config Settings for this emitter. + */ + updateConfig(config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig): this; + /** * Creates a description of this emitter suitable for JSON serialization. */ @@ -30208,6 +30482,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The Mask this Game Object is using during render. */ @@ -30326,7 +30622,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -31184,6 +31480,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -31524,7 +31842,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -32679,6 +32997,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The Mask this Game Object is using during render. */ @@ -32797,7 +33137,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -33467,6 +33807,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -33683,7 +34045,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -34773,6 +35135,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -35113,7 +35497,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -36189,6 +36573,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Toggles the horizontal flipped state of this Game Object. * @@ -36353,7 +36759,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -37315,6 +37721,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -37977,6 +38405,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -38253,7 +38703,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -38789,6 +39239,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -39065,7 +39537,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -39611,6 +40083,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -39887,7 +40381,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -40503,6 +40997,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -40779,7 +41295,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -41362,6 +41878,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -41638,7 +42176,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -42235,6 +42773,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -42511,7 +43071,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -43064,6 +43624,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -43340,7 +43922,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -43897,6 +44479,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -44173,7 +44777,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -44700,6 +45304,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -44976,7 +45602,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -45628,6 +46254,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -45904,7 +46552,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -46464,6 +47112,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -46740,7 +47410,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -47274,6 +47944,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -47550,7 +48242,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -48336,6 +49028,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -48676,7 +49390,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -49661,7 +50375,7 @@ declare namespace Phaser { * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, * spaces and whitespace are left as is. Default false. */ - setWordWrapWidth(width: number | undefined, useAdvancedWrap?: boolean): this; + setWordWrapWidth(width: number | null, useAdvancedWrap?: boolean): this; /** * Set a custom callback for wrapping lines. Pass in null to remove wrapping by callback. @@ -49985,6 +50699,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -50325,7 +51061,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -50996,7 +51732,7 @@ declare namespace Phaser { * Set the text style. * @param style The style settings to set. * @param updateText Whether to update the text immediately. Default true. - * @param setDefaults Use the default values is not set, or the local values. Default false. + * @param setDefaults Use the default values if not set, or the local values. Default false. */ setStyle(style: Phaser.Types.GameObjects.Text.TextStyle, updateText?: boolean, setDefaults?: boolean): Phaser.GameObjects.Text; @@ -51162,7 +51898,7 @@ declare namespace Phaser { * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, * spaces and whitespace are left as is. Default false. */ - setWordWrapWidth(width: number, useAdvancedWrap?: boolean): Phaser.GameObjects.Text; + setWordWrapWidth(width: number | null, useAdvancedWrap?: boolean): Phaser.GameObjects.Text; /** * Set a custom callback for wrapping lines. @@ -51588,6 +52324,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -51928,7 +52686,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -53419,6 +54177,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -53750,7 +54530,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -54441,6 +55221,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * Gets the center coordinate of this Game Object, regardless of origin. * @@ -63671,7 +64473,7 @@ declare namespace Phaser { * * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapTiledJSON. */ - class TilemapJSONFile extends Phaser.Loader.File { + class TilemapJSONFile extends Phaser.Loader.FileTypes.JSONFile { /** * * @param loader A reference to the Loader that is responsible for this file. @@ -66647,6 +67449,17 @@ declare namespace Phaser { */ addPack(pack: any, packKey?: string): boolean; + /** + * Remove the resources listed in an Asset Pack. + * + * This removes Animations from the Animation Manager, Textures from the Texture Manager, and all other assets from their respective caches. + * It doesn't remove the Pack itself from the JSON cache, if it exists there. + * If the Pack includes another Pack, its resources will be removed too. + * @param packKey The key of an Asset Pack in the JSON cache, or a Pack File data. + * @param dataKey A key in the Pack data, if you want to process only a section of it. + */ + removePack(packKey: string | object, dataKey?: string): void; + /** * Is the Loader actively loading, or processing loaded files? */ @@ -69007,6 +69820,13 @@ declare namespace Phaser { */ addVectors(a: Phaser.Math.Vector3, b: Phaser.Math.Vector3): Phaser.Math.Vector3; + /** + * Subtracts the two given Vector3s and sets the results into this Vector3. + * @param a The first Vector to sub. + * @param b The second Vector to sub. + */ + subVectors(a: Phaser.Math.Vector3, b: Phaser.Math.Vector3): Phaser.Math.Vector3; + /** * Calculate the cross (vector) product of two given Vectors. * @param a The first Vector to multiply. @@ -70179,7 +70999,7 @@ declare namespace Phaser { /** * The DOM element that will contain the game canvas, or its `id`. If undefined, or if the named element doesn't exist, the game canvas is appended to the document body. If `null` no parent will be used and you are responsible for adding the canvas to the dom. */ - parent?: HTMLElement | string; + parent?: HTMLElement | string | null; /** * Provide your own Canvas element for Phaser to use instead of creating one. */ @@ -70495,6 +71315,14 @@ declare namespace Phaser { * An optional array of schemes that the Loader considers as being 'local' files. Defaults to: `[ 'file://', 'capacitor://' ]` if not specified. */ localScheme?: string[]; + /** + * Optional XHR withCredentials value. + */ + withCredentials?: boolean; + /** + * Optional load type for image, `XHR` is default, or `HTMLImageElement` for a lightweight way. + */ + imageLoadType?: string; }; type MouseInputConfig = { @@ -72749,6 +73577,10 @@ declare namespace Phaser { * The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. */ anims?: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig; + /** + * This property is used exclusively by `Tilemap.createFromTiles`. Set to `true` if this Sprite is being created by a Tilemap and is part of a spritesheet. + */ + useSpriteSheet?: boolean; }; } @@ -75414,6 +76246,10 @@ declare namespace Phaser { * An object reserved for storing plugin-specific properties. */ plugin?: any; + /** + * An object for storing wrap boundaries. + */ + wrapBounds?: any; /** * A number specifying the angle of the body, in radians. */ @@ -76250,18 +77086,6 @@ declare namespace Phaser { * A `Number` that specifies the global scaling factor of time for all bodies. A value of `0` freezes the simulation. A value of `0.1` gives a slow-motion effect. A value of `1.2` gives a speed-up effect. */ "timing.timeScale"?: number; - /** - * Should the Matter Attractor Plugin be enabled? An attractors plugin that makes it easy to apply continual forces on bodies. It's possible to simulate effects such as wind, gravity and magnetism. - */ - "plugins.attractors"?: boolean; - /** - * Should the Matter Wrap Plugin be enabled? A coordinate wrapping plugin that automatically wraps the position of bodies such that they always stay within the given bounds. Upon crossing a boundary the body will appear on the opposite side of the bounds, while maintaining its velocity. - */ - "plugins.wrap"?: boolean; - /** - * Should the Matter Collision Events Plugin be enabled? - */ - "plugins.collisionevents"?: boolean; /** * Toggles if the world is enabled or not. */ @@ -76481,7 +77305,10 @@ declare namespace Phaser { * You should set this to `false` by default. The pipeline will enable it on boot. */ enabled: boolean; - undefined: any; + /** + * You should set this to `-1` by default. The pipeline will set it on boot. + */ + location: number | Phaser.Renderer.WebGL.Wrappers.WebGLAttribLocationWrapper; }; type WebGLPipelineAttributeConfig = { @@ -77755,6 +78582,10 @@ declare namespace Phaser { * Optional event name to emit when the Event fires. */ event?: string; + /** + * If this Event is using a Tween to manage its actions, this property will contain a reference to it. + */ + tweenInstance?: Phaser.Tweens.Tween | Phaser.Tweens.TweenChain; }; type TimelineEventConfig = { @@ -78804,6 +79635,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -79144,7 +79997,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -80156,8 +81009,8 @@ declare namespace Phaser { /** * Sets the velocity of the Body. - * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. - * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + * @param x The horizontal velocity of the body, in pixels per second. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body, in pixels per second. Positive values move the body down, while negative values move it up. Default x. */ setVelocity(x: number, y?: number): this; @@ -80165,7 +81018,7 @@ declare namespace Phaser { * Sets the horizontal component of the body's velocity. * * Positive values move the body to the right, while negative values move it to the left. - * @param x The new horizontal velocity. + * @param x The new horizontal velocity, in pixels per second. */ setVelocityX(x: number): this; @@ -80173,14 +81026,14 @@ declare namespace Phaser { * Sets the vertical component of the body's velocity. * * Positive values move the body down, while negative values move it up. - * @param y The new vertical velocity of the body. + * @param y The new vertical velocity, in pixels per second. */ setVelocityY(y: number): this; /** * Sets the maximum velocity of the body. - * @param x The new maximum horizontal velocity. - * @param y The new maximum vertical velocity. Default x. + * @param x The new maximum horizontal velocity, in pixels per second. + * @param y The new maximum vertical velocity, in pixels per second. Default x. */ setMaxVelocity(x: number, y?: number): this; @@ -80661,6 +81514,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -81001,7 +81876,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -82013,8 +82888,8 @@ declare namespace Phaser { /** * Sets the velocity of the Body. - * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. - * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + * @param x The horizontal velocity of the body, in pixels per second. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body, in pixels per second. Positive values move the body down, while negative values move it up. Default x. */ setVelocity(x: number, y?: number): this; @@ -82022,7 +82897,7 @@ declare namespace Phaser { * Sets the horizontal component of the body's velocity. * * Positive values move the body to the right, while negative values move it to the left. - * @param x The new horizontal velocity. + * @param x The new horizontal velocity, in pixels per second. */ setVelocityX(x: number): this; @@ -82030,14 +82905,14 @@ declare namespace Phaser { * Sets the vertical component of the body's velocity. * * Positive values move the body down, while negative values move it up. - * @param y The new vertical velocity of the body. + * @param y The new vertical velocity, in pixels per second. */ setVelocityY(y: number): this; /** * Sets the maximum velocity of the body. - * @param x The new maximum horizontal velocity. - * @param y The new maximum vertical velocity. Default x. + * @param x The new maximum horizontal velocity, in pixels per second. + * @param y The new maximum vertical velocity, in pixels per second. Default x. */ setMaxVelocity(x: number, y?: number): this; @@ -83616,28 +84491,28 @@ declare namespace Phaser { interface Velocity { /** * Sets the velocity of the Body. - * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. - * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + * @param x The horizontal velocity of the body, in pixels per second. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body, in pixels per second. Positive values move the body down, while negative values move it up. Default x. */ setVelocity(x: number, y?: number): this; /** * Sets the horizontal component of the body's velocity. * * Positive values move the body to the right, while negative values move it to the left. - * @param x The new horizontal velocity. + * @param x The new horizontal velocity, in pixels per second. */ setVelocityX(x: number): this; /** * Sets the vertical component of the body's velocity. * * Positive values move the body down, while negative values move it up. - * @param y The new vertical velocity of the body. + * @param y The new vertical velocity, in pixels per second. */ setVelocityY(y: number): this; /** * Sets the maximum velocity of the body. - * @param x The new maximum horizontal velocity. - * @param y The new maximum vertical velocity. Default x. + * @param x The new maximum horizontal velocity, in pixels per second. + * @param y The new maximum vertical velocity, in pixels per second. Default x. */ setMaxVelocity(x: number, y?: number): this; } @@ -86949,6 +87824,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -87289,7 +88186,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -88518,61 +89415,6 @@ declare namespace Phaser { */ getConfig(): Phaser.Types.Physics.Matter.MatterWorldConfig; - /** - * Enables the Matter Attractors Plugin. - * - * The attractors plugin that makes it easy to apply continual forces on bodies. - * It's possible to simulate effects such as wind, gravity and magnetism. - * - * https://github.com/liabru/matter-attractors - * - * This method is called automatically if `plugins.attractors` is set in the Matter World Config. - * However, you can also call it directly from within your game. - */ - enableAttractorPlugin(): this; - - /** - * Enables the Matter Wrap Plugin. - * - * The coordinate wrapping plugin that automatically wraps the position of bodies such that they always stay - * within the given bounds. Upon crossing a boundary the body will appear on the opposite side of the bounds, - * while maintaining its velocity. - * - * https://github.com/liabru/matter-wrap - * - * This method is called automatically if `plugins.wrap` is set in the Matter World Config. - * However, you can also call it directly from within your game. - */ - enableWrapPlugin(): this; - - /** - * Enables the Matter Collision Events Plugin. - * - * Note that this plugin is enabled by default. So you should only ever need to call this - * method if you have specifically disabled the plugin in your Matter World Config. - * You can disable it by setting `plugins.collisionevents: false` in your Matter World Config. - * - * This plugin triggers three new events on Matter.Body: - * - * 1. `onCollide` - * 2. `onCollideEnd` - * 3. `onCollideActive` - * - * These events correspond to the Matter.js events `collisionStart`, `collisionActive` and `collisionEnd`, respectively. - * You can listen to these events via Matter.Events or they will also be emitted from the Matter World. - * - * This plugin also extends Matter.Body with three convenience functions: - * - * `Matter.Body.setOnCollide(callback)` - * `Matter.Body.setOnCollideEnd(callback)` - * `Matter.Body.setOnCollideActive(callback)` - * - * You can register event callbacks by providing a function of type (pair: Matter.Pair) => void - * - * https://github.com/dxu/matter-collision-events - */ - enableCollisionEventsPlugin(): this; - /** * Pauses the Matter World instance and sets `enabled` to `false`. * @@ -89015,6 +89857,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -89355,7 +90219,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -94335,7 +95199,6 @@ declare namespace Phaser { * The default shader uniforms for this pipeline are: * * `uProjectionMatrix` (mat4) - * `uRoundPixels` (int) * `uResolution` (vec2) * `uMainSampler` (sampler2D, or sampler2D array) */ @@ -94382,7 +95245,6 @@ declare namespace Phaser { * The default shader uniforms for this pipeline are: * * `uProjectionMatrix` (mat4) - * `uRoundPixels` (int) * `uResolution` (vec2) * `uMainSampler` (sampler2D, or sampler2D array) * @@ -95321,7 +96183,6 @@ declare namespace Phaser { * The default shader uniforms for this pipeline are: * * `uProjectionMatrix` (mat4) - * `uRoundPixels` (int) * `uResolution` (vec2) * `uMainSampler` (sampler2D, or sampler2D array) * @@ -95358,7 +96219,6 @@ declare namespace Phaser { * The default shader uniforms for this pipeline are: * * `uProjectionMatrix` (mat4) - * `uRoundPixels` (int) * `uResolution` (vec2) * `uMainSampler` (sampler2D, or sampler2D array) */ @@ -95787,9 +96647,14 @@ declare namespace Phaser { adjustViewport(): void; /** - * Clears this Render Target. + * Clears a portion or everything from this Render Target. To clear an area, + * specify the `x`, `y`, `width` and `height`. + * @param x The left coordinate of the fill rectangle. Default 0. + * @param y The top coordinate of the fill rectangle. Default 0. + * @param width The width of the fill rectangle. Default this.width. + * @param height The height of the fill rectangle. Default this.height. */ - clear(): void; + clear(x?: number, y?: number, width?: number, height?: number): void; /** * Unbinds this Render Target and optionally flushes the WebGL Renderer first. @@ -97103,16 +97968,28 @@ declare namespace Phaser { /** * The handler to invoke when the context is lost. - * This should not be changed and is set in the boot method. + * This should not be changed and is set in the init method. */ contextLostHandler: Function; /** * The handler to invoke when the context is restored. - * This should not be changed and is set in the boot method. + * This should not be changed and is set in the init method. */ contextRestoredHandler: Function; + /** + * The previous contextLostHandler that was in use. + * This is set when `setContextHandlers` is called. + */ + previousContextLostHandler: Function; + + /** + * The previous contextRestoredHandler that was in use. + * This is set when `setContextHandlers` is called. + */ + previousContextRestoredHandler: Function; + /** * The underlying WebGL context of the renderer. */ @@ -97308,6 +98185,39 @@ declare namespace Phaser { */ init(config: object): this; + /** + * Sets the handlers that are called when WebGL context is lost or restored by the browser. + * + * The default handlers are referenced via the properties `WebGLRenderer.contextLostHandler` and `WebGLRenderer.contextRestoredHandler`. + * By default, these map to the methods `WebGLRenderer.dispatchContextLost` and `WebGLRenderer.dispatchContextRestored`. + * + * You can override these handlers with your own via this method. + * + * If you do override them, make sure that your handlers invoke the methods `WebGLRenderer.dispatchContextLost` and `WebGLRenderer.dispatchContextRestored` in due course, otherwise the renderer will not be able to restore itself fully. + * @param contextLost Custom handler for responding to the WebGL context lost event. Set as `undefined` to use the default handler. + * @param contextRestored Custom handler for responding to the WebGL context restored event. Set as `undefined` to use the default handler. + */ + setContextHandlers(contextLost?: Function, contextRestored?: Function): void; + + /** + * This method is called when the WebGL context is lost. By default this is bound to the property `WebGLRenderer.contextLostHandler`. + * If you override the context loss handler via the `setContextHandlers` method then be sure to invoke this method in due course. + * @param event The WebGL context lost Event. + */ + dispatchContextLost(event: WebGLContextEvent): void; + + /** + * This method is called when the WebGL context is restored. By default this is bound to the property `WebGLRenderer.contextRestoredHandler`. + * If you override the context restored handler via the `setContextHandlers` method then be sure to invoke this method in due course. + * @param event The WebGL context restored Event. + */ + dispatchContextRestored(event: WebGLContextEvent): void; + + /** + * Create temporary WebGL textures to stop WebGL errors on macOS. + */ + createTemporaryTextures(): void; + /** * This method is only available in the Debug Build of Phaser, or a build with the * `WEBGL_DEBUG` flag set in the Webpack Config. @@ -99047,13 +99957,21 @@ declare namespace Phaser { */ enum Orientation { /** - * A landscape orientation. + * The primary landscape orientation. */ LANDSCAPE, /** - * A portrait orientation. + * The secondary landscape orientation. + */ + LANDSCAPE_SECONDARY, + /** + * The primary portrait orientation. */ PORTRAIT, + /** + * The secondary portrait orientation. + */ + PORTRAIT_SECONDARY, } /** @@ -99768,12 +100686,12 @@ declare namespace Phaser { const CENTER_VERTICALLY: number; /** - * A landscape orientation. + * The primary landscape orientation. */ const LANDSCAPE: string; /** - * A portrait orientation. + * The primary portrait orientation. */ const PORTRAIT: string; @@ -99812,6 +100730,12 @@ declare namespace Phaser { */ const RESIZE: number; + /** + * The Canvas's visible area is resized to fit all available _parent_ space like RESIZE mode, + * and scale canvas size to fit inside the visible area like FIT mode. + */ + const EXPAND: number; + /** * The game canvas will not be zoomed by Phaser. */ @@ -101688,6 +102612,14 @@ declare namespace Phaser { */ stopByKey(key: string): number; + /** + * When a key is given, returns true if any sound with that key is playing. + * + * When no key is given, returns true if any sound is playing. + * @param key Sound asset key. + */ + isPlaying(key: string | undefined): boolean; + /** * Method used internally for unlocking audio playback on devices that * require user interaction before any sound can be played on a web page. @@ -104660,10 +105592,14 @@ declare namespace Phaser { fill(rgb: number, alpha?: number, x?: number, y?: number, width?: number, height?: number): this; /** - * Fully clears this Dynamic Texture, erasing everything from it and resetting it back to - * a blank, transparent, texture. + * Clears a portion or everything from this Dynamic Texture by erasing it and resetting it back to + * a blank, transparent, texture. To clear an area, specify the `x`, `y`, `width` and `height`. + * @param x The left coordinate of the fill rectangle. Default 0. + * @param y The top coordinate of the fill rectangle. Default 0. + * @param width The width of the fill rectangle. Default this.width. + * @param height The height of the fill rectangle. Default this.height. */ - clear(): this; + clear(x?: number, y?: number, width?: number, height?: number): this; /** * Takes the given texture key and frame and then stamps it at the given @@ -105362,6 +106298,20 @@ declare namespace Phaser { */ v1: number; + /** + * Sets the x and y position within the source image to cut from. + * @param x X position within the source image to cut from. Default 0. + * @param y Y position within the source image to cut from. Default 0. + */ + setCutPosition(x?: number, y?: number): this; + + /** + * Sets the width, and height of the area in the source image to cut. + * @param width The width of the area in the source image to cut. + * @param height The height of the area in the source image to cut. + */ + setCutSize(width: number, height: number): this; + /** * Sets the width, height, x and y of this Frame. * @@ -106534,20 +107484,20 @@ declare namespace Phaser { * Gets a tile at the given tile coordinates from the given layer. * @param tileX X position to get the tile from (given in tile units, not pixels). * @param tileY Y position to get the tile from (given in tile units, not pixels). - * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param nonNull For empty tiles, return a Tile object with an index of -1 instead of null. Default false. * @param layer The Tilemap Layer to act upon. */ - function GetTileAt(tileX: number, tileY: number, nonNull: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; + function GetTileAt(tileX: number, tileY: number, nonNull?: boolean, layer?: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Gets a tile at the given world coordinates from the given layer. * @param worldX X position to get the tile from (given in pixels) * @param worldY Y position to get the tile from (given in pixels) - * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param nonNull For empty tiles, return a Tile object with an index of -1 instead of null. Default false. * @param camera The Camera to use when calculating the tile index from the world values. * @param layer The Tilemap Layer to act upon. */ - function GetTileAtWorldXY(worldX: number, worldY: number, nonNull: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; + function GetTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Gets the corners of the Tile as an array of Vector2s. @@ -108962,7 +109912,7 @@ declare namespace Phaser { * If no layer is specified, the maps current layer is used. * @param tileX X position to get the tile from (given in tile units, not pixels). * @param tileY Y position to get the tile from (given in tile units, not pixels). - * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param nonNull For empty tiles, return a Tile object with an index of -1 instead of null. Default false. * @param layer The tile layer to use. If not given the current layer is used. */ getTileAt(tileX: number, tileY: number, nonNull?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile | null; @@ -108973,7 +109923,7 @@ declare namespace Phaser { * If no layer is specified, the maps current layer is used. * @param worldX X position to get the tile from (given in pixels) * @param worldY Y position to get the tile from (given in pixels) - * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param nonNull For empty tiles, return a Tile object with an index of -1 instead of null. Default false. * @param camera The Camera to use when calculating the tile index from the world values. * @param layer The tile layer to use. If not given the current layer is used. */ @@ -109548,6 +110498,8 @@ declare namespace Phaser { /** * A Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination * with one, or more, Tilesets. + * + * Do not add TilemapLayers to Containers, they are stand-alone display objects. */ class TilemapLayer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.PostPipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.Physics.Arcade.Components.Collision { /** @@ -109884,7 +110836,7 @@ declare namespace Phaser { * Gets a tile at the given tile coordinates from the given layer. * @param tileX X position to get the tile from (given in tile units, not pixels). * @param tileY Y position to get the tile from (given in tile units, not pixels). - * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param nonNull For empty tiles, return a Tile object with an index of -1 instead of null. Default false. */ getTileAt(tileX: number, tileY: number, nonNull?: boolean): Phaser.Tilemaps.Tile; @@ -109892,7 +110844,7 @@ declare namespace Phaser { * Gets a tile at the given world coordinates from the given layer. * @param worldX X position to get the tile from (given in pixels) * @param worldY Y position to get the tile from (given in pixels) - * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param nonNull For empty tiles, return a Tile object with an index of -1 instead of null. Default false. * @param camera The Camera to use when calculating the tile index from the world values. */ getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; @@ -109902,7 +110854,7 @@ declare namespace Phaser { * @param worldX X position to get the tile from (given in pixels) * @param worldY Y position to get the tile from (given in pixels) * @param originTop Which is the active face of the isometric tile? The top (default, true), or the base? (false) Default true. - * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param nonNull For empty tiles, return a Tile object with an index of -1 instead of null. Default false. * @param camera The Camera to use when calculating the tile index from the world values. */ getIsoTileAtWorldXY(worldX: number, worldY: number, originTop?: boolean, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; @@ -110474,6 +111426,28 @@ declare namespace Phaser { */ setDepth(value: number): this; + /** + * Bring this Game Object to top of display list. + */ + bringMeToTop(): this; + + /** + * Send this Game Object to bottom of display list. + */ + sendMeToBack(): this; + + /** + * Move this Game Object below another Game Object. + * @param gameObject Move this Game Object below this Game Object. + */ + moveMyDepthBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object above another Game Object. + * @param gameObject Move this Game Object above this Game Object. + */ + moveMyDepthAbove(gameObject: Phaser.GameObjects.GameObject): this; + /** * The horizontally flipped state of the Game Object. * @@ -110782,7 +111756,7 @@ declare namespace Phaser { /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ - getPipelineName(): string; + getPipelineName(): string | null; /** * Does this Game Object have any Post Pipelines set? @@ -111649,6 +112623,17 @@ declare namespace Phaser { */ elapsed: number; + /** + * The Timeline's delta time scale. + * + * Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. + * A value of 0 freezes time and is effectively equivalent to pausing the Timeline. + * + * This doesn't affect the delta time scale of any Tweens created by the Timeline. + * You will have to set the `timeScale` of each Tween or the Tween Manager if you want them to match. + */ + timeScale: number; + /** * Whether the Timeline is running (`true`) or active (`false`). * @@ -111797,6 +112782,8 @@ declare namespace Phaser { * * If the Timeline isn't currently running (i.e. it's paused or complete) then * calling this method resets those states, the same as calling `Timeline.play(true)`. + * + * Any Tweens that were currently running by this Timeline will be stopped. * @param loop Set to true if you do not want to reset the loop counters. Default false. */ reset(loop?: boolean): this; @@ -111821,6 +112808,8 @@ declare namespace Phaser { /** * Removes all events from this Timeline, resets the elapsed time to zero * and pauses the Timeline. + * + * Any Tweens that were currently running as a result of this Timeline will be stopped. */ clear(): this; @@ -111851,6 +112840,8 @@ declare namespace Phaser { * * This will remove all events from the Timeline and stop it from processing. * + * Any Tweens that were currently running as a result of this Timeline will be stopped. + * * This method is called automatically when the Scene shuts down, but you may * also call it directly should you need to destroy the Timeline earlier. */ @@ -113599,7 +114590,7 @@ declare namespace Phaser { * A function that returns what to set the target property to, * the moment the TweenData is invoked. * - * This is called when this TweenData is inititalised or reset. + * This is called when this TweenData is initialised or reset. */ getActiveValue: Phaser.Types.Tweens.GetActiveCallback | null; @@ -113690,7 +114681,7 @@ declare namespace Phaser { * at the conclusion of the Tween. * * TweenFrameData instances are typically created by the TweenBuilder automatically, when it - * detects the prescence of a 'texture' property as the key being tweened. + * detects the presence of a 'texture' property as the key being tweened. * * A Tween can own multiple TweenFrameData instances, but a TweenFrameData only * ever belongs to a single Tween. @@ -116094,11 +117085,6 @@ declare namespace Phaser { declare type WebGLContextCallback = (renderer: Phaser.Renderer.WebGL.WebGLRenderer)=>void; -/** - * Create temporary WebGL textures to stop WebGL errors on mac os - */ -declare function createTemporaryTextures(): void; - declare type EachListCallback = (item: I, ...args: any[])=>void; declare type EachMapCallback = (key: string, entry: E)=>boolean | null;