UITween Class
Definition
Namespace: Brine2D.UI
Animates a single float property from a start value to an end value over time
via a setter delegate.
Inheritance System.Object → UITween
Example
C#
// Slide a panel 200 px to the right over 0.4 s with a cubic ease-out.
var tween = new UITween(
from: panel.Position.X,
to: panel.Position.X + 200f,
duration: 0.4f,
setter: v => panel.Position = panel.Position with { X = v },
easing: UIEasing.CubicOut);
canvas.StartTween(tween);
Remarks
Advance manually by calling Update\(float\) each frame, or register with StartTween\(UITween\) for automatic updates.
| Constructors | |
|---|---|
| UITween\(float, float, float, Action<float>, Func<float,float>\) | Creates a new tween. |
| Properties | |
|---|---|
| Delay | Seconds to wait before the animation begins. |
| Duration | Total animation duration in seconds. |
| IsComplete | Whether the tween has finished \(always false for looping tweens\). |
| IsPaused | Whether the tween is paused. Paused tweens ignore Update\(float\) calls. |
| LoopMode | Determines what happens when the tween completes. |
| OvershootTime | Time elapsed beyond Duration on the frame the tween completed. Zero while the tween is still running or before it has been updated. |
| Progress | Normalised progress in [0, 1] \(before easing is applied\). |
| Methods | |
|---|---|
| Complete() | Immediately jumps to the end value and marks the tween complete. |
| Reset() | Resets the tween to the start value and marks it not complete. |
| Update\(float\) | Advances the tween by deltaTime seconds. |
| Events | |
|---|---|
| OnComplete | Fired once when a Once tween reaches its end. |
| OnUpdate | Fired each frame the tween advances, with the current eased value. |