Simplified Tweens - CSharpGodotTools/Template GitHub Wiki
Tweening has never been so easy!!! 🦄
new GTween(colorRect)
.SetParallel()
.Animate("scale", Vector2.One * 2, 2).Elastic()
.Animate("color", Colors.Green, 2).Sine().EaseIn()
.Animate("rotation", Mathf.Pi, 2).Elastic().EaseOut();
GTween tween = new GTween(colorRect)
.SetAnimatingProp("color")
.AnimateProp(Colors.Red, 0.5).Sine().EaseIn()
.Parallel().AnimateProp(Colors.Green, 0.5).Sine().EaseOut()
.Parallel().Animate("scale", Vector2.One * 2, 0.5).Sine()
.Callback(() => GD.Print("Finished!"))
.Loop();
tween.Stop();
[!TIP] Prefer strongly typed names over strings? Instead of typing for example
"scale"
doControl.PropertyName.Scale
[!TIP] Below is an example of how to run delayed code. Tweens are attached to nodes so if the node gets destroyed so will the tween.
GTween.Delay(node, seconds, () => callback);