UNPKG

@ebutler/phaser3-types

Version:

A project to build and publish the type definitions for Phaser3 using their docs and source repos

1,088 lines (1,007 loc) 3.9 MB
declare type DataEachCallback = (parent: any, key: string, value: any, ...args: any[])=>void; declare type ContentLoadedCallback = ()=>void; declare namespace Phaser.GameObjects.BitmapText { namespace Types { /** * The font data for an individual character of a Bitmap Font. * * Describes the character's position, size, offset and kerning. */ type BitmapFontCharacterData = { /** * The x position of the character. */ x: number; /** * The y position of the character. */ y: number; /** * The width of the character. */ width: number; /** * The height of the character. */ height: number; /** * The center x position of the character. */ centerX: number; /** * The center y position of the character. */ centerY: number; /** * The x offset of the character. */ xOffset: number; /** * The y offset of the character. */ yOffset: number; /** * Extra data for the character. */ data: object; /** * Kerning values, keyed by character code. */ kerning: {[key: string]: number}; }; /** * Bitmap Font data that can be used by a BitmapText Game Object. */ type BitmapFontData = { /** * The name of the font. */ font: string; /** * The size of the font. */ size: number; /** * The line height of the font. */ lineHeight: number; /** * Whether this font is a retro font (monospace). */ retroFont: boolean; /** * The character data of the font, keyed by character code. Each character datum includes a position, size, offset and more. */ chars: {[key: number]: Phaser.GameObjects.BitmapText.Types.BitmapFontCharacterData}; }; type BitmapTextConfig = Phaser.GameObjects.Types.GameObjectConfig & { /** * The key of the font to use from the BitmapFont cache. */ font?: string; /** * The string, or array of strings, to be set as the content of this Bitmap Text. */ text?: string; /** * The font size to set. */ size?: number | false; }; type BitmapTextSize = { /** * The position and size of the BitmapText, taking into account the position and scale of the Game Object. */ global: Phaser.GameObjects.BitmapText.Types.GlobalBitmapTextSize; /** * The position and size of the BitmapText, taking just the font size into account. */ local: Phaser.GameObjects.BitmapText.Types.LocalBitmapTextSize; }; type DisplayCallbackConfig = { /** * The Dynamic Bitmap Text object that owns this character being rendered. */ parent: Phaser.GameObjects.DynamicBitmapText; /** * The tint of the character being rendered. Always zero in Canvas. */ tint: Phaser.GameObjects.BitmapText.Types.TintConfig; /** * The index of the character being rendered. */ index: number; /** * The character code of the character being rendered. */ charCode: number; /** * The x position of the character being rendered. */ x: number; /** * The y position of the character being rendered. */ y: number; /** * The scale of the character being rendered. */ scale: number; /** * The rotation of the character being rendered. */ rotation: number; /** * Custom data stored with the character being rendered. */ data: any; }; type DisplayCallback = (display: Phaser.GameObjects.BitmapText.Types.DisplayCallbackConfig)=>void; /** * The position and size of the Bitmap Text in global space, taking into account the Game Object's scale and world position. */ type GlobalBitmapTextSize = { /** * The x position of the BitmapText, taking into account the x position and scale of the Game Object. */ x: number; /** * The y position of the BitmapText, taking into account the y position and scale of the Game Object. */ y: number; /** * The width of the BitmapText, taking into account the x scale of the Game Object. */ width: number; /** * The height of the BitmapText, taking into account the y scale of the Game Object. */ height: number; }; type JSONBitmapText = Phaser.GameObjects.Types.JSONGameObject & { /** * The name of the font. */ font: string; /** * The text that this Bitmap Text displays. */ text: string; /** * The size of the font. */ fontSize: number; /** * Adds / Removes spacing between characters. */ letterSpacing: number; /** * The alignment of the text in a multi-line BitmapText object. */ align: integer; }; /** * The position and size of the Bitmap Text in local space, taking just the font size into account. */ type LocalBitmapTextSize = { /** * The x position of the BitmapText. */ x: number; /** * The y position of the BitmapText. */ y: number; /** * The width of the BitmapText. */ width: number; /** * The height of the BitmapText. */ height: number; }; type RetroFontConfig = { /** * The key of the image containing the font. */ image: string; /** * If the font set doesn't start at the top left of the given image, specify the X coordinate offset here. */ "offset.x": number; /** * If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here. */ "offset.y": number; /** * The width of each character in the font set. */ width: number; /** * The height of each character in the font set. */ height: number; /** * The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements. */ chars: string; /** * The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth. */ charsPerRow: number; /** * If the characters in the font set have horizontal spacing between them set the required amount here. */ "spacing.x": number; /** * If the characters in the font set have vertical spacing between them set the required amount here. */ "spacing.y": number; /** * The amount of vertical space to add to the line height of the font. */ lineSpacing: number; }; type TintConfig = { /** * The top left tint value. Always zero in canvas. */ topLeft: number; /** * The top right tint value. Always zero in canvas. */ topRight: number; /** * The bottom left tint value. Always zero in canvas. */ bottomLeft: number; /** * The bottom right tint value. Always zero in canvas. */ bottomRight: number; }; } } declare type CreateCallback = (bob: Phaser.GameObjects.Bob, index: integer)=>void; declare type EachContainerCallback<I> = (item: any, ...args: any[])=>void; declare namespace Phaser.GameObjects.Graphics { namespace Types { /** * Graphics fill style settings. */ type FillStyle = { /** * The fill color. */ color?: number; /** * The fill alpha. */ alpha?: number; }; /** * Graphics line style (or stroke style) settings. */ type LineStyle = { /** * The stroke width. */ width?: number; /** * The stroke color. */ color?: number; /** * The stroke alpha. */ alpha?: number; }; /** * Options for the Graphics game Object. */ type Options = Phaser.GameObjects.Graphics.Types.Styles & { /** * The x coordinate of the Graphics. */ x?: number; /** * The y coordinate of the Graphics. */ y?: number; }; type RoundedRectRadius = { /** * Top left */ tl?: number; /** * Top right */ tr?: number; /** * Bottom right */ br?: number; /** * Bottom left */ bl?: number; }; /** * Graphics style settings. */ type Styles = { /** * The style applied to shape outlines. */ lineStyle?: Phaser.GameObjects.Graphics.Types.LineStyle; /** * The style applied to shape areas. */ fillStyle?: Phaser.GameObjects.Graphics.Types.FillStyle; }; } } declare namespace Phaser.GameObjects.Group { namespace Types { type GroupCallback = (item: Phaser.GameObjects.GameObject)=>void; /** * A constructor function (class) that can be assigned to `classType`. */ type GroupClassTypeConstructor = (scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer)=>void; type GroupConfig = { /** * Sets {@link Phaser.GameObjects.Group#classType}. */ classType?: Phaser.GameObjects.Group.Types.GroupClassTypeConstructor; /** * Sets {@link Phaser.GameObjects.Group#active}. */ active?: boolean; /** * Sets {@link Phaser.GameObjects.Group#maxSize}. */ maxSize?: number; /** * Sets {@link Phaser.GameObjects.Group#defaultKey}. */ defaultKey?: string; /** * Sets {@link Phaser.GameObjects.Group#defaultFrame}. */ defaultFrame?: string | integer; /** * Sets {@link Phaser.GameObjects.Group#runChildUpdate}. */ runChildUpdate?: boolean; /** * Sets {@link Phaser.GameObjects.Group#createCallback}. */ createCallback?: Phaser.GameObjects.Group.Types.GroupCallback; /** * Sets {@link Phaser.GameObjects.Group#removeCallback}. */ removeCallback?: Phaser.GameObjects.Group.Types.GroupCallback; /** * Sets {@link Phaser.GameObjects.Group#createMultipleCallback}. */ createMultipleCallback?: Phaser.GameObjects.Group.Types.GroupMultipleCreateCallback; }; /** * The total number of objects created will be * * key.length * frame.length * frameQuantity * (yoyo ? 2 : 1) * (1 + repeat) * * In the simplest case, 1 + `repeat` objects will be created. * * If `max` is positive, then the total created will not exceed `max`. * * `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used. */ type GroupCreateConfig = { /** * The class of each new Game Object. */ classType?: Phaser.GameObjects.Group.Types.GroupClassTypeConstructor; /** * The texture key of each new Game Object. */ key?: string; /** * The texture frame of each new Game Object. */ frame?: string | integer; /** * The visible state of each new Game Object. */ visible?: boolean; /** * The active state of each new Game Object. */ active?: boolean; /** * The number of times each `key` × `frame` combination will be *repeated* (after the first combination). */ repeat?: number; /** * Select a `key` at random. */ randomKey?: boolean; /** * Select a `frame` at random. */ randomFrame?: boolean; /** * Select keys and frames by moving forward then backward through `key` and `frame`. */ yoyo?: boolean; /** * The number of times each `frame` should be combined with one `key`. */ frameQuantity?: number; /** * The maximum number of new Game Objects to create. 0 is no maximum. */ max?: number; setXY?: object; /** * The horizontal position of each new Game Object. */ "setXY.x"?: number; /** * The vertical position of each new Game Object. */ "setXY.y"?: number; /** * Increment each Game Object's horizontal position from the previous by this amount, starting from `setXY.x`. */ "setXY.stepX"?: number; /** * Increment each Game Object's vertical position from the previous by this amount, starting from `setXY.y`. */ "setXY.stepY"?: number; setRotation?: object; /** * Rotation of each new Game Object. */ "setRotation.value"?: number; /** * Increment each Game Object's rotation from the previous by this amount, starting at `setRotation.value`. */ "setRotation.step"?: number; setScale?: object; /** * The horizontal scale of each new Game Object. */ "setScale.x"?: number; /** * The vertical scale of each new Game Object. */ "setScale.y"?: number; /** * Increment each Game Object's horizontal scale from the previous by this amount, starting from `setScale.x`. */ "setScale.stepX"?: number; /** * Increment each Game object's vertical scale from the previous by this amount, starting from `setScale.y`. */ "setScale.stepY"?: number; setAlpha?: object; /** * The alpha value of each new Game Object. */ "setAlpha.value"?: number; /** * Increment each Game Object's alpha from the previous by this amount, starting from `setAlpha.value`. */ "setAlpha.step"?: number; /** * A geometric shape that defines the hit area for the Game Object. */ hitArea?: any; /** * A callback to be invoked when the Game Object is interacted with. */ hitAreaCallback?: Phaser.Input.Types.HitAreaCallback; /** * Align the new Game Objects in a grid using these settings. */ gridAlign?: false | Phaser.Actions.Types.GridAlignConfig; }; type GroupMultipleCreateCallback = (items: Phaser.GameObjects.GameObject[])=>void; } } declare type LightForEach = (light: Phaser.GameObjects.Light)=>void; declare namespace Phaser.GameObjects.PathFollower { namespace Types { /** * Settings for a PathFollower. */ type PathConfig = { /** * The duration of the path follow. */ duration: number; /** * The start position of the path follow, between 0 and 1. */ from: number; /** * The end position of the path follow, between 0 and 1. */ to: number; /** * Whether to position the PathFollower on the Path using its path offset. */ positionOnPath?: boolean; /** * Should the PathFollower automatically rotate to point in the direction of the Path? */ rotateToPath?: boolean; /** * If the PathFollower is rotating to match the Path, this value is added to the rotation value. This allows you to rotate objects to a path but control the angle of the rotation as well. */ rotationOffset?: number; /** * Current start position of the path follow, between 0 and 1. */ startAt?: number; }; } } declare namespace Phaser.GameObjects.RenderTexture { namespace Types { type RenderTextureConfig = { /** * The x coordinate of the RenderTextures position. */ x?: number; /** * The y coordinate of the RenderTextures position. */ y?: number; /** * The width of the RenderTexture. */ width?: number; /** * The height of the RenderTexture. */ height?: number; }; } } declare namespace Phaser.GameObjects.Sprite { namespace Types { type SpriteConfig = Phaser.GameObjects.Types.GameObjectConfig & { /** * The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. */ key?: string; /** * An optional frame from the Texture this Game Object is rendering with. */ frame?: number | string; }; } } /** * A custom function that will be responsible for wrapping the text. */ declare type TextStyleWordWrapCallback = (text: string, textObject: Phaser.GameObjects.Text)=>void; declare namespace Phaser.GameObjects.Text { namespace Types { /** * Font metrics for a Text Style object. */ type TextMetrics = { /** * The ascent of the font. */ ascent: number; /** * The descent of the font. */ descent: number; /** * The size of the font. */ fontSize: number; }; } } declare namespace Phaser.GameObjects.TileSprite { namespace Types { type TileSpriteConfig = Phaser.GameObjects.Types.GameObjectConfig & { /** * The x coordinate of the Tile Sprite. */ x?: number; /** * The y coordinate of the Tile Sprite. */ y?: number; /** * The width of the Tile Sprite. If zero it will use the size of the texture frame. */ width?: integer; /** * The height of the Tile Sprite. If zero it will use the size of the texture frame. */ height?: integer; /** * The key of the Texture this Tile Sprite will use to render with, as stored in the Texture Manager. */ key?: string; /** * An optional frame from the Texture this Tile Sprite is rendering with. */ frame?: string; }; } } declare type CenterFunction = (triangle: Phaser.Geom.Triangle)=>void; declare namespace Phaser { namespace Actions { /** * Takes an array of Game Objects, or any objects that have a public `angle` property, * and then adds the given value to each of their `angle` properties. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `Angle(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `angle` property. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function Angle<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of objects and passes each of them to the given callback. * @param items The array of items to be updated by this action. * @param callback The callback to be invoked. It will be passed just one argument: the item from the array. * @param context The scope in which the callback will be invoked. */ function Call<G extends Phaser.GameObjects.GameObject[]>(items: G, callback: Phaser.Actions.Types.CallCallback, context: any): G; /** * Takes an array of objects and returns the first element in the array that has properties which match * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` * then it would return the first item which had the property `scaleX` set to 0.5 and `alpha` set to 1. * * To use this with a Group: `GetFirst(group.getChildren(), compare, index)` * @param items The array of items to be searched by this action. * @param compare The comparison object. Each property in this object will be checked against the items of the array. * @param index An optional offset to start searching from within the items array. Default 0. */ function GetFirst<G extends Phaser.GameObjects.GameObject[]>(items: G, compare: object, index?: integer): object | Phaser.GameObjects.GameObject; /** * Takes an array of objects and returns the last element in the array that has properties which match * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` * then it would return the last item which had the property `scaleX` set to 0.5 and `alpha` set to 1. * * To use this with a Group: `GetLast(group.getChildren(), compare, index)` * @param items The array of items to be searched by this action. * @param compare The comparison object. Each property in this object will be checked against the items of the array. * @param index An optional offset to start searching from within the items array. Default 0. */ function GetLast<G extends Phaser.GameObjects.GameObject[]>(items: G, compare: object, index?: integer): object | Phaser.GameObjects.GameObject; /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, * and then aligns them based on the grid configuration given to this action. * @param items The array of items to be updated by this action. * @param options The GridAlign Configuration object. */ function GridAlign<G extends Phaser.GameObjects.GameObject[]>(items: G, options: Phaser.Actions.Types.GridAlignConfig): G; /** * Takes an array of Game Objects, or any objects that have a public `alpha` property, * and then adds the given value to each of their `alpha` properties. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `IncAlpha(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `alpha` property. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function IncAlpha<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have a public `x` property, * and then adds the given value to each of their `x` properties. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `IncX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `x` property. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function IncX<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, * and then adds the given value to each of them. * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. * * To use this with a Group: `IncXY(group.getChildren(), x, y, stepX, stepY)` * @param items The array of items to be updated by this action. * @param x The amount to be added to the `x` property. * @param y The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. Default x. * @param stepX This is added to the `x` amount, multiplied by the iteration counter. Default 0. * @param stepY This is added to the `y` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function IncXY<G extends Phaser.GameObjects.GameObject[]>(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have a public `y` property, * and then adds the given value to each of their `y` properties. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `IncY(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `y` property. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function IncY<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. * * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param circle The Circle to position the Game Objects on. * @param startAngle Optional angle to start position from, in radians. Default 0. * @param endAngle Optional angle to stop position at, in radians. Default 6.28. */ function PlaceOnCircle<G extends Phaser.GameObjects.GameObject[]>(items: G, circle: Phaser.Geom.Circle, startAngle?: number, endAngle?: number): G; /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of an Ellipse. * * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param ellipse The Ellipse to position the Game Objects on. * @param startAngle Optional angle to start position from, in radians. Default 0. * @param endAngle Optional angle to stop position at, in radians. Default 6.28. */ function PlaceOnEllipse<G extends Phaser.GameObjects.GameObject[]>(items: G, ellipse: Phaser.Geom.Ellipse, startAngle?: number, endAngle?: number): G; /** * Positions an array of Game Objects on evenly spaced points of a Line. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param line The Line to position the Game Objects on. */ function PlaceOnLine<G extends Phaser.GameObjects.GameObject[]>(items: G, line: Phaser.Geom.Line): G; /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. * * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. * If the `shift` parameter is given you can offset where placement begins. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param rect The Rectangle to position the Game Objects on. * @param shift An optional positional offset. Default 1. */ function PlaceOnRectangle<G extends Phaser.GameObjects.GameObject[]>(items: G, rect: Phaser.Geom.Rectangle, shift?: integer): G; /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. * * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param triangle The Triangle to position the Game Objects on. * @param stepRate An optional step rate, to increase or decrease the packing of the Game Objects on the lines. Default 1. */ function PlaceOnTriangle<G extends Phaser.GameObjects.GameObject[]>(items: G, triangle: Phaser.Geom.Triangle, stepRate?: number): G; /** * Play an animation with the given key, starting at the given startFrame on all Game Objects in items. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param key The name of the animation to play. * @param startFrame The starting frame of the animation with the given key. */ function PlayAnimation<G extends Phaser.GameObjects.GameObject[]>(items: G, key: string, startFrame?: string | integer): G; /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, * and then adds the given value to it. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `PropertyValueInc(group.getChildren(), key, value, step)` * @param items The array of items to be updated by this action. * @param key The property to be updated. * @param value The amount to be added to the property. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function PropertyValueInc<G extends Phaser.GameObjects.GameObject[]>(items: G, key: string, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, * and then sets it to the given value. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` * @param items The array of items to be updated by this action. * @param key The property to be updated. * @param value The amount to set the property to. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function PropertyValueSet<G extends Phaser.GameObjects.GameObject[]>(items: G, key: string, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects and positions them at random locations within the Circle. * * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param circle The Circle to position the Game Objects within. */ function RandomCircle<G extends Phaser.GameObjects.GameObject[]>(items: G, circle: Phaser.Geom.Circle): G; /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. * * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param ellipse The Ellipse to position the Game Objects within. */ function RandomEllipse<G extends Phaser.GameObjects.GameObject[]>(items: G, ellipse: Phaser.Geom.Ellipse): G; /** * Takes an array of Game Objects and positions them at random locations on the Line. * * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param line The Line to position the Game Objects randomly on. */ function RandomLine<G extends Phaser.GameObjects.GameObject[]>(items: G, line: Phaser.Geom.Line): G; /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param rect The Rectangle to position the Game Objects within. */ function RandomRectangle<G extends Phaser.GameObjects.GameObject[]>(items: G, rect: Phaser.Geom.Rectangle): G; /** * Takes an array of Game Objects and positions them at random locations within the Triangle. * * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param triangle The Triangle to position the Game Objects within. */ function RandomTriangle<G extends Phaser.GameObjects.GameObject[]>(items: G, triangle: Phaser.Geom.Triangle): G; /** * Takes an array of Game Objects, or any objects that have a public `rotation` property, * and then adds the given value to each of their `rotation` properties. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `Rotate(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `rotation` property (in radians). * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function Rotate<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Rotates each item around the given point by the given angle. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param point Any object with public `x` and `y` properties. * @param angle The angle to rotate by, in radians. */ function RotateAround<G extends Phaser.GameObjects.GameObject[]>(items: G, point: object, angle: number): G; /** * Rotates an array of Game Objects around a point by the given angle and distance. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param point Any object with public `x` and `y` properties. * @param angle The angle to rotate by, in radians. * @param distance The distance from the point of rotation in pixels. */ function RotateAroundDistance<G extends Phaser.GameObjects.GameObject[]>(items: G, point: object, angle: number, distance: number): G; /** * Takes an array of Game Objects, or any objects that have a public `scaleX` property, * and then adds the given value to each of their `scaleX` properties. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `ScaleX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `scaleX` property. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function ScaleX<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, * and then adds the given value to each of them. * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. * * To use this with a Group: `ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param scaleX The amount to be added to the `scaleX` property. * @param scaleY The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value. * @param stepX This is added to the `scaleX` amount, multiplied by the iteration counter. Default 0. * @param stepY This is added to the `y` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function ScaleXY<G extends Phaser.GameObjects.GameObject[]>(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have a public `scaleY` property, * and then adds the given value to each of their `scaleY` properties. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `ScaleY(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `scaleY` property. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function ScaleY<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have the public property `alpha` * and then sets it to the given value. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `SetAlpha(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function SetAlpha<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have the public property `blendMode` * and then sets it to the given value. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `SetBlendMode(group.getChildren(), value)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function SetBlendMode<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, index?: integer, direction?: integer): G; /** * Takes an array of Game Objects, or any objects that have the public property `depth` * and then sets it to the given value. * * The optional `step` property is applied incrementally, multiplied by each item in the array. * * To use this with a Group: `SetDepth(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ function SetDepth<G extends Phaser.GameObjects.GameObject[]>(items: G, value: number, step?: number, index?: integer, direction?: integer): G; /** * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. * @param hitAreaCallback A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. */ function SetHitArea<G extends Phaser.GameObjects.GameObject[]>(items: G, hitArea: any, hitAreaCallback: Phaser.Input.Types.HitAreaCallback): G; /** * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` * and then sets them to the given values. * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. * * To use this with a Group: `SetOrigin(group.getChildren(), originX, originY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param originX The amount to set the `originX` property to. * @param originY The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value. * @param stepX This is added to the `originX` amount, multiplied by the iteration counter. Default 0. * @param stepY This is added to the `originY` amount, mult