コード例 #1
0
 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();
 }
コード例 #2
0
    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();
    }
コード例 #3
0
 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);
 }
コード例 #4
0
ファイル: Transitions.cs プロジェクト: lospec/lowresjam2020
 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;
 }
コード例 #5
0
    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);
        }
    }
コード例 #6
0
 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);
 }