public void TweenUIProperty(Control ui, string property, object initialValue, object targetValue, float duration, Tween.TransitionType transitionType = Tween.TransitionType.Linear, Tween.EaseType easeType = Tween.EaseType.InOut, float delay = 0) { tween.InterpolateProperty(ui, property, initialValue, targetValue, duration, transitionType, easeType, delay); tween.Start(); }
public void ModulateFadeIn(Control control, float duration, Tween.TransitionType transitionType = Tween.TransitionType.Sine, Tween.EaseType easeType = Tween.EaseType.In) { // Make sure the control is visible control.Show(); control.Modulate = new Color(1, 1, 1, 0); Tween.InterpolateProperty(control, "modulate:a", 0, 1, duration, transitionType, easeType); Tween.Start(); }
public static void InterpolateProperty( this Tween tween, Godot.Object obj, NodePath property, object initialVal, object finalVal, float duration, Tween.TransitionType transType = Tween.TransitionType.Linear, Tween.EaseType easeType = Tween.EaseType.InOut, float delay = 0.0f) { tween.InterpolateProperty(obj, property, initialVal, finalVal, duration, transType, easeType, delay); }
public TransitionParams(TransitionType transitionType, float duration, bool invert = false, Color color = default, float transitionFeather = 0.2f, Tween.TransitionType tweenTransitionType = Tween.TransitionType .Linear, Tween.EaseType tweenEaseType = Tween.EaseType.InOut) { this.transitionType = transitionType; this.duration = duration; this.invert = invert; this.color = color == default ? Colors.Black : color; this.transitionFeather = transitionFeather; this.tweenTransitionType = tweenTransitionType; this.tweenEaseType = tweenEaseType; }
public void ModulateFadeOut(Control control, float duration, Tween.TransitionType transitionType = Tween.TransitionType.Sine, Tween.EaseType easeType = Tween.EaseType.In, bool hideOnFinished = true) { control.Modulate = new Color(1, 1, 1, 1); Tween.InterpolateProperty(control, "modulate:a", 1, 0, duration, transitionType, easeType); Tween.Start(); if (!Tween.IsConnected("tween_completed", this, nameof(HideControlOnFadeOutComplete)) && hideOnFinished) { Tween.Connect("tween_completed", this, nameof(HideControlOnFadeOutComplete), new Array { control }, (int)ConnectFlags.Oneshot); } }
public void InterpolateProperty(Object source, string property, object initialVal, object finalVal, float duration, Tween.TransitionType transType = Tween.TransitionType.Quint, Tween.EaseType easeType = Tween.EaseType.In, float delay = 0.0F) { Tween.InterpolateProperty(source, property, initialVal, finalVal, duration, transType, easeType, delay); }