private void FadeErrorMessage(Tween tween) { errorText.Alpha = 1 - tween.Value; }
public static Tween Position(Entity entity, Vector2 target, int duration, Ease.Easer easer, TweenMode mode = TweenMode.Single) { Tween tween = new Tween(mode, easer, duration, true); Vector2 start = entity.Position; tween.OnUpdate = (Tween t) => { entity.Position = Vector2.Lerp(start, target, t.Value); }; entity.Add(tween); return tween; }
private void FadeOut(Tween t) { image.Alpha = 1 - t.Value; }
public static Tween Add(Entity entity, int duration, Ease.Easer easer, Action<Tween> onUpdate, TweenMode mode = TweenMode.Single) { Tween tween = new Tween(mode, easer, duration, true); tween.OnUpdate = onUpdate; entity.Add(tween); return tween; }
private void Destroy(Tween t) { RemoveSelf(); }