state(state) → {string}
Gets or Sets the state of the generator. This allows you to retain the values
that the generator is using between games, i.e. in a game save file.
To seed this generator with a previously saved state you can pass it as theseed
value in your game config, or call this method directly after Phaser has booted.
Call this method with no parameters to return the current state.
If providing a state it should match the same format that this method
returns, which is a string with a header !rnd
followed by the c
,s0
, s1
and s2
values respectively, each comma-delimited.
Parameters
Name | Type | Argument | Description |
---|---|---|---|
state | string | <optional> | Generator state to be set. |
Returns
string -
The current state of the generator.
- Source code: math/RandomDataGenerator.js (Line 322)
Please login to continue.