Hi,
Is it possible to smoothly lerp a font size? Or can a font only be resized in increments of 1?
This is what I have, the score pops out then returns back slower, but noticed the font only increases by 1 not anything smaller giving it a slightly jerky look, is there a better way?
function lerpScore(){
j = 0.0;
// the last number below is seconds to lerp
rate = 1.0/0.2;
while (j < 1.0) {
j += Time.deltaTime * rate;
TextStyle.fontSize = Mathf.Lerp(30, 80, j);
yield;
}
j = 0.0;
// the last number below is seconds to lerp
rate = 1.0/1.0;
while (j < 1.0) {
j += Time.deltaTime * rate;
TextStyle.fontSize = Mathf.Lerp(80, 30, j);
yield;
}
↧