Skip to content

Commit

Permalink
Moved texture updating to its own function
Browse files Browse the repository at this point in the history
  • Loading branch information
justalemon committed Mar 20, 2024
1 parent 9a8669f commit 55635b9
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions LemonUI/Elements/ScaledAnim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,9 @@ public ScaledAnim(string dict, PointF pos, SizeF size) : base(pos, size, dict, s

#endregion

#region Functions
#region Tools

/// <summary>
/// Draws the animation.
/// </summary>
public override void Draw()
private void UpdateTexture()
{
if (Duration <= 0)
{
Expand Down Expand Up @@ -137,7 +134,18 @@ public override void Draw()
}

Texture = currentFrame.ToString();
}

#endregion

#region Functions

/// <summary>
/// Draws the animation.
/// </summary>
public override void Draw()
{
UpdateTexture();
base.Draw();
}

Expand Down

0 comments on commit 55635b9

Please sign in to comment.