Shrink and Grow effect

I am trying to make a shrink and grow back to original scale animation of an image

something like the following gif
https://vue-native.io/images/grow-animation.gif

I tried using tweens and scale and…

  1. I could not figure how to reverse scaling
  2. I am not sure if using onUpdate - is the right way to center the image
  3. Should I use ease = Linear for smooth animation?

this.tweens = this.scene.tweens.add({
targets: this.image,
scale: 0.8,
ease: ‘Linear’,
duration: 1000,
repeat: -1,
onUpdate: () => {
this.image.setX(110)
this.image.setY(110)
},
})

Thanks for any tip

I figured out that:

for the reverse effect

yoyo: true

to keep the image in the center - I deleted (DirectX programmer)))

image.setOrigin(0, 0)

Thanks for the great engine

1 Like