YMShen Posted January 17, 2018 Share Posted January 17, 2018 I want to render a Graphic into a RenderTexture via `app.renderer.render(graphics, renderTexture)` but problem is the code is running from a subClass extends PIXI.Sprite. The question is: Whether it's possible to access the renderer from child class? After googling a while I still didn't find an answer. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 17, 2018 Share Posted January 17, 2018 Containers don't depend on renderer, that's why its possible to render same container on multiple canvases. You have to add that dependency somehow. Also containers dont know about root element (will be added in pixi-v5), so you have to look at `container.parent` multiple times to get the root of your tree. Store renderer reference in the root and make a method that finds that root. Quote Link to comment Share on other sites More sharing options...
YMShen Posted January 18, 2018 Author Share Posted January 18, 2018 Thanks for the clarification! I end up using Root class singleton and static reference. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.