pavarine Posted October 7, 2015 Share Posted October 7, 2015 Hello everyone. I have the following situation:renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight - 200, 0, 0, 1);container = new PIXI.Container();colliderContainer = new PIXI.Container();All I want to do is render the two containers simultaneously. Is that possible? Whenever I try to...renderer.render(container);renderer.render(colliderContainer);I only get the elements of the last container, rendered in my screen. The elements of the first one dont appears. Thank you. Quote Link to comment Share on other sites More sharing options...
xerver Posted October 7, 2015 Share Posted October 7, 2015 For reference: https://github.com/pixijs/pixi.js/issues/2145 Quote Link to comment Share on other sites More sharing options...
Joe Kopena Posted October 8, 2015 Share Posted October 8, 2015 Isn't the OP's request actually much simpler? Don't you just want to make both of the containers children of another container and then render that root? Quote Link to comment Share on other sites More sharing options...
xerver Posted October 8, 2015 Share Posted October 8, 2015 You mean like this? https://github.com/pixijs/pixi.js/issues/2145#issuecomment-146260254 Quote Link to comment Share on other sites More sharing options...
neonwarge04 Posted October 9, 2015 Share Posted October 9, 2015 I also encountered similar problem. Is there a way I could use 2 containers in one renderer? Quote Link to comment Share on other sites More sharing options...
doskallemaskin Posted October 9, 2015 Share Posted October 9, 2015 I also encountered similar problem. Is there a way I could use 2 containers in one renderer? not to be that guy, but did you read the link? Short summary: var stage = new PIXI.Container();var container1 = new PIXI.Container();var container2 = new PIXI.Container();stage.addChild(container1);stage.addChild(container2);renderer.render(stage); Here you will have two(actually 3) containers rendering in one renderer. The containers can hold childrens of many types, such as Graphics, Sprite, Container, Text, Overriden DisplayObject. Johnny Kontrolleti 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.