Animating the scale of an object

How is it possible to make a transition in scale of an object?

For example, when the pointer is down create the object with zero scale and increase the size of it as long as the pointer is down.

As I understand the Animations and AnimationManager classes are completely irrelevant to this. Right? They are about the sprite sheet animations.

Then what is the way to do this in Phaser3? Maybe a little bit of a terminology issue I have here.

Yep, totally doable! You’ll want to use Tweens to accomplish it.

https://labs.phaser.io/index.html?dir=tweens/&q=

1 Like

But how to add a tween like an event handler then remove/stop it in another event like pointer up.

For that it might be easier to do in update().

if (this.input.activePointer.isDown) {
  sprite.scale += 0.05;
}
1 Like

@snowbillr @samme Thanks a lot!

As a new game developer and Phaserio, I have just made that up, I understand from your helpful answers and docs if I was just to transition the scale or any other property, as well, I guess, I would need to use Tweens, but since the transition is triggered by frames-lasting user input I need to implement it in the update scene function and use events.

You could also use a tween, you would just save the tween and then call pause or resume from the input handlers.