Types.Math
HashCellConfig
<static> HashCellConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| algorithm | number | Yes | 0 | The algorithm to use. 0 is TRIG. 1 is PCG. 2 is PCG_FLOAT. |
| noiseCells | Array.<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. |
| noiseWrap | boolean | Array.<number> | Yes | true | Whether to wrap the cells smoothly. If a number array, the cells repeat after that many. If true, the wrap is set to equal noiseCells`. |
| noiseVariation | Array.<number> | Yes | "[ 1, 1, 1, 1 ]" | The variation of the cells away from a perfect grid. Unused axes need not be defined. |
| noiseIterations | number | Yes | 1 | How many octaves of noise to render, creating a more detailed output. |
| noiseMode | number | Yes | 0 | Which mode to render. 0 is sharp edged cells. 1 is flat colored cells. 2 is soft edged cells. |
| noiseSmoothing | number | Yes | 1 | How smooth to render in mode 2. |
| noiseSeed | Array.<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
| name | type | optional | default | description |
|---|---|---|---|---|
| noiseCells | Array.<number> | Yes | "[ 32, 32, 32 ]" | The number of cells in each dimension. |
| noisePeriod | Array.<number> | Yes | How many cells in each dimension before the pattern repeats. By default, this is the same as noiseCells. | |
| noiseFlow | number | Yes | 0 | The initial flow of the noise field. Use this to evolve the field along a period. |
| noiseWarpAmount | number | Yes | 0 | How much turbulence to apply to the noise field. |
| noiseIterations | number | Yes | 1 | How many octaves of noise to render, creating a more detailed output. |
| noiseWarpIterations | number | Yes | 1 | How many octaves of noise to apply as turbulence, if noiseWarpAmount is greater than 0. |
| noiseDetailPower | number | Yes | 2 | How much to increase detail per octave. |
| noiseFlowPower | number | Yes | 2 | How much to increase flow per octave. |
| noiseContributionPower | number | Yes | 2 | How much to shrink the contribution per octave. |
| noiseWarpDetailPower | number | Yes | 2 | How much to increase warp detail per octave. |
| noiseWarpFlowPower | number | Yes | 2 | How much to increase warp flow per octave. |
| noiseWarpContributionPower | number | Yes | 2 | How much to shrink the warp contribution per octave. |
| noiseSeed | Array.<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
| name | type | optional | description |
|---|---|---|---|
| x | number | No | The x component. |
| y | number | No | The y component. |
| width | number | No | The width component. |
| height | number | No | The height component. |
Type: object
Member of: Phaser.Types.Math
Source: src/math/typedefs/RectangleLike.js#L1
Since: 3.80.0
SinCosTable
<static> SinCosTable
| name | type | optional | description |
|---|---|---|---|
| sin | number | No | The sine value. |
| cos | number | No | The cosine value. |
| length | number | No | The length. |
Type: object
Member of: Phaser.Types.Math
Source: src/math/typedefs/SinCosTable.js#L1
Since: 3.0.0
Vector2Like
<static> Vector2Like
| name | type | optional | description |
|---|---|---|---|
| x | number | No | The x component. |
| y | number | No | The y component. |
Type: object
Member of: Phaser.Types.Math
Source: src/math/typedefs/Vector2Like.js#L1
Since: 3.0.0
Vector3Like
<static> Vector3Like
| name | type | optional | description |
|---|---|---|---|
| x | number | Yes | The x component. |
| y | number | Yes | The y component. |
| z | number | Yes | The z component. |
Type: object
Member of: Phaser.Types.Math
Source: src/math/typedefs/Vector3Like.js#L1
Since: 3.50.0
Vector4Like
<static> Vector4Like
| name | type | optional | description |
|---|---|---|---|
| x | number | Yes | The x component. |
| y | number | Yes | The y component. |
| z | number | Yes | The z component. |
| w | number | Yes | The w component. |
Type: object
Member of: Phaser.Types.Math
Source: src/math/typedefs/Vector4Like.js#L1
Since: 3.50.0