Skip to main content
Version: Phaser v4.0.0

Types.Math

HashCellConfig

<static> HashCellConfig

nametypeoptionaldefaultdescription
algorithmnumberYes0The algorithm to use. 0 is TRIG. 1 is PCG. 2 is PCG_FLOAT.
noiseCellsArray.<number>Yes"[ 32, 32, 32, 32 ]"The number of cells in the range 0-1, on each axis (XYZW). Unused axes need not be defined.
noiseWrapboolean | Array.<number>YestrueWhether to wrap the cells smoothly. If a number array, the cells repeat after that many. If true, the wrap is set to equal noiseCells`.
noiseVariationArray.<number>Yes"[ 1, 1, 1, 1 ]"The variation of the cells away from a perfect grid. Unused axes need not be defined.
noiseIterationsnumberYes1How many octaves of noise to render, creating a more detailed output.
noiseModenumberYes0Which mode to render. 0 is sharp edged cells. 1 is flat colored cells. 2 is soft edged cells.
noiseSmoothingnumberYes1How smooth to render in mode 2.
noiseSeedArray.<number>Yes"[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]"The seed which determines the cell pattern. A different seed creates an entirely different pattern. You only need numbers equal to the square of the input vector's length (1, 4, 9, or 16).

Type: object

Member of: Phaser.Types.Math

Source: src/math/typedefs/HashCellConfig.js#L1
Since: 4.0.0


HashSimplexConfig

<static> HashSimplexConfig

nametypeoptionaldefaultdescription
noiseCellsArray.<number>Yes"[ 32, 32, 32 ]"The number of cells in each dimension.
noisePeriodArray.<number>YesHow many cells in each dimension before the pattern repeats. By default, this is the same as noiseCells.
noiseFlownumberYes0The initial flow of the noise field. Use this to evolve the field along a period.
noiseWarpAmountnumberYes0How much turbulence to apply to the noise field.
noiseIterationsnumberYes1How many octaves of noise to render, creating a more detailed output.
noiseWarpIterationsnumberYes1How many octaves of noise to apply as turbulence, if noiseWarpAmount is greater than 0.
noiseDetailPowernumberYes2How much to increase detail per octave.
noiseFlowPowernumberYes2How much to increase flow per octave.
noiseContributionPowernumberYes2How much to shrink the contribution per octave.
noiseWarpDetailPowernumberYes2How much to increase warp detail per octave.
noiseWarpFlowPowernumberYes2How much to increase warp flow per octave.
noiseWarpContributionPowernumberYes2How much to shrink the warp contribution per octave.
noiseSeedArray.<number>Yes"[ 1, 2, 3 ]"The hash seed. Each seed creates a different pattern. The numbers must be integers.

Type: object

Member of: Phaser.Types.Math

Source: src/math/typedefs/HashSimplexConfig.js#L1
Since: 4.0.0


RectangleLike

<static> RectangleLike

nametypeoptionaldescription
xnumberNoThe x component.
ynumberNoThe y component.
widthnumberNoThe width component.
heightnumberNoThe height component.

Type: object

Member of: Phaser.Types.Math

Source: src/math/typedefs/RectangleLike.js#L1
Since: 3.80.0


SinCosTable

<static> SinCosTable

nametypeoptionaldescription
sinnumberNoThe sine value.
cosnumberNoThe cosine value.
lengthnumberNoThe length.

Type: object

Member of: Phaser.Types.Math

Source: src/math/typedefs/SinCosTable.js#L1
Since: 3.0.0


Vector2Like

<static> Vector2Like

nametypeoptionaldescription
xnumberNoThe x component.
ynumberNoThe y component.

Type: object

Member of: Phaser.Types.Math

Source: src/math/typedefs/Vector2Like.js#L1
Since: 3.0.0


Vector3Like

<static> Vector3Like

nametypeoptionaldescription
xnumberYesThe x component.
ynumberYesThe y component.
znumberYesThe z component.

Type: object

Member of: Phaser.Types.Math

Source: src/math/typedefs/Vector3Like.js#L1
Since: 3.50.0


Vector4Like

<static> Vector4Like

nametypeoptionaldescription
xnumberYesThe x component.
ynumberYesThe y component.
znumberYesThe z component.
wnumberYesThe w component.

Type: object

Member of: Phaser.Types.Math

Source: src/math/typedefs/Vector4Like.js#L1
Since: 3.50.0