mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
3.70 TypeScript defs
This commit is contained in:
parent
450c8fcae0
commit
807b302ab2
2 changed files with 24442 additions and 21121 deletions
363
types/phaser.d.ts
vendored
363
types/phaser.d.ts
vendored
|
@ -5843,6 +5843,16 @@ declare namespace Phaser {
|
|||
*/
|
||||
readonly fps: Phaser.Types.Core.FPSConfig;
|
||||
|
||||
/**
|
||||
* Disables the automatic creation of the Pre FX Pipelines. If disabled, you cannot use the built-in Pre FX on Game Objects.
|
||||
*/
|
||||
readonly disablePreFX: boolean;
|
||||
|
||||
/**
|
||||
* Disables the automatic creation of the Post FX Pipelines. If disabled, you cannot use the built-in Post FX on Game Objects.
|
||||
*/
|
||||
readonly disablePostFX: boolean;
|
||||
|
||||
/**
|
||||
* An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances.
|
||||
*/
|
||||
|
@ -6197,6 +6207,14 @@ declare namespace Phaser {
|
|||
*/
|
||||
const STEP: string;
|
||||
|
||||
/**
|
||||
* This event is dispatched when the Scene Manager has created the System Scene,
|
||||
* which other plugins and systems may use to initialize themselves.
|
||||
*
|
||||
* This event is dispatched just once by the Game instance.
|
||||
*/
|
||||
const SYSTEM_READY: string;
|
||||
|
||||
/**
|
||||
* The Game Visible Event.
|
||||
*
|
||||
|
@ -7190,6 +7208,11 @@ declare namespace Phaser {
|
|||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The default number of divisions within a curve.
|
||||
*/
|
||||
defaultDivisions: number;
|
||||
|
||||
/**
|
||||
* The list of Curves which make up this Path.
|
||||
*/
|
||||
|
@ -7329,9 +7352,10 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* Get a sequence of points on the path.
|
||||
* @param divisions The number of divisions per resolution per curve. Default 12.
|
||||
* @param divisions The number of divisions to make per resolution per curve.
|
||||
* @param stepRate The curve distance between points per curve, implying `divisions`.
|
||||
*/
|
||||
getPoints(divisions?: number): Phaser.Math.Vector2[];
|
||||
getPoints(divisions?: number, stepRate?: number): Phaser.Math.Vector2[];
|
||||
|
||||
/**
|
||||
* Returns a randomly chosen point anywhere on the path. This follows the same rules as `getPoint` in that it may return a point on any Curve inside this path.
|
||||
|
@ -11803,7 +11827,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -13241,7 +13265,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -15995,7 +16019,7 @@ declare namespace Phaser {
|
|||
setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this;
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
/**
|
||||
|
@ -16432,10 +16456,10 @@ declare namespace Phaser {
|
|||
* @param y The y value.
|
||||
* @param xw The xw value.
|
||||
* @param yh The yh value.
|
||||
* @param roundPixels Pass the results via Math.round?
|
||||
* @param roundPixels Pass the results via Math.round? Default false.
|
||||
* @param quad Optional Float32Array to store the results in. Otherwises uses the local quad array.
|
||||
*/
|
||||
setQuad(x: number, y: number, xw: number, yh: number, roundPixels: boolean, quad?: Float32Array): Float32Array;
|
||||
setQuad(x: number, y: number, xw: number, yh: number, roundPixels?: boolean, quad?: Float32Array): Float32Array;
|
||||
|
||||
/**
|
||||
* Returns the X component of this matrix multiplied by the given values.
|
||||
|
@ -19265,7 +19289,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -23976,7 +24000,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -24507,6 +24531,33 @@ declare namespace Phaser {
|
|||
*/
|
||||
removeInteractive(): this;
|
||||
|
||||
/**
|
||||
* Adds the given Game Object, or array of Game Objects, to this Layer.
|
||||
*
|
||||
* Each Game Object must be unique within the Layer.
|
||||
* @param child The Game Object, or array of Game Objects, to add to the Layer.
|
||||
*/
|
||||
add<T extends Phaser.GameObjects.GameObject>(child: (T|T[])): this;
|
||||
|
||||
/**
|
||||
* Removes the given Game Object, or array of Game Objects, from this Layer.
|
||||
*
|
||||
* The Game Objects must already be children of this Layer.
|
||||
*
|
||||
* You can also optionally call `destroy` on each Game Object that is removed from the Layer.
|
||||
* @param child The Game Object, or array of Game Objects, to be removed from the Layer.
|
||||
* @param destroyChild Optionally call `destroy` on each child successfully removed from this Layer. Default false.
|
||||
*/
|
||||
remove<T extends Phaser.GameObjects.GameObject>(child: (T|T[]), destroyChild?: boolean): this;
|
||||
|
||||
/**
|
||||
* Removes all Game Objects from this Layer.
|
||||
*
|
||||
* You can also optionally call `destroy` on each Game Object that is removed from the Layer.
|
||||
* @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Layer. Default false.
|
||||
*/
|
||||
removeAll(destroyChild?: boolean): this;
|
||||
|
||||
/**
|
||||
* This callback is invoked when this Game Object is added to a Scene.
|
||||
*
|
||||
|
@ -26948,6 +26999,12 @@ declare namespace Phaser {
|
|||
* list, without incurring any additional overhead.
|
||||
*
|
||||
* As of Phaser 3.60 this Game Object is WebGL only.
|
||||
*
|
||||
* As of Phaser 2.61 this Game Object can now populate its values automatically
|
||||
* if they have been set within Texture Packer 7.1.0 or above and exported with
|
||||
* the atlas json. If this is the case, you can just call this method without
|
||||
* specifying anything more than the texture key and frame and it will pull the
|
||||
* area data from the atlas.
|
||||
*/
|
||||
class NineSlice extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, 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.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible {
|
||||
/**
|
||||
|
@ -27049,8 +27106,9 @@ declare namespace Phaser {
|
|||
* @param rightWidth The size of the right vertical column (B). Default 10.
|
||||
* @param topHeight The size of the top horiztonal row (C). Set to zero or undefined to create a 3 slice object. Default 0.
|
||||
* @param bottomHeight The size of the bottom horiztonal row (D). Set to zero or undefined to create a 3 slice object. Default 0.
|
||||
* @param skipScale9 If this Nine Slice was created from Texture Packer scale9 atlas data, set this property to use the given column sizes instead of those specified in the JSON. Default false.
|
||||
*/
|
||||
setSlices(width?: number, height?: number, leftWidth?: number, rightWidth?: number, topHeight?: number, bottomHeight?: number): this;
|
||||
setSlices(width?: number, height?: number, leftWidth?: number, rightWidth?: number, topHeight?: number, bottomHeight?: number, skipScale9?: boolean): this;
|
||||
|
||||
/**
|
||||
* Updates all of the vertice UV coordinates. This is called automatically
|
||||
|
@ -28048,7 +28106,7 @@ declare namespace Phaser {
|
|||
*
|
||||
* See the `ParticleEmitter` class for more details on emitter op configuration.
|
||||
*/
|
||||
class EmitterColorOp {
|
||||
class EmitterColorOp extends Phaser.GameObjects.Particles.EmitterOp {
|
||||
/**
|
||||
*
|
||||
* @param key The name of the property.
|
||||
|
@ -28131,7 +28189,7 @@ declare namespace Phaser {
|
|||
* @param defaultValue The default value of the property.
|
||||
* @param emitOnly Whether the property can only be modified when a Particle is emitted. Default false.
|
||||
*/
|
||||
constructor(key: string, defaultValue: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType, emitOnly?: boolean);
|
||||
constructor(key: string, defaultValue: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType, emitOnly?: boolean);
|
||||
|
||||
/**
|
||||
* The name of this property.
|
||||
|
@ -28144,7 +28202,7 @@ declare namespace Phaser {
|
|||
* This can be a simple value, an array, a function or an onEmit
|
||||
* configuration object.
|
||||
*/
|
||||
propertyValue: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType;
|
||||
propertyValue: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType;
|
||||
|
||||
/**
|
||||
* The default value of this property.
|
||||
|
@ -28152,7 +28210,7 @@ declare namespace Phaser {
|
|||
* This can be a simple value, an array, a function or an onEmit
|
||||
* configuration object.
|
||||
*/
|
||||
defaultValue: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType;
|
||||
defaultValue: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType;
|
||||
|
||||
/**
|
||||
* The number of steps for stepped easing between {@link Phaser.GameObjects.Particles.EmitterOp#start} and
|
||||
|
@ -28651,7 +28709,7 @@ declare namespace Phaser {
|
|||
/**
|
||||
* The data used by the ease equation.
|
||||
*/
|
||||
data: object;
|
||||
data: Phaser.Types.GameObjects.Particles.ParticleData;
|
||||
|
||||
/**
|
||||
* A reference to the Scene to which this Game Object belongs.
|
||||
|
@ -29201,7 +29259,7 @@ declare namespace Phaser {
|
|||
* Prior to Phaser v3.60 an Emitter could only have one single Emission Zone.
|
||||
* In 3.60 they can now have an array of Emission Zones.
|
||||
*/
|
||||
emitZones: Phaser.GameObjects.Particles.Zones.EdgeZone[] | Phaser.GameObjects.Particles.Zones.RandomZone[];
|
||||
emitZones: Phaser.Types.GameObjects.Particles.EmitZoneObject[];
|
||||
|
||||
/**
|
||||
* An array containing Particle Death Zone objects. A particle is immediately killed as soon as its x/y coordinates
|
||||
|
@ -29234,7 +29292,7 @@ declare namespace Phaser {
|
|||
/**
|
||||
* A Game Object whose position is used as the particle origin.
|
||||
*/
|
||||
follow: Phaser.GameObjects.GameObject | null;
|
||||
follow: Phaser.Types.Math.Vector2Like | null;
|
||||
|
||||
/**
|
||||
* The offset of the particle origin from the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target.
|
||||
|
@ -29346,12 +29404,12 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* Continuously moves the particle origin to follow a Game Object's position.
|
||||
* @param target The Game Object to follow.
|
||||
* @param target The Object to follow.
|
||||
* @param offsetX Horizontal offset of the particle origin from the Game Object. Default 0.
|
||||
* @param offsetY Vertical offset of the particle origin from the Game Object. Default 0.
|
||||
* @param trackVisible Whether the emitter's visible state will track the target's visible state. Default false.
|
||||
*/
|
||||
startFollow(target: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number, trackVisible?: boolean): this;
|
||||
startFollow(target: Phaser.Types.Math.Vector2Like, offsetX?: number, offsetY?: number, trackVisible?: boolean): this;
|
||||
|
||||
/**
|
||||
* Stops following a Game Object.
|
||||
|
@ -29516,7 +29574,7 @@ declare namespace Phaser {
|
|||
* to multiple Emitters.
|
||||
* @param config A Death Zone configuration object, a Death Zone instance, a valid Geometry object or an array of them.
|
||||
*/
|
||||
addDeathZone(config: Phaser.Types.GameObjects.Particles.DeathZoneObject | Phaser.Types.GameObjects.Particles.DeathZoneObject[]): Phaser.GameObjects.Particles.Zones.DeathZone;
|
||||
addDeathZone(config: Phaser.Types.GameObjects.Particles.DeathZoneObject | Phaser.Types.GameObjects.Particles.DeathZoneObject[]): Phaser.GameObjects.Particles.Zones.DeathZone[];
|
||||
|
||||
/**
|
||||
* Removes the given Particle Death Zone from this Emitter.
|
||||
|
@ -29542,7 +29600,7 @@ declare namespace Phaser {
|
|||
* An Emission Zone can only exist once within this Emitter.
|
||||
* @param zone An Emission Zone configuration object, a RandomZone or EdgeZone instance, or an array of them.
|
||||
*/
|
||||
addEmitZone(zone: Phaser.Types.GameObjects.Particles.EmitZoneObject | Phaser.Types.GameObjects.Particles.EmitZoneObject[]): Phaser.GameObjects.Particles.Zones.EdgeZone[] | Phaser.GameObjects.Particles.Zones.RandomZone[];
|
||||
addEmitZone(zone: Phaser.Types.GameObjects.Particles.EmitZoneData | Phaser.Types.GameObjects.Particles.EmitZoneData[]): Phaser.Types.GameObjects.Particles.EmitZoneObject[];
|
||||
|
||||
/**
|
||||
* Removes the given Particle Emission Zone from this Emitter.
|
||||
|
@ -30967,7 +31025,7 @@ declare namespace Phaser {
|
|||
* @param seamless Whether one endpoint will be removed if it's identical to the other. Default true.
|
||||
* @param total The total number of particles this zone will emit before passing over to the next emission zone in the Emitter. -1 means it will never pass over and you must use `setEmitZone` to change it. Default -1.
|
||||
*/
|
||||
constructor(source: Phaser.Types.GameObjects.Particles.EdgeZoneSource, quantity: number, stepRate: number, yoyo?: boolean, seamless?: boolean, total?: number);
|
||||
constructor(source: Phaser.Types.GameObjects.Particles.EdgeZoneSource, quantity: number, stepRate?: number, yoyo?: boolean, seamless?: boolean, total?: number);
|
||||
|
||||
/**
|
||||
* An object instance with a `getPoints(quantity, stepRate)` method returning an array of points.
|
||||
|
@ -32052,7 +32110,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -35623,7 +35681,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -49190,7 +49248,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -49671,20 +49729,20 @@ declare namespace Phaser {
|
|||
* See the [MDN fillStyle docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle) for more details.
|
||||
* @param color The text fill style. Can be any valid CanvasRenderingContext `fillStyle` value.
|
||||
*/
|
||||
setFill(color: string | any): this;
|
||||
setFill(color: string | CanvasGradient | CanvasPattern): this;
|
||||
|
||||
/**
|
||||
* Set the text fill color.
|
||||
* @param color The text fill color.
|
||||
*/
|
||||
setColor(color: string): this;
|
||||
setColor(color: string | CanvasGradient | CanvasPattern): this;
|
||||
|
||||
/**
|
||||
* Set the stroke settings.
|
||||
* @param color The stroke color.
|
||||
* @param thickness The stroke thickness.
|
||||
*/
|
||||
setStroke(color: string, thickness: number): this;
|
||||
setStroke(color: string | CanvasGradient | CanvasPattern, thickness: number): this;
|
||||
|
||||
/**
|
||||
* Set the shadow settings.
|
||||
|
@ -50689,7 +50747,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -50940,12 +50998,12 @@ declare namespace Phaser {
|
|||
/**
|
||||
* The text fill color.
|
||||
*/
|
||||
color: string;
|
||||
color: string | CanvasGradient | CanvasPattern;
|
||||
|
||||
/**
|
||||
* The text stroke color.
|
||||
*/
|
||||
stroke: string;
|
||||
stroke: string | CanvasGradient | CanvasPattern;
|
||||
|
||||
/**
|
||||
* The text stroke thickness.
|
||||
|
@ -51154,13 +51212,13 @@ declare namespace Phaser {
|
|||
* Set the text fill color.
|
||||
* @param color The text fill color.
|
||||
*/
|
||||
setFill(color: string): Phaser.GameObjects.Text;
|
||||
setFill(color: string | CanvasGradient | CanvasPattern): Phaser.GameObjects.Text;
|
||||
|
||||
/**
|
||||
* Set the text fill color.
|
||||
* @param color The text fill color.
|
||||
*/
|
||||
setColor(color: string): Phaser.GameObjects.Text;
|
||||
setColor(color: string | CanvasGradient | CanvasPattern): Phaser.GameObjects.Text;
|
||||
|
||||
/**
|
||||
* Set the resolution used by the Text object.
|
||||
|
@ -51178,7 +51236,7 @@ declare namespace Phaser {
|
|||
* @param color The stroke color.
|
||||
* @param thickness The stroke thickness.
|
||||
*/
|
||||
setStroke(color: string, thickness: number): Phaser.GameObjects.Text;
|
||||
setStroke(color: string | CanvasGradient | CanvasPattern, thickness: number): Phaser.GameObjects.Text;
|
||||
|
||||
/**
|
||||
* Set the shadow settings.
|
||||
|
@ -52290,7 +52348,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -54178,7 +54236,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -55953,6 +56011,13 @@ declare namespace Phaser {
|
|||
*/
|
||||
setTo(x1?: number, y1?: number, x2?: number, y2?: number): this;
|
||||
|
||||
/**
|
||||
* Sets this Line to match the x/y coordinates of the two given Vector2Like objects.
|
||||
* @param start Any object with public `x` and `y` properties, whose values will be assigned to the x1/y1 components of this Line.
|
||||
* @param end Any object with public `x` and `y` properties, whose values will be assigned to the x2/y2 components of this Line.
|
||||
*/
|
||||
setFromObjects(start: Phaser.Types.Math.Vector2Like, end: Phaser.Types.Math.Vector2Like): this;
|
||||
|
||||
/**
|
||||
* Returns a Vector2 object that corresponds to the start of this Line.
|
||||
* @param vec2 A Vector2 object to set the results in. If `undefined` a new Vector2 will be created.
|
||||
|
@ -70420,6 +70485,14 @@ declare namespace Phaser {
|
|||
* The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode.
|
||||
*/
|
||||
fullscreenTarget?: HTMLElement | string | null;
|
||||
/**
|
||||
* Disables the automatic creation of the Pre FX Pipelines. If disabled, you cannot use the built-in Pre FX on Game Objects.
|
||||
*/
|
||||
disablePreFX?: boolean;
|
||||
/**
|
||||
* Disables the automatic creation of the Post FX Pipelines. If disabled, you cannot use the built-in Post FX on Game Objects.
|
||||
*/
|
||||
disablePostFX?: boolean;
|
||||
};
|
||||
|
||||
type GamepadInputConfig = {
|
||||
|
@ -71900,7 +71973,7 @@ declare namespace Phaser {
|
|||
}
|
||||
|
||||
namespace Particles {
|
||||
type DeathZoneObject = Phaser.GameObjects.Particles.Zones.DeathZone | Phaser.Types.GameObjects.Particles.ParticleEmitterDeathZoneConfig | Phaser.Geom.Circle | Phaser.Geom.Ellipse | Phaser.Geom.Polygon | Phaser.Geom.Triangle;
|
||||
type DeathZoneObject = Phaser.GameObjects.Particles.Zones.DeathZone | Phaser.Types.GameObjects.Particles.ParticleEmitterDeathZoneConfig | Phaser.Types.GameObjects.Particles.DeathZoneSource;
|
||||
|
||||
type DeathZoneSource = {
|
||||
contains: Phaser.Types.GameObjects.Particles.DeathZoneSourceCallback;
|
||||
|
@ -71947,6 +72020,10 @@ declare namespace Phaser {
|
|||
* The ending value.
|
||||
*/
|
||||
end: number;
|
||||
/**
|
||||
* If true, the particle starts with a minimum random value between the start and end values.
|
||||
*/
|
||||
random?: boolean;
|
||||
/**
|
||||
* The ease to find. This can be either a string from the EaseMap, or a custom function.
|
||||
*/
|
||||
|
@ -71982,9 +72059,9 @@ declare namespace Phaser {
|
|||
/**
|
||||
* The returned value sets what the property will be at the START of the particle's life, on emit.
|
||||
*/
|
||||
type EmitterOpOnEmitCallback = (particle: Phaser.GameObjects.Particles.Particle, key: string, value: number)=>number;
|
||||
type EmitterOpOnEmitCallback = (particle?: Phaser.GameObjects.Particles.Particle, key?: string, value?: number)=>number;
|
||||
|
||||
type EmitterOpOnEmitType = number | number[] | Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback | Phaser.Types.GameObjects.Particles.EmitterOpRandomConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomMinMaxConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomStartEndConfig | Phaser.Types.GameObjects.Particles.EmitterOpSteppedConfig | Phaser.Types.GameObjects.Particles.EmitterOpCustomEmitConfig;
|
||||
type EmitterOpOnEmitType = number | number[] | Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback | Phaser.Types.GameObjects.Particles.EmitterOpRandomConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomMinMaxConfig | Phaser.Types.GameObjects.Particles.EmitterOpSteppedConfig | Phaser.Types.GameObjects.Particles.EmitterOpCustomEmitConfig;
|
||||
|
||||
/**
|
||||
* The returned value updates the property for the duration of the particle's life.
|
||||
|
@ -72015,24 +72092,10 @@ declare namespace Phaser {
|
|||
* The maximum value.
|
||||
*/
|
||||
max: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines an operation yielding a random value within a range.
|
||||
*/
|
||||
type EmitterOpRandomStartEndConfig = {
|
||||
/**
|
||||
* The starting value.
|
||||
* If true, only integers are selected from the range.
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The ending value.
|
||||
*/
|
||||
end: number;
|
||||
/**
|
||||
* If false, this becomes {@link EmitterOpEaseConfig}.
|
||||
*/
|
||||
random: boolean;
|
||||
int?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -72053,7 +72116,9 @@ declare namespace Phaser {
|
|||
steps: number;
|
||||
};
|
||||
|
||||
type EmitZoneObject = Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig | Phaser.GameObjects.Particles.Zones.EdgeZone | Phaser.GameObjects.Particles.Zones.RandomZone;
|
||||
type EmitZoneData = Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig | Phaser.GameObjects.Particles.Zones.EdgeZone | Phaser.GameObjects.Particles.Zones.RandomZone;
|
||||
|
||||
type EmitZoneObject = Phaser.GameObjects.Particles.Zones.EdgeZone | Phaser.GameObjects.Particles.Zones.RandomZone;
|
||||
|
||||
type GravityWellConfig = {
|
||||
/**
|
||||
|
@ -72080,6 +72145,34 @@ declare namespace Phaser {
|
|||
|
||||
type ParticleClassConstructor = (emitter: Phaser.GameObjects.Particles.ParticleEmitter)=>void;
|
||||
|
||||
type ParticleData = {
|
||||
tint?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
alpha?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
rotate?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
scaleX?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
scaleY?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
x?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
y?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
accelerationX?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
accelerationY?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
maxVelocityX?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
maxVelocityY?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
moveToX?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
moveToY?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
bounce?: Phaser.Types.GameObjects.Particles.ParticleDataValue;
|
||||
};
|
||||
|
||||
type ParticleDataValue = {
|
||||
/**
|
||||
* The minimum value.
|
||||
*/
|
||||
min: number;
|
||||
/**
|
||||
* The maximum value.
|
||||
*/
|
||||
max: number;
|
||||
};
|
||||
|
||||
type ParticleDeathCallback = (particle: Phaser.GameObjects.Particles.Particle)=>void;
|
||||
|
||||
type ParticleEmitterAnimConfig = {
|
||||
|
@ -72185,7 +72278,7 @@ declare namespace Phaser {
|
|||
/**
|
||||
* Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#follow}.
|
||||
*/
|
||||
follow?: Phaser.GameObjects.GameObject;
|
||||
follow?: Phaser.Types.Math.Vector2Like;
|
||||
/**
|
||||
* Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency}.
|
||||
*/
|
||||
|
@ -72341,7 +72434,7 @@ declare namespace Phaser {
|
|||
/**
|
||||
* As {@link Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone}.
|
||||
*/
|
||||
emitZone?: Phaser.Types.GameObjects.Particles.EmitZoneObject | Phaser.Types.GameObjects.Particles.EmitZoneObject[];
|
||||
emitZone?: Phaser.Types.GameObjects.Particles.EmitZoneData | Phaser.Types.GameObjects.Particles.EmitZoneData[];
|
||||
/**
|
||||
* As {@link Phaser.GameObjects.Particles.ParticleEmitter#setDeathZone}.
|
||||
*/
|
||||
|
@ -72351,17 +72444,9 @@ declare namespace Phaser {
|
|||
*/
|
||||
bounds?: Phaser.Types.GameObjects.Particles.ParticleEmitterBounds | Phaser.Types.GameObjects.Particles.ParticleEmitterBoundsAlt;
|
||||
/**
|
||||
* Assigns to {@link Phaser.GameObjects.Particles.ParticleEmitter#followOffset}.
|
||||
* Offset coordinates that assigns to {@link Phaser.GameObjects.Particles.ParticleEmitter#followOffset}.
|
||||
*/
|
||||
followOffset?: object;
|
||||
/**
|
||||
* x coordinate of the offset.
|
||||
*/
|
||||
"followOffset.x"?: number;
|
||||
/**
|
||||
* y coordinate of the offset.
|
||||
*/
|
||||
"followOffset.y"?: number;
|
||||
followOffset?: Phaser.Types.Math.Vector2Like;
|
||||
/**
|
||||
* Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#anims}.
|
||||
*/
|
||||
|
@ -72920,11 +73005,11 @@ declare namespace Phaser {
|
|||
/**
|
||||
* The color the Text is drawn in. Given as a CSS string color such as `#fff` or `rgb()`.
|
||||
*/
|
||||
color?: string;
|
||||
color?: string | CanvasGradient | CanvasPattern;
|
||||
/**
|
||||
* The color used to stroke the Text if the `strokeThickness` property is greater than zero.
|
||||
*/
|
||||
stroke?: string;
|
||||
stroke?: string | CanvasGradient | CanvasPattern;
|
||||
/**
|
||||
* The thickness of the stroke around the Text. Set to zero for no stroke.
|
||||
*/
|
||||
|
@ -73608,7 +73693,7 @@ declare namespace Phaser {
|
|||
*/
|
||||
pixelPerfect?: boolean;
|
||||
/**
|
||||
* If `pixelPerfect` is set, this is the alpha tolerance threshold value used in the callback.
|
||||
* If `pixelPerfect` is set, this is the alpha tolerance threshold value used in the callback. A value of 255 will match only fully opaque pixels.
|
||||
*/
|
||||
alphaTolerance?: number;
|
||||
};
|
||||
|
@ -77708,7 +77793,11 @@ declare namespace Phaser {
|
|||
*/
|
||||
time: number;
|
||||
/**
|
||||
* User-land callback which will be called when the Event fires if set.
|
||||
* User-land callback which will be called if set. If it returns `true` then this event run all of its actions, otherwise it will be skipped.
|
||||
*/
|
||||
if?: Function;
|
||||
/**
|
||||
* User-land callback which will be called when the Event fires.
|
||||
*/
|
||||
run?: Function;
|
||||
/**
|
||||
|
@ -79590,7 +79679,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -81445,7 +81534,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -87728,7 +87817,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -89792,7 +89881,7 @@ declare namespace Phaser {
|
|||
|
||||
/**
|
||||
* The tint value being applied to the whole of the Game Object.
|
||||
* This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.
|
||||
* Return `tintTopLeft` when read this tint property.
|
||||
*/
|
||||
tint: number;
|
||||
|
||||
|
@ -92482,7 +92571,11 @@ declare namespace Phaser {
|
|||
* * Vignette
|
||||
* * Wipe
|
||||
*
|
||||
* See the FX Controller class for more details.
|
||||
* These are added as part of the boot process.
|
||||
*
|
||||
* If you do not wish to add them, specify `disableFX: true` in your game config.
|
||||
*
|
||||
* See the FX Controller class for more details about each FX.
|
||||
*/
|
||||
postPipelineClasses: Phaser.Structs.Map<string, Class>;
|
||||
|
||||
|
@ -94266,7 +94359,9 @@ declare namespace Phaser {
|
|||
* The default shader uniforms for this pipeline are:
|
||||
*
|
||||
* `uProjectionMatrix` (mat4)
|
||||
* `uMainSampler` (sampler2D)
|
||||
* `uRoundPixels` (int)
|
||||
* `uResolution` (vec2)
|
||||
* `uMainSampler` (sampler2D, or sampler2D array)
|
||||
*/
|
||||
class MobilePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline {
|
||||
/**
|
||||
|
@ -94311,7 +94406,9 @@ declare namespace Phaser {
|
|||
* The default shader uniforms for this pipeline are:
|
||||
*
|
||||
* `uProjectionMatrix` (mat4)
|
||||
* `uMainSampler` (sampler2D array)
|
||||
* `uRoundPixels` (int)
|
||||
* `uResolution` (vec2)
|
||||
* `uMainSampler` (sampler2D, or sampler2D array)
|
||||
*
|
||||
* If you wish to create a custom pipeline extending from this one, you can use two string
|
||||
* declarations in your fragment shader source: `%count%` and `%forloop%`, where `count` is
|
||||
|
@ -94432,9 +94529,10 @@ declare namespace Phaser {
|
|||
* @param camera Current used camera.
|
||||
* @param parentTransformMatrix Parent container.
|
||||
* @param skipFlip Skip the renderTexture check. Default false.
|
||||
* @param textureUnit Use the currently bound texture unit?
|
||||
* @param textureUnit The texture unit to set (defaults to currently bound if undefined or null)
|
||||
* @param skipPrePost Skip the pre and post manager calls? Default false.
|
||||
*/
|
||||
batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number): void;
|
||||
batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number, skipPrePost?: boolean): void;
|
||||
|
||||
/**
|
||||
* Adds a Texture Frame into the batch for rendering.
|
||||
|
@ -94752,6 +94850,29 @@ declare namespace Phaser {
|
|||
*/
|
||||
halfFrame2: Phaser.Renderer.WebGL.RenderTarget;
|
||||
|
||||
/**
|
||||
* This method is called once, when this Post FX Pipeline needs to be used.
|
||||
*
|
||||
* Normally, pipelines will boot automatically, ready for instant-use, but Post FX
|
||||
* Pipelines create quite a lot of internal resources, such as Render Targets, so
|
||||
* they don't boot until they are told to do so by the Pipeline Manager, when an
|
||||
* actual Game Object needs to use them.
|
||||
*/
|
||||
bootFX(): void;
|
||||
|
||||
/**
|
||||
* This method is called as a result of the `WebGLPipeline.batchQuad` method, right after a quad
|
||||
* belonging to a Game Object has been added to the batch. When this is called, the
|
||||
* renderer has just performed a flush.
|
||||
*
|
||||
* It calls the `onDraw` hook followed by the `onPostBatch` hook, which can be used to perform
|
||||
* additional Post FX Pipeline processing.
|
||||
*
|
||||
* It is also called as part of the `PipelineManager.postBatch` method when processing Post FX Pipelines.
|
||||
* @param gameObject The Game Object or Camera that invoked this pipeline, if any.
|
||||
*/
|
||||
postBatch(gameObject?: Phaser.GameObjects.GameObject | Phaser.Cameras.Scene2D.Camera): this;
|
||||
|
||||
/**
|
||||
* Returns the FX Controller for this Post FX Pipeline.
|
||||
*
|
||||
|
@ -95224,7 +95345,9 @@ declare namespace Phaser {
|
|||
* The default shader uniforms for this pipeline are:
|
||||
*
|
||||
* `uProjectionMatrix` (mat4)
|
||||
* `uMainSampler` (sampler2D array)
|
||||
* `uRoundPixels` (int)
|
||||
* `uResolution` (vec2)
|
||||
* `uMainSampler` (sampler2D, or sampler2D array)
|
||||
*
|
||||
* The pipeline is structurally identical to the Multi Pipeline and should be treated as such.
|
||||
*/
|
||||
|
@ -95259,7 +95382,9 @@ declare namespace Phaser {
|
|||
* The default shader uniforms for this pipeline are:
|
||||
*
|
||||
* `uProjectionMatrix` (mat4)
|
||||
* `uMainSampler` (sampler2D)
|
||||
* `uRoundPixels` (int)
|
||||
* `uResolution` (vec2)
|
||||
* `uMainSampler` (sampler2D, or sampler2D array)
|
||||
*/
|
||||
class SinglePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline {
|
||||
/**
|
||||
|
@ -95658,6 +95783,14 @@ declare namespace Phaser {
|
|||
*/
|
||||
resize(width: number, height: number): this;
|
||||
|
||||
/**
|
||||
* Checks if this Render Target will resize, or not, if given the new
|
||||
* width and height values.
|
||||
* @param width The new width of this Render Target.
|
||||
* @param height The new height of this Render Target.
|
||||
*/
|
||||
willResize(width: number, height: number): boolean;
|
||||
|
||||
/**
|
||||
* Pushes this Render Target as the current frame buffer of the renderer.
|
||||
*
|
||||
|
@ -102677,7 +102810,7 @@ declare namespace Phaser {
|
|||
* @param child The item, or array of items, to add to the list.
|
||||
* @param skipCallback Skip calling the List.addCallback if this child is added successfully. Default false.
|
||||
*/
|
||||
add(child: T, skipCallback?: boolean): T;
|
||||
add(child: any | any[], skipCallback?: boolean): any;
|
||||
|
||||
/**
|
||||
* Adds an item to list, starting at a specified index. Each item must be unique within the list.
|
||||
|
@ -102685,7 +102818,7 @@ declare namespace Phaser {
|
|||
* @param index The index in the list at which the element(s) will be inserted. Default 0.
|
||||
* @param skipCallback Skip calling the List.addCallback if this child is added successfully. Default false.
|
||||
*/
|
||||
addAt(child: T, index?: number, skipCallback?: boolean): T;
|
||||
addAt(child: (T|T[]), index?: number, skipCallback?: boolean): (T|T[]);
|
||||
|
||||
/**
|
||||
* Retrieves the item at a given position inside the List.
|
||||
|
@ -102792,7 +102925,7 @@ declare namespace Phaser {
|
|||
* @param child The item, or array of items, to remove.
|
||||
* @param skipCallback Skip calling the List.removeCallback. Default false.
|
||||
*/
|
||||
remove(child: T, skipCallback?: boolean): T;
|
||||
remove(child: any, skipCallback?: boolean): any;
|
||||
|
||||
/**
|
||||
* Removes the item at the given position in the List.
|
||||
|
@ -102813,7 +102946,7 @@ declare namespace Phaser {
|
|||
* Removes all the items.
|
||||
* @param skipCallback Skip calling the List.removeCallback. Default false.
|
||||
*/
|
||||
removeAll(skipCallback?: boolean): Phaser.Structs.List<T>;
|
||||
removeAll(skipCallback?: boolean): this;
|
||||
|
||||
/**
|
||||
* Brings the given child to the top of this List.
|
||||
|
@ -102948,9 +103081,20 @@ declare namespace Phaser {
|
|||
*/
|
||||
size: number;
|
||||
|
||||
/**
|
||||
* Adds all the elements in the given array to this Map.
|
||||
*
|
||||
* If the element already exists, the value will be skipped.
|
||||
* @param elements An array of key-value pairs to populate this Map with.
|
||||
*/
|
||||
setAll<K, V>(elements: V[]): this;
|
||||
|
||||
/**
|
||||
* Adds an element with a specified `key` and `value` to this Map.
|
||||
*
|
||||
* If the `key` already exists, the value will be replaced.
|
||||
*
|
||||
* If you wish to add multiple elements in a single call, use the `setAll` method instead.
|
||||
* @param key The key of the element to be added to this Map.
|
||||
* @param value The value of the element to be added to this Map.
|
||||
*/
|
||||
|
@ -104703,6 +104847,19 @@ declare namespace Phaser {
|
|||
*/
|
||||
setTrim(actualWidth: number, actualHeight: number, destX: number, destY: number, destWidth: number, destHeight: number): this;
|
||||
|
||||
/**
|
||||
* Sets the scale9 center rectangle values.
|
||||
*
|
||||
* Scale9 is a feature of Texture Packer, allowing you to define a nine-slice scaling grid.
|
||||
*
|
||||
* This is set automatically by the JSONArray and JSONHash parsers.
|
||||
* @param x The left coordinate of the center scale9 rectangle.
|
||||
* @param y The top coordinate of the center scale9 rectangle.
|
||||
* @param width The width of the center scale9 rectangle.
|
||||
* @param height The height coordinate of the center scale9 rectangle.
|
||||
*/
|
||||
setScale9(x: number, y: number, width: number, height: number): this;
|
||||
|
||||
/**
|
||||
* Takes a crop data object and, based on the rectangular region given, calculates the
|
||||
* required UV coordinates in order to crop this Frame for WebGL and Canvas rendering.
|
||||
|
@ -104784,6 +104941,16 @@ declare namespace Phaser {
|
|||
*/
|
||||
readonly trimmed: boolean;
|
||||
|
||||
/**
|
||||
* Does the Frame have scale9 border data?
|
||||
*/
|
||||
readonly scale9: boolean;
|
||||
|
||||
/**
|
||||
* If the Frame has scale9 border data, is it 3-slice or 9-slice data?
|
||||
*/
|
||||
readonly is3Slice: boolean;
|
||||
|
||||
/**
|
||||
* The Canvas drawImage data object.
|
||||
*/
|
||||
|
@ -110765,6 +110932,24 @@ declare namespace Phaser {
|
|||
|
||||
}
|
||||
|
||||
namespace Events {
|
||||
/**
|
||||
* The Timeline Complete Event.
|
||||
*
|
||||
* This event is dispatched by timeline when all timeline events complete.
|
||||
*
|
||||
* Listen to it from a Timeline instance using `Timeline.on('complete', listener)`, i.e.:
|
||||
*
|
||||
* ```javascript
|
||||
* const timeline = this.add.timeline();
|
||||
* timeline.on('complete', listener);
|
||||
* timeline.play();
|
||||
* ```
|
||||
*/
|
||||
const COMPLETE: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A Timeline is a way to schedule events to happen at specific times in the future.
|
||||
*
|
||||
|
@ -110943,6 +111128,8 @@ declare namespace Phaser {
|
|||
* If the Timeline is paused while processing the current game step, then it
|
||||
* will carry on with all events that are due to run during that step and pause
|
||||
* from the next game step.
|
||||
*
|
||||
* Note that if any Tweens have been started prior to calling this method, they will **not** be paused as well.
|
||||
*/
|
||||
pause(): this;
|
||||
|
||||
|
@ -113576,7 +113763,7 @@ declare namespace Phaser {
|
|||
* @param startIndex An optional start index. Default 0.
|
||||
* @param length An optional length, the total number of elements (from the startIndex) to choose from. Default array.length.
|
||||
*/
|
||||
function GetRandom(array: any[], startIndex?: number, length?: number): any;
|
||||
function GetRandom<T>(array: T[], startIndex?: number, length?: number): T;
|
||||
|
||||
namespace Matrix {
|
||||
/**
|
||||
|
|
45200
types/phaser.json
45200
types/phaser.json
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue