Gendarme Gendarme - 4 months ago 15
HTML Question

What is the difference between Container and DisplayObjectContainer?

I am using a JavaScript library called PIXI and am looking for a way to "zoom" in my game. A search on the internet suggested that I put everything inside a

DisplayObjectContainer
and then resize it to simulate a zoom-effect.

The thing is that I already have
Container
(aka
stage
), and I think that is resizable too. So I don't understand the reason behind using a
DisplayObjectContainer
when you have a
Container
already. And frankly, I don't even see the difference between them.

This page says the following about
DisplayObjectContainer
:


A DisplayObjectContainer represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.


This other page says the following about
Container
:


A Container represents a collection of display objects. It is the base class of all display objects that act as a container for other objects.


The only possible scenario I can imagine is that one of these container-objects is outdated and belongs to an older version of PIXI, which isn't too unrealistic since PIXI is rather new and could change a lot. But this is just a guess.

Answer

The guess is correct. DisplayObjectContainer is outdated and replaced with Container.