Hello,
To keep it short, I want to scale a Container using a tween, this has to repeat 2 times and do a callback on each repeat. But having to scale the X and Y seperately fires the callback function twice, is there any way how to prevent this?
This is what I use:
this.tweens.add({
targets: this,
scaleX: 1.2,
scaleY: 1.2,
hold: 500,
duration: 500,
ease: ‘Back.easeInOut’,
repeat: 2,
onRepeat: function() { console.log(‘hit’); },
});
I also tried to set a temporary variable, set it to 1 and tween that variable and use an onUpdate: function { this.setScale(variable); }. It works, but it’s not really nice.
TLDR: How to scale an object using 1 property in a tween? or How to prevent multiple callbacks from multiple properties in a tween using the onRepeat callback?