- Source: src/actions/index.js (Line 7)
Methods
-
<static> AlignTo(items, position [, offsetX] [, offsetY])
-
Takes an array of Game Objects, or any objects that have public
xandyproperties, and aligns them next to each other.The first item isn't moved. The second item is aligned next to the first, then the third next to the second, and so on.
Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
positionnumber The position to align the items with. This is an align constant, such as
Phaser.Display.Align.LEFT_CENTER.offsetXnumber <optional>
0 Optional horizontal offset from the position.
offsetYnumber <optional>
0 Optional vertical offset from the position.
- Since: 3.22.0
- Source: src/actions/AlignTo.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> Angle(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have a public
angleproperty, and then adds the given value to each of theirangleproperties.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
Angle(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to be added to the
angleproperty.stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/Angle.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> Call(items, callback, context)
-
Takes an array of objects and passes each of them to the given callback.
Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
callbackPhaser.Types.Actions.CallCallback The callback to be invoked. It will be passed just one argument: the item from the array.
context* The scope in which the callback will be invoked.
- Since: 3.0.0
- Source: src/actions/Call.js (Line 7)
Returns:
The array of objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> GetFirst(items, compare [, index])
-
Takes an array of objects and returns the first element in the array that has properties which match all of those specified in the
compareobject. For example, if the compare object was:{ scaleX: 0.5, alpha: 1 }then it would return the first item which had the propertyscaleXset to 0.5 andalphaset to 1.To use this with a Group:
GetFirst(group.getChildren(), compare, index)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be searched by this action.
compareobject The comparison object. Each property in this object will be checked against the items of the array.
indexnumber <optional>
0 An optional offset to start searching from within the items array.
- Since: 3.0.0
- Source: src/actions/GetFirst.js (Line 7)
Returns:
The first object in the array that matches the comparison object, or
nullif no match was found.- Type
- object | Phaser.GameObjects.GameObject
-
<static> GetLast(items, compare [, index])
-
Takes an array of objects and returns the last element in the array that has properties which match all of those specified in the
compareobject. For example, if the compare object was:{ scaleX: 0.5, alpha: 1 }then it would return the last item which had the propertyscaleXset to 0.5 andalphaset to 1.To use this with a Group:
GetLast(group.getChildren(), compare, index)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be searched by this action.
compareobject The comparison object. Each property in this object will be checked against the items of the array.
indexnumber <optional>
0 An optional offset to start searching from within the items array.
- Since: 3.3.0
- Source: src/actions/GetLast.js (Line 7)
Returns:
The last object in the array that matches the comparison object, or
nullif no match was found.- Type
- object | Phaser.GameObjects.GameObject
-
<static> GridAlign(items, options)
-
Takes an array of Game Objects, or any objects that have public
xandyproperties, and then aligns them based on the grid configuration given to this action.Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
optionsPhaser.Types.Actions.GridAlignConfig The GridAlign Configuration object.
- Since: 3.0.0
- Source: src/actions/GridAlign.js (Line 15)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> IncAlpha(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have a public
alphaproperty, and then adds the given value to each of theiralphaproperties.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
IncAlpha(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to be added to the
alphaproperty.stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/IncAlpha.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> IncX(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have a public
xproperty, and then adds the given value to each of theirxproperties.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
IncX(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to be added to the
xproperty.stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/IncX.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> IncXY(items, x [, y] [, stepX] [, stepY] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have public
xandyproperties, and then adds the given value to each of them.The optional
stepXandstepYproperties are applied incrementally, multiplied by each item in the array.To use this with a Group:
IncXY(group.getChildren(), x, y, stepX, stepY)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
xnumber The amount to be added to the
xproperty.ynumber <optional>
x The amount to be added to the
yproperty. Ifundefinedornullit uses thexvalue.stepXnumber <optional>
0 This is added to the
xamount, multiplied by the iteration counter.stepYnumber <optional>
0 This is added to the
yamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/IncXY.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> IncY(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have a public
yproperty, and then adds the given value to each of theiryproperties.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
IncY(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to be added to the
yproperty.stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/IncY.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> PlaceOnCircle(items, circle [, startAngle] [, endAngle])
-
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.CircleShape to this function, you should pass itsgeomproperty.Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
circlePhaser.Geom.Circle The Circle to position the Game Objects on.
startAnglenumber <optional>
0 Optional angle to start position from, in radians.
endAnglenumber <optional>
6.28 Optional angle to stop position at, in radians.
- Since: 3.0.0
- Source: src/actions/PlaceOnCircle.js (Line 7)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> PlaceOnEllipse(items, ellipse [, startAngle] [, endAngle])
-
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.EllipseShape to this function, you should pass itsgeomproperty.Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
ellipsePhaser.Geom.Ellipse The Ellipse to position the Game Objects on.
startAnglenumber <optional>
0 Optional angle to start position from, in radians.
endAnglenumber <optional>
6.28 Optional angle to stop position at, in radians.
- Since: 3.0.0
- Source: src/actions/PlaceOnEllipse.js (Line 7)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> PlaceOnLine(items, line)
-
Positions an array of Game Objects on evenly spaced points of a Line.
Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
linePhaser.Geom.Line The Line to position the Game Objects on.
- Since: 3.0.0
- Source: src/actions/PlaceOnLine.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> PlaceOnRectangle(items, rect [, shift])
-
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
shiftparameter is given you can offset where placement begins.Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
rectPhaser.Geom.Rectangle The Rectangle to position the Game Objects on.
shiftnumber <optional>
1 An optional positional offset.
- Since: 3.0.0
- Source: src/actions/PlaceOnRectangle.js (Line 11)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> PlaceOnTriangle(items, triangle [, stepRate])
-
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.TriangleShape to this function, you should pass itsgeomproperty.Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
trianglePhaser.Geom.Triangle The Triangle to position the Game Objects on.
stepRatenumber <optional>
1 An optional step rate, to increase or decrease the packing of the Game Objects on the lines.
- Since: 3.0.0
- Source: src/actions/PlaceOnTriangle.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> PlayAnimation(items, key [, startFrame])
-
Play an animation with the given key, starting at the given startFrame on all Game Objects in items.
Parameters:
Name Type Argument Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
keystring The name of the animation to play.
startFramestring | number <optional>
The starting frame of the animation with the given key.
- Since: 3.0.0
- Source: src/actions/PlayAnimation.js (Line 7)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> PropertyValueInc(items, key, value [, step] [, index] [, direction])
-
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
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
PropertyValueInc(group.getChildren(), key, value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
keystring The property to be updated.
valuenumber The amount to be added to the property.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.3.0
- Source: src/actions/PropertyValueInc.js (Line 7)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> PropertyValueSet(items, key, value [, step] [, index] [, direction])
-
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
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
PropertyValueSet(group.getChildren(), key, value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
keystring The property to be updated.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.3.0
- Source: src/actions/PropertyValueSet.js (Line 7)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> RandomCircle(items, circle)
-
Takes an array of Game Objects and positions them at random locations within the Circle.
If you wish to pass a
Phaser.GameObjects.CircleShape to this function, you should pass itsgeomproperty.Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
circlePhaser.Geom.Circle The Circle to position the Game Objects within.
- Since: 3.0.0
- Source: src/actions/RandomCircle.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> RandomEllipse(items, ellipse)
-
Takes an array of Game Objects and positions them at random locations within the Ellipse.
If you wish to pass a
Phaser.GameObjects.EllipseShape to this function, you should pass itsgeomproperty.Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
ellipsePhaser.Geom.Ellipse The Ellipse to position the Game Objects within.
- Since: 3.0.0
- Source: src/actions/RandomEllipse.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> RandomLine(items, line)
-
Takes an array of Game Objects and positions them at random locations on the Line.
If you wish to pass a
Phaser.GameObjects.LineShape to this function, you should pass itsgeomproperty.Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
linePhaser.Geom.Line The Line to position the Game Objects randomly on.
- Since: 3.0.0
- Source: src/actions/RandomLine.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> RandomRectangle(items, rect)
-
Takes an array of Game Objects and positions them at random locations within the Rectangle.
Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
rectPhaser.Geom.Rectangle The Rectangle to position the Game Objects within.
- Since: 3.0.0
- Source: src/actions/RandomRectangle.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> RandomTriangle(items, triangle)
-
Takes an array of Game Objects and positions them at random locations within the Triangle.
If you wish to pass a
Phaser.GameObjects.TriangleShape to this function, you should pass itsgeomproperty.Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
trianglePhaser.Geom.Triangle The Triangle to position the Game Objects within.
- Since: 3.0.0
- Source: src/actions/RandomTriangle.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> Rotate(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have a public
rotationproperty, and then adds the given value to each of theirrotationproperties.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
Rotate(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to be added to the
rotationproperty (in radians).stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/Rotate.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> RotateAround(items, point, angle)
-
Rotates each item around the given point by the given angle.
Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
pointobject Any object with public
xandyproperties.anglenumber The angle to rotate by, in radians.
- Since: 3.0.0
- Source: src/actions/RotateAround.js (Line 10)
- See:
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> RotateAroundDistance(items, point, angle, distance)
-
Rotates an array of Game Objects around a point by the given angle and distance.
Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
pointobject Any object with public
xandyproperties.anglenumber The angle to rotate by, in radians.
distancenumber The distance from the point of rotation in pixels.
- Since: 3.0.0
- Source: src/actions/RotateAroundDistance.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> ScaleX(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have a public
scaleXproperty, and then adds the given value to each of theirscaleXproperties.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
ScaleX(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to be added to the
scaleXproperty.stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/ScaleX.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> ScaleXY(items, scaleX [, scaleY] [, stepX] [, stepY] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have public
scaleXandscaleYproperties, and then adds the given value to each of them.The optional
stepXandstepYproperties are applied incrementally, multiplied by each item in the array.To use this with a Group:
ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
scaleXnumber The amount to be added to the
scaleXproperty.scaleYnumber <optional>
The amount to be added to the
scaleYproperty. Ifundefinedornullit uses thescaleXvalue.stepXnumber <optional>
0 This is added to the
scaleXamount, multiplied by the iteration counter.stepYnumber <optional>
0 This is added to the
scaleYamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/ScaleXY.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> ScaleY(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have a public
scaleYproperty, and then adds the given value to each of theirscaleYproperties.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
ScaleY(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to be added to the
scaleYproperty.stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/ScaleY.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetAlpha(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
alphaand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetAlpha(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetAlpha.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetBlendMode(items, value [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
blendModeand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetBlendMode(group.getChildren(), value)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetBlendMode.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetDepth(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
depthand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetDepth(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetDepth.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetHitArea(items, hitArea, hitAreaCallback)
-
Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks.
Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
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.
hitAreaCallbackPhaser.Types.Input.HitAreaCallback A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.
- Since: 3.0.0
- Source: src/actions/SetHitArea.js (Line 7)
- See:
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetOrigin(items, originX [, originY] [, stepX] [, stepY] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public properties
originXandoriginYand then sets them to the given values.The optional
stepXandstepYproperties are applied incrementally, multiplied by each item in the array.To use this with a Group:
SetOrigin(group.getChildren(), originX, originY, stepX, stepY)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
originXnumber The amount to set the
originXproperty to.originYnumber <optional>
The amount to set the
originYproperty to. Ifundefinedornullit uses theoriginXvalue.stepXnumber <optional>
0 This is added to the
originXamount, multiplied by the iteration counter.stepYnumber <optional>
0 This is added to the
originYamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetOrigin.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetRotation(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
rotationand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetRotation(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetRotation.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetScale(items, scaleX [, scaleY] [, stepX] [, stepY] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public properties
scaleXandscaleYand then sets them to the given values.The optional
stepXandstepYproperties are applied incrementally, multiplied by each item in the array.To use this with a Group:
SetScale(group.getChildren(), scaleX, scaleY, stepX, stepY)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
scaleXnumber The amount to set the
scaleXproperty to.scaleYnumber <optional>
The amount to set the
scaleYproperty to. Ifundefinedornullit uses thescaleXvalue.stepXnumber <optional>
0 This is added to the
scaleXamount, multiplied by the iteration counter.stepYnumber <optional>
0 This is added to the
scaleYamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetScale.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetScaleX(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
scaleXand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetScaleX(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetScaleX.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetScaleY(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
scaleYand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetScaleY(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetScaleY.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetScrollFactor(items, scrollFactorX [, scrollFactorY] [, stepX] [, stepY] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public properties
scrollFactorXandscrollFactorYand then sets them to the given values.The optional
stepXandstepYproperties are applied incrementally, multiplied by each item in the array.To use this with a Group:
SetScrollFactor(group.getChildren(), scrollFactorX, scrollFactorY, stepX, stepY)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
scrollFactorXnumber The amount to set the
scrollFactorXproperty to.scrollFactorYnumber <optional>
The amount to set the
scrollFactorYproperty to. Ifundefinedornullit uses thescrollFactorXvalue.stepXnumber <optional>
0 This is added to the
scrollFactorXamount, multiplied by the iteration counter.stepYnumber <optional>
0 This is added to the
scrollFactorYamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.21.0
- Source: src/actions/SetScrollFactor.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetScrollFactorX(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
scrollFactorXand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetScrollFactorX(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.21.0
- Source: src/actions/SetScrollFactorX.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetScrollFactorY(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
scrollFactorYand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetScrollFactorY(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.21.0
- Source: src/actions/SetScrollFactorY.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetTint(items, topLeft [, topRight] [, bottomLeft] [, bottomRight])
-
Takes an array of Game Objects, or any objects that have the public method setTint() and then updates it to the given value(s). You can specify tint color per corner or provide only one color value for
topLeftparameter, in which case whole item will be tinted with that color.Parameters:
Name Type Argument Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
topLeftnumber The tint being applied to top-left corner of item. If other parameters are given no value, this tint will be applied to whole item.
topRightnumber <optional>
The tint to be applied to top-right corner of item.
bottomLeftnumber <optional>
The tint to be applied to the bottom-left corner of item.
bottomRightnumber <optional>
The tint to be applied to the bottom-right corner of item.
- Since: 3.0.0
- Source: src/actions/SetTint.js (Line 7)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetVisible(items, value [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
visibleand then sets it to the given value.To use this with a Group:
SetVisible(group.getChildren(), value)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valueboolean The value to set the property to.
indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetVisible.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetX(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
xand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetX(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetX.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetXY(items, x [, y] [, stepX] [, stepY] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public properties
xandyand then sets them to the given values.The optional
stepXandstepYproperties are applied incrementally, multiplied by each item in the array.To use this with a Group:
SetXY(group.getChildren(), x, y, stepX, stepY)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
xnumber The amount to set the
xproperty to.ynumber <optional>
x The amount to set the
yproperty to. Ifundefinedornullit uses thexvalue.stepXnumber <optional>
0 This is added to the
xamount, multiplied by the iteration counter.stepYnumber <optional>
0 This is added to the
yamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetXY.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SetY(items, value [, step] [, index] [, direction])
-
Takes an array of Game Objects, or any objects that have the public property
yand then sets it to the given value.The optional
stepproperty is applied incrementally, multiplied by each item in the array.To use this with a Group:
SetY(group.getChildren(), value, step)Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> The array of items to be updated by this action.
valuenumber The amount to set the property to.
stepnumber <optional>
0 This is added to the
valueamount, multiplied by the iteration counter.indexnumber <optional>
0 An optional offset to start searching from within the items array.
directionnumber <optional>
1 The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.
- Since: 3.0.0
- Source: src/actions/SetY.js (Line 9)
Returns:
The array of objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> ShiftPosition(items, x, y [, direction] [, output])
-
Iterate through the items array changing the position of each element to be that of the element that came before it in the array (or after it if direction = 1)
The first items position is set to x/y.
The final x/y coords are returned
Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
xnumber The x coordinate to place the first item in the array at.
ynumber The y coordinate to place the first item in the array at.
directionnumber <optional>
0 The iteration direction. 0 = first to last and 1 = last to first.
outputPhaser.Math.Vector2 | object <optional>
An optional objec to store the final objects position in.
- Since: 3.0.0
- Source: src/actions/ShiftPosition.js (Line 9)
Returns:
The output vector.
- Type
- Phaser.Math.Vector2
-
<static> Shuffle(items)
-
Shuffles the array in place. The shuffled array is both modified and returned.
Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
- Since: 3.0.0
- Source: src/actions/Shuffle.js (Line 9)
- See:
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SmootherStep(items, property, min, max [, inc])
-
Smootherstep is a sigmoid-like interpolation and clamping function.
The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.
Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
propertystring The property of the Game Object to interpolate.
minnumber The minimum interpolation value.
maxnumber The maximum interpolation value.
incboolean <optional>
false Should the values be incremented?
trueor set (false)- Since: 3.0.0
- Source: src/actions/SmootherStep.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> SmoothStep(items, property, min, max [, inc])
-
Smoothstep is a sigmoid-like interpolation and clamping function.
The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.
Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
propertystring The property of the Game Object to interpolate.
minnumber The minimum interpolation value.
maxnumber The maximum interpolation value.
incboolean <optional>
false Should the values be incremented?
trueor set (false)- Since: 3.0.0
- Source: src/actions/SmoothStep.js (Line 9)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> Spread(items, property, min, max [, inc])
-
Takes an array of Game Objects and then modifies their
propertyso the value equals, or is incremented, by the calculated spread value.The spread value is derived from the given
minandmaxvalues and the total number of items in the array.For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call:
Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1);Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
propertystring The property of the Game Object to spread.
minnumber The minimum value.
maxnumber The maximum value.
incboolean <optional>
false Should the values be incremented?
trueor set (false)- Since: 3.0.0
- Source: src/actions/Spread.js (Line 7)
Returns:
The array of Game Objects that were passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> ToggleVisible(items)
-
Takes an array of Game Objects and toggles the visibility of each one. Those previously
visible = falsewill becomevisible = true, and vice versa.Parameters:
Name Type Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
- Since: 3.0.0
- Source: src/actions/ToggleVisible.js (Line 7)
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
-
<static> WrapInRectangle(items, rect [, padding])
-
Wrap each item's coordinates within a rectangle's area.
Parameters:
Name Type Argument Default Description itemsarray | Array.<Phaser.GameObjects.GameObject> An array of Game Objects. The contents of this array are updated by this Action.
rectPhaser.Geom.Rectangle The rectangle.
paddingnumber <optional>
0 An amount added to each side of the rectangle during the operation.
- Since: 3.0.0
- Source: src/actions/WrapInRectangle.js (Line 10)
- See:
Returns:
The array of Game Objects that was passed to this Action.
- Type
- array | Array.<Phaser.GameObjects.GameObject>
