diff --git a/Code/RoomNameDisplay.cs b/Code/RoomNameDisplay.cs index 204a43d..ed35995 100644 --- a/Code/RoomNameDisplay.cs +++ b/Code/RoomNameDisplay.cs @@ -32,6 +32,8 @@ public class RoomNameDisplay : Entity private float nextOutline; public float scale; + public float prevScale; + public float nextScale; private float outTimer; public RoomNameDisplay() { @@ -41,6 +43,9 @@ public RoomNameDisplay() { textLerp = 0f; colorLerp = 1f; outTimer = 0f; + scale = 1f; + prevScale = 1f; + nextScale = 1f; bgColor = Color.Black; textColor = Color.White; @@ -78,6 +83,7 @@ public override void Update() if (text == nextText) { textLerp = Calc.Approach(textLerp, 1f, Engine.DeltaTime * speed); + scale = Calc.LerpClamp(prevScale, nextScale, Ease.CubeOut(textLerp)); } else { @@ -208,6 +214,7 @@ public void SetInstant() drawLerp = 1f; colorLerp = 1f; textLerp = 1f; + scale = nextScale; } } diff --git a/Code/RoomNameTrigger.cs b/Code/RoomNameTrigger.cs index a479606..ea7bec7 100644 --- a/Code/RoomNameTrigger.cs +++ b/Code/RoomNameTrigger.cs @@ -49,7 +49,8 @@ public override void OnEnter(Player player) display.SetColor(textColor, bgColor, lineColor, lineAmt); display.SetTimer(Math.Max(timer, 0f)); display.nextOffset = yOffset; - display.scale = scale; + display.prevScale = display.scale; + display.nextScale = scale; if (instant) { display.SetInstant();