### Set Tween Start and Complete Callbacks Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Chain 'OnStart' and 'OnComplete' to define functions that execute at the beginning and end of the tween, respectively. ```csharp myTween.OnStart(myStartFunction).OnComplete(myCompleteFunction); ``` -------------------------------- ### Example Tweening Script Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md A basic example script to test GTweensGodot installation. Assign a Node2D to the 'Target' export variable and run the scene to see the tween in action. ```csharp public partial class TweenExample : Node { [Export] public Node2D Target; public override void _Ready() { Target.TweenPosition(new Vector2(100, 0), 3) .SetEasing(Easing.InOutCubic) .Play(); } } ``` -------------------------------- ### Example: Generic Tween for C# Float Property Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Demonstrates animating a float property using a getter and setter lambda. The tween runs for 1 second. ```csharp // For default C# values GTween tween = GTweenExtensions.Tween( () => Target.SomeFloat, // Getter x => Target.SomeFloat = x, // Setter 100f, // To 1 // Duration ); ``` -------------------------------- ### Example: Generic Tween for Godot Vector2 Property Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Shows how to animate a Vector2 property like Position using lambda getters and setters. The tween lasts 1 second. ```csharp // For Godot specific values GTween tween = GTweenGodotExtensions.Tween( () => Target.Position, // Getter x => Target.Position = x, // Setter new Vector2(100f, 100f), // To 1 // Duration ); ``` -------------------------------- ### Create GTweensGodotUpdater Node Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md This script serves as the updater node for GTweensGodot when installed via NuGet. It needs to be autoloaded in your Godot project settings. ```csharp public partial class GTweensGodotUpdater : GodotGTweensContextNode { } ``` -------------------------------- ### Build a GTween Sequence Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Use GTweenSequenceBuilder to append and join tweens, delays, callbacks, and nested sequences. Call Build() to get the final sequence tween. This is useful for creating complex, multi-part animations. ```csharp GTween tween = GTweenSequenceBuilder.New() .Append(Target.TweenPositionX(100, 0.5f)) .Join(Target.TweenScale(new Vector2(2, 2), 1)) .Append(Target.TweenPositionY(100, 1)) .AppendTime(0.5f) .Append(Target.TweenPositionX(0, 1)) .AppendSequence(s => s .AppendTime(0.5f) .Append(Target.TweenPositionX(1, 1)) ) .AppendCallback(() => GD.Print("I'm finished!")) .Build(); tween.SetEasing(Easing.InOutCubic); tween.Play(); ``` -------------------------------- ### Simple Tweening with GTweens-Godot Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Demonstrates basic tweening of a Node2D's position using C# extension methods. Requires a Node2D target and sets an easing function before playing. ```csharp public partial class TweenExample : Node { [Export] public Node2D Target; public override void _Ready() { Target.TweenPosition(new Vector2(100, 0), 3) .SetEasing(Easing.InOutCubic) .Play(); } } ``` -------------------------------- ### Asynchronous Tween Playback Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Demonstrates how to play tweens asynchronously using C# async/await. This allows for sequential execution of tweens within an async method, respecting a cancellation token. ```csharp async Task RunSomething(CancellationToken) { await tween1.PlayAsync(cancellationToken); await tween2.PlayAsync(cancellationToken); } ``` -------------------------------- ### Building Complex Tween Sequences Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Illustrates how to chain multiple tweens and actions together using GTweenSequenceBuilder. Supports appending tweens, delays, and callbacks, with options to join concurrent tweens. ```csharp public partial class PlayTweenSequenceExample : Node { [Export] public Node2D Target; public override void _Ready() { GTween tween = GTweenSequenceBuilder.New() .Append(Target.TweenPositionX(100f, 0.5f)) .Join(Target.TweenScale(new Vector2(2f, 2f), 1f)) .AppendTime(0.5f) .JoinCallback(() => GD.Print("I'm waiting some time!")) .Append(Target.TweenPositionX(0f, 1f)) .AppendCallback(() => GD.Print("I'm finished!")) .Build(); tween.SetEasing(Easing.InOutCubic); tween.Play(); } } ``` -------------------------------- ### Applying Easing Functions to Tweens Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Shows how to apply different easing functions to tweens, including predefined Easing enums and custom Curve resources. Two tweens are created and animated with distinct easing methods. ```csharp public partial class EasingExample : Node { [Export] public Node2D Target1; [Export] public Node2D Target2; [Export] public Easing Easing1; [Export] public Curve Easing2; public override void _Ready() { GTween tween1 = Target1.TweenPositionX(100, 3); tween1.SetEasing(Easing1); tween1.Play(); GTween tween2 = Target2.TweenPositionX(100, 3); tween2.SetEasing(Easing2); tween2.Play(); } } ``` -------------------------------- ### Configuring Looping Animations Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Demonstrates how to set the number of loops for a tween animation. The 'SetLoops' method takes an integer to define the repetition count. ```csharp public partial class LoopingTweenExample : Node { [Export] public Node2D Target; [Export] public int Loops; public override void _Ready() { GTween tween = Target.TweenPositionX(150, 1); tween.SetLoops(Loops); tween.Play(); } } ``` -------------------------------- ### Attaching Callbacks to Tweens Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Illustrates how to attach a callback function to be executed at a specific point in a tween sequence. The `AppendCallback` method takes a delegate for the function to be called. ```csharp void Callback() { } GTween tween = GTweenSequenceBuilder.New() .AppendCallback(Callback) .Build(); ``` -------------------------------- ### Tween Node2D Position X Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Use this shortcut to animate the X property of a Node2D. Requires a duration in seconds. ```csharp node2D.TweenPositionX(100f, 1f); ``` -------------------------------- ### Adding Delays to Tween Sequences Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Shows how to introduce a delay into a tween sequence using `AppendTime`. This is useful for timing animations relative to each other. ```csharp GTween tween = GTweenSequenceBuilder.New() .AppendTime(0.5f) .Build(); ``` -------------------------------- ### Godot Pause Support for Tweens Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Explains how GTweens interacts with Godot's `GetTree().Paused` state. Tweens played with `Play()` will pause, while `PlayUnpausable()` will continue regardless of the pause state. ```csharp tween.Play(); // Will be paused when GetTree().Paused is set to true tween.PlayUnpausable(); // Won't be paused when GetTree().Paused is set to true ``` -------------------------------- ### Tween Node3D Scale Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Use this shortcut to animate the scale of a Node3D. Requires a Vector3 for the target scale and a duration in seconds. ```csharp node3D.TweenScale(new Vector3(2f, 2f, 2f), 1f); ``` -------------------------------- ### Set Tween Loops and Easing Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Chain 'SetLoops' and 'SetEasing' to configure tween behavior. 'SetLoops' defines the number of repetitions, and 'SetEasing' specifies the animation curve. ```csharp myTween.SetLoops(4).SetEasing(Easing.InOutCubic); ``` -------------------------------- ### Generic Tween for Godot Values Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Use GTweenGodotExtensions.Tween for animating Godot-specific types like Vector2 or Vector3. Provide getter, setter, target value, and duration. ```csharp // For Godot specific values (Vector2, Vector3, etc) GTweenGodotExtensions.Tween(getter, setter, to, duration) ``` -------------------------------- ### Tween Control Size Y Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Use this shortcut to animate the Y property of a Control element. Requires a duration in seconds. ```csharp control.TweenSizeY(200f, 2f); ``` -------------------------------- ### Generic Tween for C# Values Source: https://github.com/guillemsc/gtweensgodot/blob/main/README.md Use GTweenExtensions.Tween for animating default C# types like int or float. Provide getter, setter, target value, and duration. ```csharp // For default C# values (int, float, etc) GTweenExtensions.Tween(getter, setter, to, duration) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.