Closed jmcoder1 closed 2 years ago
Hi @jmcoder1,
Thanks for filing this issue!
This is actually the expected behaviour. The Stage.options
prop can only be set once during creation. This is how PIXI works. In PIXI you would do something like this:
const options = {
backgroundColor: 0xff0000,
antialias: true,
autoStart: false,
resolution: 2,
clearBeforeRender: false,
};
const app = new PIXI.Application(options);
Internally these parameters belong to different parts of PIXI core, for instance the backgroundColor
belongs to PIXI.Renderer
but forceCanvas
belongs to the creation of the internal renderer. These are set during initializing of the PIXI.Application
and some of these option parameters can therefore not directly be manipulated via PIXI.Application
.
Changing the backgroundColor
can be done via app.renderer.backgroundColor
:
https://codepen.io/inlet/pen/dyZeLLM/3a3524acedbc0ac4accc6c9093cec16d?editors=0110
State changes affect other React-Pixi Stage props, such as height or width. But, when I attempt to change the Stack options.backgroundColor, the backgroundColor does not change on state change.
Here's my code: