mirror of
https://gitlab.acidiclight.dev/sociallydistant/sociallydistant.git
synced 2025-01-22 09:31:47 -05:00
Add support for widget tweening
Signed-off-by: Ritchie Frodomar <alkalinethunder@gmail.com>
This commit is contained in:
parent
344c1f682e
commit
dc2df1b726
2 changed files with 13 additions and 6 deletions
|
@ -2,15 +2,22 @@ using Microsoft.Xna.Framework;
|
|||
|
||||
namespace AcidicGUI.Animation;
|
||||
|
||||
internal sealed class Animation<TValue> : Animation where TValue : struct
|
||||
internal sealed class Animation<TValue> : Animation
|
||||
where TValue : struct
|
||||
{
|
||||
private readonly InterpolationFunction<TValue> interpolator;
|
||||
private readonly TValue minValue;
|
||||
private readonly TValue maxValue;
|
||||
|
||||
|
||||
public Action<TValue>? UpdateCallback { get; set; }
|
||||
|
||||
public Animation(CurveFunction curve, float duration, InterpolationFunction<TValue> interpolator, TValue startValue, TValue endValue) : base(curve, duration)
|
||||
|
||||
public Animation(
|
||||
CurveFunction curve,
|
||||
float duration,
|
||||
InterpolationFunction<TValue> interpolator,
|
||||
TValue startValue,
|
||||
TValue endValue
|
||||
) : base(curve, duration)
|
||||
{
|
||||
this.interpolator = interpolator;
|
||||
this.minValue = startValue;
|
||||
|
@ -66,7 +73,7 @@ internal abstract class Animation
|
|||
Complete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal void Cancel()
|
||||
{
|
||||
if (IsCancelled)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using AcidicGUI.Events;
|
||||
using AcidicGUI.Animation;
|
||||
using AcidicGUI.Events;
|
||||
using AcidicGUI.Layout;
|
||||
using AcidicGUI.Rendering;
|
||||
using AcidicGUI.TextRendering;
|
||||
|
|
Loading…
Reference in a new issue