title: Phaser 3: Difference between Container and Groups?
body: <p>Im implementing Phaser 3 on my website to organize some objects. I made a bunch of cards using Containers, but I realize that containers seem to be a similar situation to Groups. What would be the better option between the 2? Im trying to make it so the user can organize their cards by groups.
  Here's how the cards are built as an example:</p>
  <pre><code>let card = this.add.container(100, 50, [
        this.graphics = this.add.graphics(),
        this.graphics.lineStyle(3, 0xffffff),
        this.graphics.fillStyle(0x02455f, 1),
        this.graphics.strokeRect(0, 0, 390, 390),
        this.graphics.fillRect(0, 0, 390, 390),
        this.cardName = this.add.text(
          190,
          175,
          &quot;Card&quot;, {
          font: &quot;30px Arial&quot;,
          color: &quot;#ffffff&quot;
        }
        ),
        this.cardName.setOrigin(0.5)
      ])
  
      let card2 = this.add.container(500, 50, [
        this.graphics = this.add.graphics(),
        this.graphics.lineStyle(3, 0xffffff),
        this.graphics.fillStyle(0x02455f, 1),
        this.graphics.strokeRect(0, 0, 390, 390),
        this.graphics.fillRect(0, 0, 390, 390),
        this.cardName = this.add.text(
          190,
          175,
          &quot;Card2&quot;, {
          font: &quot;30px Arial&quot;,
          color: &quot;#ffffff&quot;
        }
        ),
        this.cardName.setOrigin(0.5)
      ])
  </code></pre>
  <p>Now here's both the Container and Group being built:</p>
  <pre><code>    let container = this.add.container(900, 200,[
        this.graphics = this.add.graphics(),
        this.graphics.lineStyle(3, 0xffffff),
        this.graphics.fillStyle(0x02455f, 1),
        this.graphics.strokeRect(0, 0, 1000, 490),
        this.graphics.fillRect(0, 0, 1000, 490),
        card, card2
      ])
  
      let cardGroup = this.add.group();
      cardGroup.add(card);
      cardGroup.add(card2);
  </code></pre>
  <p>I realized with the container Im able to build the outer lines for it to make it seem like the cards are in there, I assume groups can do the same as well? My goal is to ultimately let the user create groups that the user can organize their cards.</p>