Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Code/RoomNameDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -41,6 +43,9 @@ public RoomNameDisplay() {
textLerp = 0f;
colorLerp = 1f;
outTimer = 0f;
scale = 1f;
prevScale = 1f;
nextScale = 1f;

bgColor = Color.Black;
textColor = Color.White;
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -208,6 +214,7 @@ public void SetInstant()
drawLerp = 1f;
colorLerp = 1f;
textLerp = 1f;
scale = nextScale;
}
}

Expand Down
3 changes: 2 additions & 1 deletion Code/RoomNameTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading