-
Notifications
You must be signed in to change notification settings - Fork 10
Simplified Tweens
Valk edited this page Oct 4, 2024
·
6 revisions
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
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);