Good Afternoon,
I am running into an issue with maintaining spacing between two separate bitmapTexts.
Currently I am outputting the text “Streak x2” (or “x3”, “x4” etc…). The word “Streak” is one bitmap text and the multiplier text (x2) is another bitmap text. The multiplier text is in it’s own bitmapText because it has a different tint to set it apart.
My goal is to fade the text in and make yoyo in scale to look more exciting.
This is my tween currently
// bitmapText objects
const textTargets = [streakText, multiplierText]
_this.#scene.tweens.add({
targets: textTargets,
alpha: {value: 1, duration: 200, ease: "Cubic.easeIn"},
scale: {value: 1.5, duration: 200, yoyo: true, ease: "Power2", repeat: 1},
onComplete: function () {
_this.#scene.tweens.add({
targets: textTargets,
alpha: 0,
duration: 300,
delay: 900,
ease: "Power2",
})
}
})
The fade and scaling works well. However, the problem I’m running into is that the space between the two text targets remains the same as the scale increases. This causes the two to overlap towards the end of the tween.
Towards the beginning of the tween:
Towards the end of the tween:
My goal is that the spacing between the two text objects would scale as well so that there is no overlap.
Could anyone help direct me as to how to make this happen?
Thank you!