Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Multiple Containers on single Renderer


pavarine
 Share

Recommended Posts

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.

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...