Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container created with the GameObjectCreator does not show all children. #6743

Closed
Fake opened this issue Feb 18, 2024 · 2 comments
Closed

Container created with the GameObjectCreator does not show all children. #6743

Fake opened this issue Feb 18, 2024 · 2 comments

Comments

@Fake
Copy link

Fake commented Feb 18, 2024

Version

  • Phaser Version: 3.70.0
  • Operating system: Any
  • Browser:

Description

When you create a container with GameObjectCreator, only one of the children is displayed. Creating with GameObjectFactory works fine.

Example Test Code

class TestScene extends Phaser.Scene {
  create() {
    // does not show all children
    this.make.container({
      x: 10, y: 50,
      children: [
        this.make.text({
          text: "qwer",
          x: 50,
        }, false),
        this.make.text({
          text: "asdf",
          x: 100,
        }, false),
        this.make.text({
          text: "zxcv",
          x: 150,
        }, false),
      ]
    }, true)

    // this works fine
    this.add.container(10, 100, [
      this.make.text({
        text: "qwer",
        x: 50,
      }, false),
      this.make.text({
        text: "asdf",
        x: 100,
      }, false),
      this.make.text({
        text: "zxcv",
        x: 150,
      }, false),
    ])

    // this also works fine
    const container = this.make.container({
      x: 10, y: 150,
      children: [],
    }, false)
    container.add(this.make.text({
      text: "qewr",
      x: 50,
    }, false))
    container.add(this.make.text({
      text: "asdf",
      x: 100,
    }, false))
    container.add(this.make.text({
      text: "zxcv",
      x: 150,
    }, false))
    this.add.existing(container)
  }
}

new Phaser.Game({
  type: Phaser.AUTO,
  width: 320,
  height: 240,
  scene: new TestScene(),
})

Additional Information

@rgk
Copy link
Contributor

rgk commented Feb 20, 2024

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

@Fake
Copy link
Author

Fake commented Feb 21, 2024

I built and tested on the master branch. And yes, I confirmed the issue got fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants