0
\$\begingroup\$

I am developing a small game with Phaser 3. I want to make a container with several buttons, representing a pop-up dialog. The container needs to pop up on completing a task. When container pops up, I want all the buttons in the container to pop up as well.

I thought the best way would be to tween the container. But I cannot find any useful methods or implementations as such in the documentation.

How can I implement this tween?

\$\endgroup\$
0
1
\$\begingroup\$

Consider a simple tween where you tween over the scale of something:

scene.tweens.add({
  targets: mycontainer,
  scale: {
    from: 0,
    to: 1,
   }
  duration: 1000,
  ease: 'Linear'
})

already right there you are close to something "popping" up. In general, you can be as simple as much as you can be general about what you want to do to every child gameobject. Scale is good for this, but possibly not as a elegant as you want. You can also always just run multiple tweens for each object with shared variables in their tween config.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.