mirror of
https://github.com/WhitestormJS/whs.js.git
synced 2025-12-08 20:26:23 +00:00
24 lines
645 B
Plaintext
24 lines
645 B
Plaintext
extends ../../layout.pug
|
|
|
|
block body
|
|
div(class="note")
|
|
h4 Guide to StateModule
|
|
p
|
|
| 1) Go to the `console` in devtools.
|
|
br
|
|
| 2) Type:
|
|
br
|
|
code state.to('green');
|
|
br
|
|
| The example `plane` and `sphere` should change their color to green by loading to configuration called `green`.
|
|
br
|
|
| 3) Type:
|
|
br
|
|
code state.to('default');
|
|
br
|
|
| Now you switched back to `default` configuration.
|
|
br
|
|
| 4) You can also change only specific parameter of state using .set() :
|
|
br
|
|
code state.set({sphereColor: 0x00ff00});
|