Izzimach/react-pixi

Expose renderer for access to child components.

Opened this issue · 0 comments

As referenced in #53 it would be nice to get better access to the renderer used in order to support rendering to textures. My (not totally fleshed out) possibility:

  • PIXIStage dumps the renderer (default or custom) into the context. Unfortunately this doesn't happen until after mounting, since the renderer needs access to the DOM canvas element.
  • Relevant child element 'subscribes' to the renderer in context.
  • When renderer gets created and dumped into the context this should trigger a re-render of most (or all?) child elements which can then check the context for the renderer and use it.

Kinda clunky, but then pixi was not written to play well with React so a perfect solution is probably impossible.